Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into radjabov
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed Nov 4, 2024
2 parents f167d4c + 1ef49fb commit 49796bf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: Report code coverage
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.1' }}
continue-on-error: true
uses: paambaati/codeclimate-action@v8
uses: paambaati/codeclimate-action@v9
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def attribute_value_to_xml(value, xml)
case value.class.to_s
when 'MiqAePassword' then xml.Password(OPAQUE_PASSWORD)
when 'String' then xml.String(value)
when 'Fixnum' then xml.Fixnum(value)
when 'Fixnum', 'Integer' then xml.Integer(value)
when 'Symbol' then xml.Symbol(value.to_s)
when 'TrueClass', 'FalseClass' then xml.Boolean(value.to_s)
when /MiqAeMethodService::(.*)/ then xml.tag!($1.gsub(/::/, '-'), :object_id => value.object_id, :id => value.id)
Expand Down Expand Up @@ -486,7 +486,7 @@ def self.convert_value_based_on_datatype(value, datatype)
return false if datatype == 'FalseClass'
return Time.parse(value).getlocal if 'time'.casecmp?(datatype)
return value.to_sym if 'symbol'.casecmp?(datatype)
return value.to_i if 'integer'.casecmp?(datatype) || datatype == 'Fixnum'
return value.to_i if 'integer'.casecmp?(datatype) || 'fixnum'.casecmp?(datatype)
return value.to_f if 'float'.casecmp?(datatype)
return value.gsub(/[\[\]]/, '').strip.split(/\s*,\s*/) if datatype == 'array' && value.class == String
return decrypt_password(value) if datatype == 'password'
Expand Down
1 change: 1 addition & 0 deletions manageiq-automation_engine.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "rubyzip", "~>2.0.0"
spec.add_dependency "drb"

spec.add_development_dependency "manageiq-style"
spec.add_development_dependency "simplecov", ">= 0.21.2"
Expand Down
2 changes: 1 addition & 1 deletion spec/miq_ae_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def value_match(value, xml_value)

context "integer" do
it "returns value to_i" do
%w[Integer integer Fixnum].each { |type| expect(described_class.convert_value_based_on_datatype("45", type)).to eq(45) }
%w[Integer integer].each { |type| expect(described_class.convert_value_based_on_datatype("45", type)).to eq(45) }
end
end

Expand Down

0 comments on commit 49796bf

Please sign in to comment.