Skip to content

Commit

Permalink
[api] Use method parameters instead of instance variables
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeuken committed Jul 19, 2015
1 parent cd05ba1 commit d21ad7f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/api/app/mixins/request_source_diff.rb
Expand Up @@ -6,11 +6,8 @@ class ActionSourceDiffer
attr_accessor :action

def perform(opts)
@view_xml = (opts[:view] == 'xml')
@withissues = opts[:withissues]

gather_source_packages.map { |spkg|
diff_for_source(spkg)
diff_for_source(spkg, opts)
}.join
end

Expand All @@ -33,7 +30,7 @@ def gather_source_packages
end
end

def diff_for_source(spkg)
def diff_for_source(spkg, options = {})
@target_project = action.target_project
@target_package = action.target_package

Expand Down Expand Up @@ -92,8 +89,8 @@ def diff_for_source(spkg)
end
end
# run diff
query[:view] = 'xml' if @view_xml # Request unified diff in full XML view
query[:withissues] = 1 if @withissues
query[:view] = 'xml' if options[:view] == 'xml' # Request unified diff in full XML view
query[:withissues] = 1 if options[:withissues]
BsRequestAction.get_package_diff(path, query)
end

Expand Down

0 comments on commit d21ad7f

Please sign in to comment.