Class: DryGenerator
- Inherits:
-
Rails::Generator::NamedBase
- Object
- Rails::Generator::NamedBase
- DryGenerator
- Defined in:
- lib/dry_generator.rb
Constant Summary collapse
- HAS_WILL_PAGINATE =
defined?(WillPaginate)
- HAS_FORMTASTIC =
defined?(Formtastic)
- HAS_INHERITED_RESOURCES =
defined?(InheritedResources)
- HAS_SHOULDA =
defined?(Shoulda)
- HAS_RSPEC =
defined?(Rspec)
- BANNER_ARGS =
Banner: Generator arguments and options.
[ "[field:type field:type ...]" ].freeze
- BANNER_OPTIONS =
[ "[--skip-tests]", "[--shoulda]", "[--rspec]", "[--fixtures]", "[--fgirl]", "[--machinist]", "[--odaddy]" ].freeze
- DEFAULT_ARGS =
{ :actions => (CONFIG_ARGS['actions'].split(',').compact.uniq.collect { |v| v.downcase.to_sym } rescue nil), :formats => (CONFIG_ARGS['formats'].split(',').compact.uniq.collect { |v| v.downcase.to_sym } rescue nil) }.freeze
- DEFAULT_OPTIONS =
{ :resourceful => CONFIG_OPTIONS['resourceful'] || HAS_INHERITED_RESOURCES, :formtastic => CONFIG_OPTIONS['formtastic'] || HAS_FORMTASTIC, :pagination => CONFIG_OPTIONS['pagination'] || HAS_WILL_PAGINATE, :skip_tests => !CONFIG_OPTIONS['tests'] || false, :skip_helpers => !CONFIG_OPTIONS['helpers'] || false, :skip_views => !CONFIG_OPTIONS['views'] || false, :layout => CONFIG_OPTIONS['layout'] || false, :fixtures => CONFIG_OPTIONS['fixtures'] || false, :factory_girl => CONFIG_OPTIONS['factory_girl'] || CONFIG_OPTIONS['fgirl'] || false, :machinist => CONFIG_OPTIONS['machinist'] || false, :object_daddy => CONFIG_OPTIONS['object_daddy'] || CONFIG_OPTIONS['odaddy'] || false, :test_unit => CONFIG_OPTIONS['test_unit'] || CONFIG_OPTIONS['tunit'] || true, :shoulda => CONFIG_OPTIONS['shoulda'] || false, :rspec => CONFIG_OPTIONS['rspec'] || false }.freeze
- TEST_PATHS =
{ :test_unit => 'test', :shoulda => 'test', :rspec => 'spec' }.freeze
- TEST_POST_FIX =
{ :test_unit => 'test', :shoulda => 'test', :rspec => 'spec' }.freeze
- DEFAULT_TEST_FRAMEWORK =
:test_unit
- DEFAULT_FACTORY_FRAMEWORK =
:fixtures
- TESTS_PATH =
File.join('test').freeze
- FUNCTIONAL_TESTS_PATH =
{ :test => 'functional', :shoulda => 'functional', :rspec => 'controllers' }
- UNIT_TESTS_PATH =
{ :test => 'unit', :shoulda => 'unit', :rspec => 'models', }
- NON_ATTR_ARG_KEY_PREFIX =
'_'.freeze
Instance Attribute Summary collapse
-
#factory_framework ⇒ Object
Returns the value of attribute factory_framework.
-
#test_framework ⇒ Object
Returns the value of attribute test_framework.
-
#view_template_format ⇒ Object
Returns the value of attribute view_template_format.
Instance Method Summary collapse
-
#initialize(runtime_args, runtime_options = {}) ⇒ DryGenerator
constructor
A new instance of DryGenerator.
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ DryGenerator
Returns a new instance of DryGenerator.
89 90 91 92 93 |
# File 'lib/dry_generator.rb', line 89 def initialize(runtime_args, = {}) super(runtime_args, ) @test_framework = [:test_framework] || DEFAULT_TEST_FRAMEWORK end |
Instance Attribute Details
#factory_framework ⇒ Object
Returns the value of attribute factory_framework.
85 86 87 |
# File 'lib/dry_generator.rb', line 85 def factory_framework @factory_framework end |
#test_framework ⇒ Object
Returns the value of attribute test_framework.
85 86 87 |
# File 'lib/dry_generator.rb', line 85 def test_framework @test_framework end |
#view_template_format ⇒ Object
Returns the value of attribute view_template_format.
85 86 87 |
# File 'lib/dry_generator.rb', line 85 def view_template_format @view_template_format end |