Class: Annotate::Parser
- Inherits:
-
Object
- Object
- Annotate::Parser
- Defined in:
- lib/annotate/parser.rb
Overview
Class for handling command line arguments
Constant Summary collapse
- DEFAULT_OPTIONS =
{ target_action: :do_annotations, exit: false }.freeze
- ANNOTATION_POSITIONS =
%w[before top after bottom].freeze
- FILE_TYPE_POSITIONS =
%w[position_in_class position_in_factory position_in_fixture position_in_test position_in_routes position_in_serializer].freeze
- EXCLUSION_LIST =
%w[tests fixtures factories serializers].freeze
- FORMAT_TYPES =
%w[bare rdoc yard markdown].freeze
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args, env) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(args, env) ⇒ Parser
Returns a new instance of Parser.
25 26 27 28 29 |
# File 'lib/annotate/parser.rb', line 25 def initialize(args, env) @args = args @options = DEFAULT_OPTIONS.dup @env = env end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
12 13 14 |
# File 'lib/annotate/parser.rb', line 12 def args @args end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
12 13 14 |
# File 'lib/annotate/parser.rb', line 12 def env @env end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/annotate/parser.rb', line 12 def @options end |
Class Method Details
.parse(args, env = {}) ⇒ Object
8 9 10 |
# File 'lib/annotate/parser.rb', line 8 def self.parse(args, env = {}) new(args, env).parse end |
Instance Method Details
#parse ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/annotate/parser.rb', line 31 def parse # To split up because right now this method parses and commits parser.parse!(args) commit end |