Sha256: 50dd4d318120545b787da956e78ac7311c70cd7f1cdcfe6a9ea9f8ba9c8f6a6b

Contents?: true

Size: 615 Bytes

Versions: 9

Compression:

Stored size: 615 Bytes

Contents

require 'rails/generators'

module Genesis

  class ContextsGenerator < Rails::Generators::Base

    desc "Description:\n  Generate one or more context folders."

    argument :contexts, :type => :string, :required => true

    def self.source_root
      File.join File.dirname(__FILE__),
                'templates'
    end

    def install_contexts
      normalized_contexts.each do |context|
        empty_directory File.join( Genesis::SEEDS_ROOT, 'contexts', context )
      end
    end

    def normalized_contexts
      return contexts if contexts.is_a?( Array )

      contexts.split ','
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
genesis-1.10.0 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.9.0 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.8.2 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.8.1 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.8.0 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.7.0 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.6.0 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.5.0 lib/generators/genesis/contexts/contexts_generator.rb
genesis-1.4.0 lib/generators/genesis/contexts/contexts_generator.rb