Class: Aruba::Initializers::CommonInitializer
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Aruba::Initializers::CommonInitializer
- Includes:
- Thor::Actions
- Defined in:
- lib/aruba/initializer.rb
Overview
Common initializer
Instance Method Summary collapse
-
#add_gem ⇒ Object
Add gem to gemfile.
Instance Method Details
#add_gem ⇒ Object
Add gem to gemfile
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/aruba/initializer.rb', line 17 def add_gem file = 'Gemfile' creator = if File.exist? file :append_to_file else :create_file end content = if File.exist? file %(gem 'aruba', '~> #{Aruba::VERSION}') else %(source 'https://rubygems.org'\ngem 'aruba', '~> #{Aruba::VERSION}'\n) end send creator, file, content end |