Sha256: cc439ec3eadc46f1fb5b27f98c92c554996ffb58e222d15a75293a37c0cde45e

Contents?: true

Size: 761 Bytes

Versions: 4

Compression:

Stored size: 761 Bytes

Contents

# encoding: utf-8
require 'generators/generators'
require 'dslable_dsl'

module Dslable::Generators::Settings
  class Gemfile
    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

    attr_accessor :dsl

    # == initialize dsl model
    # === Params
    #- _dsl: input from dsl
    def initialize(_dsl)
      fail InvalidDslError.new('dsl not allow nil') if _dsl.nil?
      @dsl = _dsl
    end

    def generate
      File.open('./Gemfile', 'w') { |f|f.puts GEMFILE_TEMPLATE }
    end
  end
  class InvalidDslError < StandardError; end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dslable-0.0.6 lib/generators/settings/gemfile.rb
dslable-0.0.5 lib/generators/settings/gemfile.rb
dslable-0.0.4 lib/generators/settings/gemfile.rb
dslable-0.0.3 lib/generators/settings/gemfile.rb