Class: Maguro::Features
- Inherits:
-
Object
- Object
- Maguro::Features
- Defined in:
- lib/maguro/features.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#gemfile ⇒ Object
readonly
Returns the value of attribute gemfile.
-
#heroku ⇒ Object
readonly
Returns the value of attribute heroku.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
-
#initialize(builder) ⇒ Features
constructor
A new instance of Features.
- #run_all_updates ⇒ Object
Constructor Details
#initialize(builder) ⇒ Features
Returns a new instance of Features.
6 7 8 9 10 11 12 |
# File 'lib/maguro/features.rb', line 6 def initialize(builder) @builder = builder @app_name = builder.send(:app_name) @organization = builder.[:organization] @gemfile = Maguro::Gemfile.new(builder) @heroku = Maguro::Heroku.new(builder, app_name, builder.[:organization]) end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
4 5 6 |
# File 'lib/maguro/features.rb', line 4 def app_name @app_name end |
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
4 5 6 |
# File 'lib/maguro/features.rb', line 4 def builder @builder end |
#gemfile ⇒ Object (readonly)
Returns the value of attribute gemfile.
4 5 6 |
# File 'lib/maguro/features.rb', line 4 def gemfile @gemfile end |
#heroku ⇒ Object (readonly)
Returns the value of attribute heroku.
4 5 6 |
# File 'lib/maguro/features.rb', line 4 def heroku @heroku end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
4 5 6 |
# File 'lib/maguro/features.rb', line 4 def organization @organization end |
Instance Method Details
#run_all_updates ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/maguro/features.rb', line 14 def run_all_updates # TODO: Doug: check return value of commands? What happens if commands fail? # When git commands failed, the error is reported to the console, but the generator # completes successfully builder.git :init update_gitignore commit 'Initial commit with updated .gitignore' create_rvm_files clean_gemfile use_pg use_12_factor_gem add_test_gems add_ruby_version commit 'add gems' remove_turbo_links commit 'remove turbolinks' create_database_files commit 'add database.sample.yml and database.yml files' create_readme commit 'add readme' create_app_env_var_sample commit 'add app environment variable sample file' install_rspec commit 'install rspec' create_spec_folders update_rails_helper_spec commit 'customize rspec for basic usage' add_homepage commit 'add homepage' springify commit 'springify app' setup_guard commit 'add guard files' create_local_database commit 'add blank schema file' checkout_develop_branch # NOTE: Heroku setup has to come after initial init for it to create the proper # Git remotes. if builder.[:heroku] heroku.create heroku.push end if builder.[:bitbucket] git_url = setup_bitbucket if !git_url.nil? builder.git remote: "add origin #{git_url}" builder.git push: "-u origin --all" end end if builder.[:github] setup_github builder.git push: '-u origin --all' end end |