Class: Dslable::Generators::Settings::Gemfile
- Inherits:
-
Object
- Object
- Dslable::Generators::Settings::Gemfile
- Defined in:
- lib/generators/settings/gemfile.rb
Constant Summary collapse
- GEMFILE_TEMPLATE =
"source 'https://rubygems.org'\n\ngemspec\ngem \"rspec\", \"~> 2.14.1\"\ngem \"thor\", \"~> 0.18.1\"\ngem \"simplecov\", \"~> 0.8.2\"\ngem \"activesupport\", \"~> 4.0.1\"\ngem \"activemodel\", \"~> 4.0.2\"\ngem \"tudu\", \"~> 0.0.4\"\n"
Instance Attribute Summary collapse
-
#dsl ⇒ Object
Returns the value of attribute dsl.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(_dsl) ⇒ Gemfile
constructor
initialize dsl model === Params - _dsl: input from dsl.
Constructor Details
#initialize(_dsl) ⇒ Gemfile
initialize dsl model
Params
-
_dsl: input from dsl
24 25 26 27 |
# File 'lib/generators/settings/gemfile.rb', line 24 def initialize(_dsl) fail InvalidDslError.new('dsl not allow nil') if _dsl.nil? @dsl = _dsl end |
Instance Attribute Details
#dsl ⇒ Object
Returns the value of attribute dsl.
19 20 21 |
# File 'lib/generators/settings/gemfile.rb', line 19 def dsl @dsl end |
Instance Method Details
#generate ⇒ Object
29 30 31 |
# File 'lib/generators/settings/gemfile.rb', line 29 def generate File.open('./Gemfile', 'w') { |f|f.puts GEMFILE_TEMPLATE } end |