Class: EchoBase
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- EchoBase
- Includes:
- Thor::Actions
- Defined in:
- lib/echo_base.rb
Class Method Summary collapse
-
.source_root ⇒ Object
class_option :heroku, :default => :false class_option :db, :default => ‘sqlite’, :desc => ‘Database to use, options are couchdb, mongo, redis, mysql, postgres’.
Instance Method Summary collapse
- #app_files ⇒ Object
- #bundle ⇒ Object
- #cleanup ⇒ Object
- #config ⇒ Object
- #cucumber ⇒ Object
- #devise ⇒ Object
- #done ⇒ Object
- #dot_files ⇒ Object
- #gemfile ⇒ Object
- #generate_rails_app ⇒ Object
- #git ⇒ Object
- #heroku ⇒ Object
- #migrations ⇒ Object
- #public ⇒ Object
- #rspec ⇒ Object
- #subdomains ⇒ Object
Class Method Details
.source_root ⇒ Object
class_option :heroku, :default => :false class_option :db, :default => ‘sqlite’, :desc => ‘Database to use, options are couchdb, mongo, redis, mysql, postgres’
16 17 18 |
# File 'lib/echo_base.rb', line 16 def self.source_root @_source_root ||= File.('../templates/', __FILE__) end |
Instance Method Details
#app_files ⇒ Object
27 28 29 |
# File 'lib/echo_base.rb', line 27 def app_files directory 'app', "#{app_path}/app", :force => true end |
#bundle ⇒ Object
43 44 45 |
# File 'lib/echo_base.rb', line 43 def bundle run 'bundle' end |
#cleanup ⇒ Object
85 86 87 88 |
# File 'lib/echo_base.rb', line 85 def cleanup remove_file "#{app_path}/public/index.html" remove_file "#{app_path}/public/images/rails.png" end |
#config ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/echo_base.rb', line 35 def config directory 'config', "#{app_path}/config" # application rb stuff: # include lib files # include generators # include js defaults end |
#cucumber ⇒ Object
75 76 77 |
# File 'lib/echo_base.rb', line 75 def cucumber run 'rails g cucumber:install' end |
#devise ⇒ Object
62 63 64 65 |
# File 'lib/echo_base.rb', line 62 def devise #run devise generator #update devise file? end |
#done ⇒ Object
98 99 100 |
# File 'lib/echo_base.rb', line 98 def done say "all done" end |
#dot_files ⇒ Object
57 58 59 60 |
# File 'lib/echo_base.rb', line 57 def dot_files copy_file 'gitignore', "#{app_path}/.gitignore", :force => true #rvmrc end |
#gemfile ⇒ Object
31 32 33 |
# File 'lib/echo_base.rb', line 31 def gemfile copy_file 'Gemfile', "#{app_path}/Gemfile", :force => true end |
#generate_rails_app ⇒ Object
22 23 24 25 |
# File 'lib/echo_base.rb', line 22 def generate_rails_app invoke Rails::Generators::AppGenerator inject_into_file "#{app_path}/config/routes.rb", "resources :users\n\tmatch '/auth/:provider/callback', :to => 'sessions#create'\n\troot :to => 'users#index'", :after => "Application.routes.draw do\n" end |
#git ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/echo_base.rb', line 90 def git begin run 'git init;git add .;git commit -a -m "Initial Commit"' rescue say "Git fail" end end |
#heroku ⇒ Object
79 80 81 82 83 |
# File 'lib/echo_base.rb', line 79 def heroku # heroku create # heroku addons add # end |
#migrations ⇒ Object
47 48 49 50 51 |
# File 'lib/echo_base.rb', line 47 def migrations directory 'db', "#{app_path}/db", :force => true run 'rake db:create:all' run 'rake db:migrate' end |
#public ⇒ Object
53 54 55 |
# File 'lib/echo_base.rb', line 53 def public directory 'public', "#{app_path}/public", :force => true end |
#rspec ⇒ Object
71 72 73 |
# File 'lib/echo_base.rb', line 71 def rspec run 'rails g rspec:install' end |
#subdomains ⇒ Object
67 68 69 |
# File 'lib/echo_base.rb', line 67 def subdomains end |