Class: Archangel::Commands::ThemeCommand
- Inherits:
-
BaseCommand
- Object
- Thor::Group
- BaseCommand
- Archangel::Commands::ThemeCommand
- Defined in:
- lib/archangel/commands/theme_command.rb
Overview
Generate Archangel theme
Instance Method Summary collapse
-
#banner ⇒ Object
Banner.
-
#copy_common_directories ⇒ Object
Copy common directories that are shared with extension generator.
-
#copy_common_templates ⇒ Object
Copy common templates that are shared with extension generator.
-
#copy_plugin_directories ⇒ Object
Copy theme directories and chmod bin scripts.
-
#copy_plugin_templates ⇒ Object
Copy theme templates.
-
#create_plugin_directory ⇒ Object
Create theme directory.
-
#create_plugin_gemspec ⇒ Object
Create theme .gemspec file.
-
#generate ⇒ Object
Generate theme.
Instance Method Details
#banner ⇒ Object
Banner
Say something nice
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/archangel/commands/theme_command.rb', line 91 def puts %( ****************************************************************** Your theme has been generated with a gemspec dependency on Archangel v#{archangel_version} #{random_compliment} ****************************************************************** ) end |
#copy_common_directories ⇒ Object
Copy common directories that are shared with extension generator
49 50 51 52 53 |
# File 'lib/archangel/commands/theme_command.rb', line 49 def copy_common_directories %w[spec].each do |dir| directory("../common/#{dir}", "#{theme_name}/#{dir}") end end |
#copy_common_templates ⇒ Object
Copy common templates that are shared with extension generator
69 70 71 72 73 74 75 |
# File 'lib/archangel/commands/theme_command.rb', line 69 def copy_common_templates %w[ .editorconfig .gitignore .rspec .rubocop.yml MIT-LICENSE ].each do |tpl| template("../common/#{tpl}", "#{theme_name}/#{tpl}") end end |
#copy_plugin_directories ⇒ Object
Copy theme directories and chmod bin scripts
58 59 60 61 62 63 64 |
# File 'lib/archangel/commands/theme_command.rb', line 58 def copy_plugin_directories %w[ app bin lib ].each { |dir| directory(dir, "#{theme_name}/#{dir}") } chmod("#{theme_name}/bin/rails", 0o755) end |
#copy_plugin_templates ⇒ Object
Copy theme templates
80 81 82 83 84 |
# File 'lib/archangel/commands/theme_command.rb', line 80 def copy_plugin_templates %w[ Gemfile Rakefile README.md ].each { |tpl| template(tpl, "#{theme_name}/#{tpl}") } end |
#create_plugin_directory ⇒ Object
Create theme directory
35 36 37 |
# File 'lib/archangel/commands/theme_command.rb', line 35 def create_plugin_directory empty_directory(theme_name) end |
#create_plugin_gemspec ⇒ Object
Create theme .gemspec file
42 43 44 |
# File 'lib/archangel/commands/theme_command.rb', line 42 def create_plugin_gemspec template("theme.gemspec", "#{theme_name}/#{theme_name}.gemspec") end |
#generate ⇒ Object
Generate theme
Usage
archangel theme [THEME_NAME]
bundle exec bin/archangel theme [THEME_NAME]
28 29 30 |
# File 'lib/archangel/commands/theme_command.rb', line 28 def generate name_plugin end |