Class: Dslable::Generators::Settings::Gemfile
- Inherits:
-
Object
- Object
- Dslable::Generators::Settings::Gemfile
- Defined in:
- lib/generators/settings/gemfile.rb
Constant Summary collapse
- GEMFILE_TEMPLATE =
<<-EOF source 'https://rubygems.org' gemspec gem "rspec", "~> 2.14.1" gem "thor", "~> 0.18.1" gem "simplecov", "~> 0.8.2" gem "activesupport", "~> 4.0.1" gem "activemodel", "~> 4.0.2" gem "tudu", "~> 0.0.4" EOF
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 |