Sha256: ccc5f0c11a5b1f93ea03ae0736a874e625c19f5b8a468e708277b3aa057196ed

Contents?: true

Size: 1.37 KB

Versions: 6

Compression:

Stored size: 1.37 KB

Contents

module JsonVoorhees
	class AppScaffoldGenerator < 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"
	  class_option :model, :type => :boolean, :default => true, :description => "Create model stub tests"
	  class_option :request, :type => :boolean, :default => true, :description => "Create request stub tests"
	  class_option :routing, :type => :boolean, :default => true, :description => "Create routing stub tests"
	  class_option :arcadex, :type => :boolean, :default => true, :description => "Send requests with an arcadex header"
	

		def sprint
			if options.arcadex?
				run "rails g json_voorhees:app_make_authorizations #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
				run "rails g json_voorhees:app_make_tests #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
			else
				run "rails g json_voorhees:app_make_authorizations --skip-arcadex #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
				run "rails g json_voorhees:app_make_tests --skip-arcadex #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
			end
		end

		private

	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
json_voorhees-0.3.6 lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb
json_voorhees-0.3.5 lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb
json_voorhees-0.3.0 lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb
json_voorhees-0.2.3 lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb
json_voorhees-0.2.2 lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb
json_voorhees-0.2.1 lib/generators/json_voorhees/app_scaffold/app_scaffold_generator.rb