class Archangel::Commands::ExtensionCommand
Generate Archangel
extension
Public Instance Methods
copy_common_directories()
click to toggle source
Copy common directories that are shared with theme generator
# File lib/archangel/commands/extension_command.rb, line 52 def copy_common_directories %w[ bin lib spec ].each do |dir| directory("../common/#{dir}", "#{extension_name}/#{dir}") end chmod("#{extension_name}/bin/rails", 0o755) end
copy_common_templates()
click to toggle source
Copy common templates that are shared with theme generator
# File lib/archangel/commands/extension_command.rb, line 74 def copy_common_templates %w[ .gitignore .rspec Gemfile MIT-LICENSE Rakefile ].each do |tpl| template("../common/#{tpl}", "#{extension_name}/#{tpl}") end end
copy_plugin_directories()
click to toggle source
Copy extension directories and chmod bin scripts
# File lib/archangel/commands/extension_command.rb, line 65 def copy_plugin_directories %w[ config lib ].each { |dir| directory(dir, "#{extension_name}/#{dir}") } end
copy_plugin_templates()
click to toggle source
Copy extension templates
# File lib/archangel/commands/extension_command.rb, line 85 def copy_plugin_templates %w[ README.md ].each { |tpl| template(tpl, "#{extension_name}/#{tpl}") } end
corrected_plugin_name()
click to toggle source
# File lib/archangel/commands/extension_command.rb, line 116 def corrected_plugin_name ext_name = extension_name.downcase unless /^archangel_/.match?(ext_name) ext_name = "archangel_#{ext_name}" end Thor::Util.snake_case(ext_name) end
create_plugin_directory()
click to toggle source
Create extension directory
# File lib/archangel/commands/extension_command.rb, line 37 def create_plugin_directory empty_directory(extension_name) end
create_plugin_gemspec()
click to toggle source
Create extension .gemspec file
# File lib/archangel/commands/extension_command.rb, line 44 def create_plugin_gemspec template("extension.gemspec", "#{extension_name}/#{extension_name}.gemspec") end
generate()
click to toggle source
Generate extension
Usage
archangel extension [EXTENSION_NAME] bundle exec bin/archangel extension [EXTENSION_NAME]
# File lib/archangel/commands/extension_command.rb, line 30 def generate name_plugin end
name_plugin()
click to toggle source
# File lib/archangel/commands/extension_command.rb, line 112 def name_plugin @extension_name = corrected_plugin_name end