Commit 13eeb969 by Shu Fujita Committed by Andrew W. Lee

Refactor AnnotateModels::Parser (#728)

# Summary * I replaced `#blank?` of ActiveSupport to `#present?` * I moved `AnnotateModels::Parser#commit` after `#parser ` because `#commit` is used after `#parser` in `#parse`.
parent ac907696
......@@ -31,18 +31,18 @@ module Annotate
private
def commit
env.each_pair do |key, value|
ENV[key] = value
end
end
def parser
OptionParser.new do |option_parser|
add_options_to_parser(option_parser)
end
end
def commit
env.each_pair do |key, value|
ENV[key] = value
end
end
def add_options_to_parser(option_parser) # rubocop:disable Metrics/MethodLength
has_set_position = {}
positions = ANNOTATION_POSITIONS
......@@ -184,7 +184,7 @@ module Annotate
option_parser.on('-R', '--require path',
"Additional file to require before loading models, may be used multiple times") do |path|
env['require'] = if !env['require'].blank?
env['require'] = if env['require'].present?
env['require'] + ",#{path}"
else
path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment