Sha256: d23251330691521fe4dcf153de050fada646210ef1029ce27de968aad98f50cd

Contents?: true

Size: 702 Bytes

Versions: 15

Compression:

Stored size: 702 Bytes

Contents

module HorsePower
	class AuthorizationGenerator < Rails::Generators::Base
	  source_root File.expand_path('../templates', __FILE__)
		argument :resource_name, :type => :string
	  argument :api_version, :type => :string, :default => "1"
	  argument :attributes, type: :array, default: [], banner: "field:type field:type"

	  def sprint
	  	template "auth_file.rb.erb", "gems/authorization/lib/authorization/v#{api_version}/#{HorsePower.get_singular(resource_name)}.rb"
	  	require_authfile
	  end

	  private

		def require_authfile
      prepend_file 'gems/authorization/lib/authorization.rb', "require \'authorization/v#{api_version}/#{HorsePower.get_singular(resource_name)}\'\n"
	  end
	  
	end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
horse_power-0.6.5 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.6.0 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.5.0 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.4.1 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.4.0 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.3.3 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.3.2 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.2.1 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.2.0 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.1.6 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.1.5 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.1.2 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.1.1 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.1.0 lib/generators/horse_power/authorization/authorization_generator.rb
horse_power-0.0.1 lib/generators/horse_power/authorization/authorization_generator.rb