Class: Ipage
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Ipage
- Includes:
- Thor::Actions
- Defined in:
- lib/ipage.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#before_creating ⇒ Object
system “rails new kkkk” set_accessors!.
- #change_config_files ⇒ Object
-
#create_root ⇒ Object
if comman.
Class Method Details
.say_step(message) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/ipage.rb', line 18 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
14 15 16 |
# File 'lib/ipage.rb', line 14 def self.source_root @_source_root ||= File.('../templates', __FILE__) end |
Instance Method Details
#before_creating ⇒ Object
system “rails new kkkk” set_accessors!
41 42 43 |
# File 'lib/ipage.rb', line 41 def before_creating set_accessors! end |
#change_config_files ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/ipage.rb', line 61 def change_config_files #store_application_definition! template "Gemfile", "Gemfile", :force => true template "hgignore", ".hgignore", :force => true directory "stylesheets", "public/stylesheets" directory "javascripts", "public/javascripts" directory "app", "app", :force => true directory "config", "config", :force => true #directory "layouts", "app/views/layouts", :force => true #template "application.html.erb", "app/views/layouts/application.html.erb", :force => true #template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true remove_file ".gitignore" remove_file "public/stylesheets/.gitkeep" remove_file "public/images/rails.png" remove_file "public/index.html" remove_file "README" remove_file "public/javascripts/application.js" remove_file "public/javascripts/controls.js" remove_file "public/javascripts/dragdrop.js" remove_file "public/javascripts/effects.js" remove_file "public/javascripts/prototype.js" remove_file "public/javascripts/rails.js" end |
#create_root ⇒ Object
if comman
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ipage.rb', line 46 def create_root #set_accessors! #directory "root", "." #system "rails new "+name invoke Rails::Generators::AppGenerator, [ path ] self.destination_root = File.(path, destination_root) FileUtils.cd(destination_root) end |