Class: Enginex
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Enginex
- Includes:
- Thor::Actions
- Defined in:
- lib/enginex.rb
Class Method Summary collapse
Instance Method Summary collapse
- #change_config_files ⇒ Object
- #change_gitignore ⇒ Object
- #create_root ⇒ Object
- #create_tests_or_specs ⇒ Object
- #invoke_rails_app_generator ⇒ Object
- #remove_uneeded_rails_files ⇒ Object
Class Method Details
.say_step(message) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/enginex.rb', line 17 def self.say_step() @step = (@step || 0) + 1 class_eval <<-METHOD, __FILE__, __LINE__ + 1 def step_#{@step} #{"puts" if @step > 1} say_status "STEP #{@step}", #{.inspect} end METHOD end |
.source_root ⇒ Object
13 14 15 |
# File 'lib/enginex.rb', line 13 def self.source_root @_source_root ||= File.('../templates', __FILE__) end |
Instance Method Details
#change_config_files ⇒ Object
62 63 64 65 66 |
# File 'lib/enginex.rb', line 62 def change_config_files store_application_definition! template "rails/boot.rb", "#{dummy_path}/config/boot.rb", :force => true template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true end |
#change_gitignore ⇒ Object
49 50 51 |
# File 'lib/enginex.rb', line 49 def change_gitignore template "gitignore", ".gitignore" end |
#create_root ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/enginex.rb', line 37 def create_root self.destination_root = File.(path, destination_root) set_accessors! directory "root", "." FileUtils.cd(destination_root) end |
#create_tests_or_specs ⇒ Object
45 46 47 |
# File 'lib/enginex.rb', line 45 def create_tests_or_specs directory test_path end |
#invoke_rails_app_generator ⇒ Object
55 56 57 58 |
# File 'lib/enginex.rb', line 55 def invoke_rails_app_generator invoke Rails::Generators::AppGenerator, [ File.(dummy_path, destination_root) ] end |
#remove_uneeded_rails_files ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/enginex.rb', line 70 def remove_uneeded_rails_files inside dummy_path do remove_file ".gitignore" remove_file "db/seeds.rb" remove_file "doc" remove_file "Gemfile" remove_file "lib/tasks" remove_file "public/images/rails.png" remove_file "public/index.html" remove_file "public/robots.txt" remove_file "README" remove_file "test" remove_file "vendor" end end |