Sha256: 2eb1c46d0ef6746a54210db46f11e728501a6098c31f14cf2b7fbfe482ed5421

Contents?: true

Size: 775 Bytes

Versions: 22

Compression:

Stored size: 775 Bytes

Contents

require 'generators/cantango/base'
require 'generators/cantango/license_base'

module Cantango
  module Generators
    class LicenseGenerator < Cantango::Generators::Base 
      desc "Creates a License for a Permit in 'app/licenses' with reusable permissions"

      argument     :name,         :type => :string,    :desc => "Name of license"

      class_option :licenses,     :type => :array,     :default => [],  :desc => "Sub licenses"

      source_root File.dirname(__FILE__) + '/templates'

      def main_flow
        return if name.empty?
        create_license
      end

      protected

      def create_license
        template "license.erb", "app/permits/licenses/#{name}_license.rb"
      end

      include Cantango::Generators::LicenseBase
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
cantango-permits-0.1.1 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4.7 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4.6 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4.5 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4.3 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4.2 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4.1 lib/generators/cantango/license/license_generator.rb
cantango-0.9.4 lib/generators/cantango/license/license_generator.rb
cantango-0.9.3.2 lib/generators/cantango/license/license_generator.rb
cantango-0.8.9.5 lib/generators/cantango/license/license_generator.rb
cantango-0.8.9.4 lib/generators/cantango/license/license_generator.rb
cantango-0.8.9.3 lib/generators/cantango/license/license_generator.rb
cantango-0.8.9.2 lib/generators/cantango/license/license_generator.rb
cantango-0.8.9.1 lib/generators/cantango/license/license_generator.rb
cantango-0.8.9 lib/generators/cantango/license/license_generator.rb
cantango-0.8.8.1 lib/generators/cantango/license/license_generator.rb
cantango-0.8.8 lib/generators/cantango/license/license_generator.rb
cantango-0.8.7 lib/generators/cantango/license/license_generator.rb
cantango-0.8.6.2 lib/generators/cantango/license/license_generator.rb
cantango-0.8.6.1 lib/generators/cantango/license/license_generator.rb