Sha256: a58dedb6a0b0f6e2a35d7b5669893e766b45402dbb15e32ebb20c995b608c828
Contents?: true
Size: 1.05 KB
Versions: 34
Compression:
Stored size: 1.05 KB
Contents
module JsonVoorhees class AppMakeAuthorizationsGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) argument :module_name, :type => :string 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/#{module_snake}/v#{api_version}/#{resource_singular}.rb" require_authfile end private def require_authfile prepend_file 'gems/authorization/lib/authorization.rb', "require \'authorization/#{module_snake}/v#{api_version}/#{resource_singular}\'\n" end def resource_singular resource_name.underscore.singularize end def resource_plural resource_name.underscore.pluralize end def resource_camel resource_name.camelize.singularize end def module_camel module_name.camelize end def module_snake module_name.underscore.downcase end end end
Version data entries
34 entries across 34 versions & 1 rubygems