Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add Ruby version to Gemfile

* Follows thoughtbot style guideline.
* http://gembundler.com/man/gemfile.5.html#RUBY-ruby-
* Set Ruby to version being used to reflect expected behavior when
  running `rails new`.
  • Loading branch information...
commit 389cedab0f97e0b2fa5c847db5d2e7c02fc1b145 1 parent fbf3fcd
Dan Croak authored October 08, 2012
5  lib/suspenders/app_builder.rb
@@ -72,6 +72,11 @@ def create_database
72 72
       bundle_command 'exec rake db:create'
73 73
     end
74 74
 
  75
+    def set_ruby_to_version_being_used
  76
+      inject_into_file 'Gemfile', "\n\nruby '#{RUBY_VERSION}'",
  77
+        :after => /source 'https:\/\/rubygems.org'/
  78
+    end
  79
+
75 80
     def add_custom_gems
76 81
       additions_path = find_in_source_paths 'Gemfile_additions'
77 82
       new_gems = File.open(additions_path).read
1  lib/suspenders/generators/app_generator.rb
@@ -83,6 +83,7 @@ def add_jquery_ui
83 83
     end
84 84
 
85 85
     def customize_gemfile
  86
+      build :set_ruby_to_version_being_used
86 87
       build :add_custom_gems
87 88
 
88 89
       if options[:clearance]

0 notes on commit 389ceda

Please sign in to comment.
Something went wrong with that request. Please try again.