Class: Ipage

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ipage.rb

Class Method Summary collapse

Instance Method Summary collapse

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(message)
  @step = (@step || 0) + 1
  class_eval <<-METHOD, __FILE__, __LINE__ + 1
    def step_#{@step}
      #{"puts" if @step > 1}
      say_status "STEP #{@step}", #{message.inspect}
    end
  METHOD
end

.source_rootObject



14
15
16
# File 'lib/ipage.rb', line 14

def self.source_root
  @_source_root ||= File.expand_path('../templates', __FILE__)
end

Instance Method Details

#before_creatingObject

system “rails new kkkk” set_accessors!



41
42
43
# File 'lib/ipage.rb', line 41

def before_creating
  set_accessors!
end

#change_config_filesObject



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_rootObject

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.expand_path(path, destination_root)
  FileUtils.cd(destination_root)
  
end