Class: ProxyRb::Initializers::CommonInitializer
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- ProxyRb::Initializers::CommonInitializer
- Includes:
- Thor::Actions
- Defined in:
- lib/proxy_rb/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
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/proxy_rb/initializer.rb', line 18 def add_gem file = 'Gemfile' creator = if File.exist? file :append_to_file else :create_file end content = if File.exist? file %(gem 'proxy_rb', '~> #{ProxyRb::VERSION}') else %(source 'https://rubygems.org'\ngem 'proxy_rb', '~> #{ProxyRb::VERSION}'\n) end send creator, file, content end |