Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AnnotateModels::Parser #728

Merged
merged 2 commits into from
Jan 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/annotate/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def parse

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
Expand Down Expand Up @@ -184,7 +184,7 @@ def add_options_to_parser(option_parser) # rubocop:disable Metrics/MethodLength

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
Expand Down