-
Notifications
You must be signed in to change notification settings - Fork 5
Fixes - #270 Implemented mapping from DAMS4 to SHARE V2 API and updat… #450
Conversation
…ed push function.
lib/dams/controller_helper.rb
Outdated
} | ||
json_data = {"jsonData": field_map} | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingWhitespace: Trailing whitespace detected.
lib/dams/controller_helper.rb
Outdated
} | ||
json_data = {"jsonData": field_map} | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/TrailingWhitespace: Trailing whitespace detected.
lib/dams/controller_helper.rb
Outdated
'tags': osf_mads_fields(document), | ||
'publisher': osf_publisher | ||
'ertra': osf_extra(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
'languages': osf_languages(document), | ||
'providerUpdatedDateTime': osf_date(document), | ||
'date_published': osf_date_published(document), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
def export_to_API(document) | ||
field_map = { | ||
'title': osf_title(document), | ||
'description': osf_description(document), | ||
'contributor': osf_contributors(document), | ||
'uris': osf_uris(document), | ||
'related_agents': osf_related_agents(document), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
url = "http://library.ucsd.edu/dc/collection/#{dams_data}" | ||
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
osf_data = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
def osf_uris(document) | ||
field_name = "id" | ||
def osf_description(document) | ||
field_name = "otherNote_json_tesim" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
lib/dams/controller_helper.rb
Outdated
end | ||
end | ||
osf_data | ||
end | ||
|
||
def osf_uris(document) | ||
field_name = "id" | ||
def osf_description(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = other_note['value'] if other_note['type'] == 'description' | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
} | ||
json_data = {"jsonData": field_map} | ||
end | ||
|
||
# Retrieve label from solr index instead of external record from repo | ||
# Retrieve label from solr index instead of external record from repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/CommentIndentation: Incorrect indentation detected (column 2 instead of 1).
lib/dams/controller_helper.rb
Outdated
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
osf_data = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
def osf_uris(document) | ||
field_name = "id" | ||
def osf_description(document) | ||
field_name = "otherNote_json_tesim" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
lib/dams/controller_helper.rb
Outdated
end | ||
end | ||
osf_data | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = other_note['value'] if other_note['type'] == 'description' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/BlockAlignment: end at 123, 6 is not aligned with dams_data.each do |datum| at 120, 4.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
url = "http://library.ucsd.edu/dc/collection/#{dams_data}" | ||
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
|
||
def osf_uris(document) | ||
field_name = "id" | ||
def osf_description(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
field_name = "otherNote_json_tesim" | ||
dams_data = document["#{field_name}"] | ||
osf_data = '' | ||
osf_data = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
end | ||
osf_data | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/DefEndAlignment: end at 126, 2 is not aligned with def at 114, 4.
Layout/TrailingWhitespace: Trailing whitespace detected.
lib/dams/controller_helper.rb
Outdated
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = other_note['value'] if other_note['type'] == 'description' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
url = "http://library.ucsd.edu/dc/collection/#{dams_data}" | ||
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 0) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
url = "http://library.ucsd.edu/dc/collection/#{dams_data}" | ||
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 5) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
def osf_description(document) | ||
field_name = "otherNote_json_tesim" | ||
dams_data = document["#{field_name}"] | ||
osf_data = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
def osf_description(document) | ||
field_name = "otherNote_json_tesim" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
lib/dams/controller_helper.rb
Outdated
field_name = "id" | ||
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
def osf_description(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
end | ||
osf_data | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/DefEndAlignment: end at 112, 4 is not aligned with def at 100, 2.
lib/dams/controller_helper.rb
Outdated
osf_data = other_note['value'] if other_note['type'] == 'description' | ||
end | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/BlockAlignment: end at 109, 8 is not aligned with dams_data.each do |datum| at 106, 6.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = other_note['value'] if other_note['type'] == 'description' | ||
end | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
end | ||
osf_data | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/DefEndAlignment: end at 126, 2 is not aligned with def at 114, 4.
Layout/TrailingWhitespace: Trailing whitespace detected.
lib/dams/controller_helper.rb
Outdated
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = other_note['value'] if other_note['type'] == 'description' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
url = "http://library.ucsd.edu/dc/collection/#{dams_data}" | ||
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 0) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
url = "http://library.ucsd.edu/dc/collection/#{dams_data}" | ||
osf_data = {"canonicalUri": url, "providerUris": url} | ||
dams_data.each do |datum| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 5) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
def osf_description(document) | ||
field_name = "otherNote_json_tesim" | ||
dams_data = document["#{field_name}"] | ||
osf_data = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
def osf_description(document) | ||
field_name = "otherNote_json_tesim" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
lib/dams/controller_helper.rb
Outdated
field_name = "id" | ||
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
def osf_description(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
end | ||
osf_data | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/DefEndAlignment: end at 112, 4 is not aligned with def at 100, 2.
lib/dams/controller_helper.rb
Outdated
osf_data = other_note['value'] if other_note['type'] == 'description' | ||
end | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/BlockAlignment: end at 109, 8 is not aligned with dams_data.each do |datum| at 106, 6.
lib/dams/controller_helper.rb
Outdated
|
||
if dams_data != nil | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = other_note['value'] if other_note['type'] == 'description' | ||
end | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
end | ||
end | ||
osf_data | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' | ||
end | ||
end | ||
osf_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationConsistency: Inconsistent indentation detected.
lib/dams/controller_helper.rb
Outdated
other_note = JSON.parse(datum) | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/EndAlignment: end at 109, 4 is not aligned with if at 104, 3.
lib/dams/controller_helper.rb
Outdated
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
if dams_data != nil | ||
dams_data.each do |datum| | ||
other_note = JSON.parse(datum) | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
|
||
if dams_data != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
lib/dams/controller_helper.rb
Outdated
def osf_extra(document) | ||
field_name = "otherNote_json_tesim" | ||
dams_data = document["#{field_name}"] | ||
osf_data = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
|
||
def osf_extra(document) | ||
field_name = "otherNote_json_tesim" | ||
dams_data = document["#{field_name}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Style/UnneededInterpolation: Prefer to_s over string interpolation.
lib/dams/controller_helper.rb
Outdated
end | ||
|
||
def osf_extra(document) | ||
field_name = "otherNote_json_tesim" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
lib/dams/controller_helper.rb
Outdated
type = (share_agent_type.include? type) ? type : "Contributor" | ||
end | ||
|
||
def osf_extra(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
'tags': osf_mads_fields(document), | ||
'publisher': osf_publisher | ||
'extra': osf_extra(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
@@ -70,7 +135,7 @@ def osf_uris(document) | |||
osf_data | |||
end | |||
|
|||
def osf_date(document) | |||
def osf_date_published(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
lib/dams/controller_helper.rb
Outdated
other_note = JSON.parse(datum) | ||
osf_data = { funding: other_note['value'] } if other_note['type'] == 'funding' | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/EndAlignment: end at 108, 4 is not aligned with if at 103, 3.
lib/dams/controller_helper.rb
Outdated
dams_data = document["#{field_name}"] | ||
osf_data = {} | ||
|
||
if dams_data != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
lib/dams/controller_helper.rb
Outdated
|
||
def osf_extra(document) | ||
field_name = 'otherNote_json_tesim' | ||
dams_data = document["#{field_name}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Style/UnneededInterpolation: Prefer to_s over string interpolation.
lib/dams/controller_helper.rb
Outdated
end | ||
|
||
def osf_extra(document) | ||
field_name = 'otherNote_json_tesim' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
lib/dams/controller_helper.rb
Outdated
type = (share_agent_type.include? type) ? type : "Contributor" | ||
end | ||
|
||
def osf_extra(document) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/Tab: Tab detected.
end | ||
end | ||
|
||
def metadata_display?(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
begin | ||
ref = Rails.application.routes.recognize_path(uri.path.gsub(/^\/dc/,"")) | ||
ref[:controller] | ||
rescue Exception => e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/RescueException: Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
uri = URI(request.referrer || "") | ||
if uri.host == request.host | ||
begin | ||
ref = Rails.application.routes.recognize_path(uri.path.gsub(/^\/dc/,"")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/SpaceAfterComma: Space missing after comma.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
# parse a request's referrer and figure out which controller it came from | ||
def referrer_controller( request ) | ||
uri = URI(request.referrer || "") | ||
if uri.host == request.host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.
|
||
# parse a request's referrer and figure out which controller it came from | ||
def referrer_controller( request ) | ||
uri = URI(request.referrer || "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
res.body | ||
end | ||
|
||
def get_data ( recursive = true, format ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
Layout/SpaceAfterMethodName: Do not put a space between a method name and the opening parenthesis.
Layout/SpaceInsideParens: Space inside parentheses detected.
Style/OptionalArguments: Optional arguments should appear at the end of the argument list.
def get_html_data ( params, controller_path ) | ||
xsl = (params[:xsl].nil? || params[:xsl].empty?)?'review.xsl':params[:xsl] | ||
controller = (controller_path.nil? || controller_path.empty?)?'':'&controller=' + URI.encode(controller_path) | ||
viewerUrl = "#{dams_api_path}/api/objects/#{params[:id]}/transform?recursive=true&xsl=#{xsl}&baseurl=" + URI.encode(dams_api_path) + controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/VariableName: Use snake_case for variable names.
Lint/UriEscapeUnescape: URI.encode method is obsolete and should not be used. Instead, use CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case.
Metrics/LineLength: Line is too long. [154/150]
end | ||
def get_html_data ( params, controller_path ) | ||
xsl = (params[:xsl].nil? || params[:xsl].empty?)?'review.xsl':params[:xsl] | ||
controller = (controller_path.nil? || controller_path.empty?)?'':'&controller=' + URI.encode(controller_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TernaryParentheses: Omit parentheses for ternary conditions.
Rails/Blank: Use controller_path.blank? instead of controller_path.nil? || controller_path.empty?.
Layout/SpaceAroundOperators: Surrounding space missing for operator ?.
Layout/SpaceAroundOperators: Surrounding space missing for operator :.
Lint/UriEscapeUnescape: URI.encode method is obsolete and should not be used. Instead, use CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case.
result | ||
end | ||
def get_html_data ( params, controller_path ) | ||
xsl = (params[:xsl].nil? || params[:xsl].empty?)?'review.xsl':params[:xsl] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
Style/TernaryParentheses: Omit parentheses for ternary conditions.
Rails/Blank: Use params[:xsl].blank? instead of params[:xsl].nil? || params[:xsl].empty?.
Layout/SpaceAroundOperators: Surrounding space missing for operator ?.
Layout/SpaceAroundOperators: Surrounding space missing for operator :.
end | ||
result | ||
end | ||
def get_html_data ( params, controller_path ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
Layout/SpaceAfterMethodName: Do not put a space between a method name and the opening parenthesis.
Layout/SpaceInsideParens: Space inside parentheses detected.
…ed push function.
Fixes #270 ; refs #270
@ucsdlib/developers - please review