Class: Rails::AppBuilder
- Inherits:
-
Object
- Object
- Rails::AppBuilder
- Defined in:
- lib/rails/generators/rails/app/app_generator.rb
Instance Method Summary collapse
- #app ⇒ Object
- #config ⇒ Object
- #configru ⇒ Object
- #database_yml ⇒ Object
- #db ⇒ Object
- #doc ⇒ Object
- #gemfile ⇒ Object
- #gitignore ⇒ Object
- #images ⇒ Object
- #javascripts ⇒ Object
- #lib ⇒ Object
- #log ⇒ Object
- #public_directory ⇒ Object
- #rakefile ⇒ Object
- #readme ⇒ Object
- #script ⇒ Object
- #stylesheets ⇒ Object
- #test ⇒ Object
- #tmp ⇒ Object
- #vendor_plugins ⇒ Object
Instance Method Details
#app ⇒ Object
55 56 57 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 55 def app directory 'app' end |
#config ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 59 def config empty_directory "config" inside "config" do template "routes.rb" template "application.rb" template "environment.rb" directory "environments" directory "initializers" directory "locales" end end |
#configru ⇒ Object
47 48 49 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 47 def configru template "config.ru" end |
#database_yml ⇒ Object
73 74 75 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 73 def database_yml template "config/databases/#{@options[:database]}.yml", "config/database.yml" end |
#db ⇒ Object
77 78 79 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 77 def db directory "db" end |
#doc ⇒ Object
81 82 83 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 81 def doc directory "doc" end |
#gemfile ⇒ Object
43 44 45 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 43 def gemfile template "Gemfile" end |
#gitignore ⇒ Object
51 52 53 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 51 def gitignore copy_file "gitignore", ".gitignore" end |
#images ⇒ Object
105 106 107 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 105 def images directory "public/images" end |
#javascripts ⇒ Object
113 114 115 116 117 118 119 120 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 113 def javascripts unless [:skip_prototype] directory "public/javascripts" else empty_directory_with_gitkeep "public/javascripts" create_file "public/javascripts/application.js" end end |
#lib ⇒ Object
85 86 87 88 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 85 def lib empty_directory "lib" empty_directory_with_gitkeep "lib/tasks" end |
#log ⇒ Object
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 90 def log empty_directory "log" inside "log" do %w( server production development test ).each do |file| create_file "#{file}.log" chmod "#{file}.log", 0666, :verbose => false end end end |
#public_directory ⇒ Object
101 102 103 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 101 def public_directory directory "public", "public", :recursive => false end |
#rakefile ⇒ Object
35 36 37 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 35 def rakefile template "Rakefile" end |
#readme ⇒ Object
39 40 41 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 39 def readme copy_file "README" end |
#script ⇒ Object
122 123 124 125 126 127 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 122 def script directory "script" do |content| "#{shebang}\n" + content end chmod "script", 0755, :verbose => false end |
#stylesheets ⇒ Object
109 110 111 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 109 def stylesheets empty_directory_with_gitkeep "public/stylesheets" end |
#test ⇒ Object
129 130 131 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 129 def test directory "test" end |
#tmp ⇒ Object
133 134 135 136 137 138 139 140 141 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 133 def tmp empty_directory "tmp" inside "tmp" do %w(sessions sockets cache pids).each do |dir| empty_directory(dir) end end end |
#vendor_plugins ⇒ Object
143 144 145 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 143 def vendor_plugins empty_directory_with_gitkeep "vendor/plugins" end |