Sha256: a85afb98fe499aad593d637d337002d562d3236778d41201543b96e739dc5b75

Contents?: true

Size: 1.39 KB

Versions: 19

Compression:

Stored size: 1.39 KB

Contents

module Sprout
  class RubyGenerator < Sprout::Generator::Base

    ##
    # The 3-part version for the new Ruby application.
    add_param :version, String, { :default => '0.0.pre' }

    ##
    # The name of the 'lib' directory - where your Ruby
    # files will be located.
    add_param :lib, String, { :default => 'lib' }

    ##
    # The name of the 'test' directory - where all tests
    # and fixtures will be located.
    add_param :test, String, { :default => 'test' }

    ##
    # The name of the 'unit' directory - where unit tests
    # will be located.
    add_param :unit, String, { :default => 'unit' }

    ##
    # The name of the 'fixtures' directory - where test
    # fixtures will be located.
    add_param :fixtures, String, { :default => 'fixtures' }

    ##
    # The name of the bin directory - where executables
    # will be located.
    add_param :bin, String, { :default => 'bin' }

    def manifest
      snake = input.snake_case

      directory snake do
        file 'Gemfile', 'ruby_gemfile'

        directory lib do
          template "#{snake}.rb", 'ruby_input.rb'
          directory snake do
            template 'base.rb', 'ruby_base.rb'
          end
        end

        directory test do
          directory fixtures
          directory unit
        end

        directory bin do
          template input.dash_case, 'ruby_executable'
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sprout-1.0.23.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.22.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.20.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.19.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.18.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.17.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.16.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.15.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.14.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.13.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.11.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.9.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.8.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.5.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.4.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.3.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.2.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.1.pre lib/sprout/generators/ruby/ruby_generator.rb
sprout-1.0.0.pre lib/sprout/generators/ruby/ruby_generator.rb