gold_silver_api 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96d09225cb5edbc0614fecaa5799226f8adc0f1c1fd93620e34f48323f926f38
4
- data.tar.gz: 498889025595d3b4139b9c01cddac9041cea0be71e6366a02bb41beb13ef513e
3
+ metadata.gz: 9f137f0ec8690f9b8e535f476fe9f5eb566f8b60afb647a864e0742b6c9fe941
4
+ data.tar.gz: e3444e4690e5bcf7dac7d096a38b5a7ec3937682033fb954448edbc0dfb99593
5
5
  SHA512:
6
- metadata.gz: e33b359b17eb8218acd22fdd1da79b8c5c5304e81da0229d3865faf687974c9f6a06d008b6df402ad149a536f75dc0461e8b4fb7fc8988dd0ea599a14493275b
7
- data.tar.gz: 3b14b6e3afd1e260591f5953ec732385bb8c8dcd8df494b90983fa9aaeb7f134cd4d317ee0cc569063ae62d2f4d908e78de441ba77b940fa9fcd61175648a295
6
+ metadata.gz: 9ea27345a98d269b16ab9901162ec564369d5252bf27cf625324955d23e420cc2788a95d4fbbc5cd55c453f34d350e67be32b50b9a610d3953a0b3d126b74577
7
+ data.tar.gz: d9f87420fe3b8cafc4b0f140f07f4d87a32c09a3850fb18bf7b208cb61e8239e610b3589b2162a6f45c117baad0be14115069d75ad1388fd224049ad69f698bd
@@ -0,0 +1,46 @@
1
+ # This workflow checks out code, performs a Codacy security scan
2
+ # and integrates the results with the
3
+ # GitHub Advanced Security code scanning feature. For more information on
4
+ # the Codacy security scan action usage and parameters, see
5
+ # https://github.com/codacy/codacy-analysis-cli-action.
6
+ # For more information on Codacy Analysis CLI in general, see
7
+ # https://github.com/codacy/codacy-analysis-cli.
8
+
9
+ name: Codacy Security Scan
10
+
11
+ on:
12
+ push:
13
+ branches: [ master ]
14
+ pull_request:
15
+ branches: [ master ]
16
+
17
+ jobs:
18
+ codacy-security-scan:
19
+ name: Codacy Security Scan
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ # Checkout the repository to the GitHub Actions runner
23
+ - name: Checkout code
24
+ uses: actions/checkout@v2
25
+
26
+ # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
27
+ - name: Run Codacy Analysis CLI
28
+ uses: codacy/codacy-analysis-cli-action@1.1.0
29
+ with:
30
+ # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
31
+ # You can also omit the token and run the tools that support default configurations
32
+ project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
33
+ verbose: true
34
+ output: results.sarif
35
+ format: sarif
36
+ # Adjust severity of non-security issues
37
+ gh-code-scanning-compat: true
38
+ # Force 0 exit code to allow SARIF file generation
39
+ # This will handover control about PR rejection to the GitHub side
40
+ max-allowed-issues: 2147483647
41
+
42
+ # Upload the SARIF file generated in the previous step
43
+ - name: Upload SARIF results file
44
+ uses: github/codeql-action/upload-sarif@v1
45
+ with:
46
+ sarif_file: results.sarif
data/CHANGES CHANGED
@@ -1 +1,2 @@
1
+ 1.0.1 Permit :metal argument to be 2 digit code (AU, AG, PT, PD) instead of requiring X in front as XAU, XAG, XPT, XPD
1
2
  1.0.0 Initial Release
data/README.md CHANGED
@@ -106,8 +106,8 @@ class BullionController < ActionController::Base
106
106
  unless call.nil?
107
107
  result = call[:result]
108
108
  unless result.nil?
109
- redis.set("gold_silver_api-#{metal}-#{currency}", result[:price])
110
- return result[:price]
109
+ redis.set("gold_silver_api-#{metal}-#{currency}", result["price"])
110
+ return result["price"]
111
111
  else
112
112
  return nil
113
113
  end #/unless-else
Binary file
@@ -7,6 +7,7 @@ module GoldSilver
7
7
  class << self
8
8
  def fetch metal, currency, date=nil
9
9
  raise ArgumentError, "missing metal argument" if metal.nil?
10
+ metal = "X#{metal&.upcase}" if metal.length == 2
10
11
  raise ArgumentError, "invalid metal argument" unless GSAPI_METALS.include?(metal)
11
12
  raise ArgumentError, "missing currency argument" if currency.nil?
12
13
  raise ArgumentError, "invalid currency argument" unless GSAPI_CURRENCIES.include?(currency)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoldSilver
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end #/module
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gold_silver_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Merlescu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-19 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -37,6 +37,7 @@ executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []
39
39
  files:
40
+ - ".github/workflows/codacy-analysis.yml"
40
41
  - ".gitignore"
41
42
  - CHANGES
42
43
  - CODE_OF_CONDUCT.md
@@ -44,6 +45,7 @@ files:
44
45
  - LICENSE
45
46
  - README.md
46
47
  - SECURITY.md
48
+ - gold_silver_api-1.0.0.gem
47
49
  - gold_silver_api.gemspec
48
50
  - lib/gold_silver_api.rb
49
51
  - lib/gold_silver_api/api.rb
@@ -71,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
73
  - !ruby/object:Gem::Version
72
74
  version: '0'
73
75
  requirements: []
74
- rubygems_version: 3.0.3
76
+ rubygems_version: 3.2.2
75
77
  signing_key:
76
78
  specification_version: 4
77
79
  summary: Simple interface to access GoldApi.io