iex-ruby-client 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab2cf9c9b5a300629e51b810e4f556ba5d3113a226faa0b2a9293be2939cdb24
4
- data.tar.gz: cbab6366388a36eddac8a9e55c4eb4e9e5254cd883f0fe135bdb63d7e359f137
3
+ metadata.gz: 842d8fd485aebd159c318088ca1137348555a4a2106e4e4089da3e13ecc596eb
4
+ data.tar.gz: dc2046dd1efbd5c0593134fa99daf5a280f62c629c2779d785f5f34f41896c6a
5
5
  SHA512:
6
- metadata.gz: 3a08d8c90fdc3a1ac756321711a76d2b65f01d8c5935b160125fcb41751452da65588d5b29ab1f3f000026171c61ceafdb9ce270af62c342c701512e83a706e0
7
- data.tar.gz: b6cbac7f892c7e1ce514cb5906180d60d73b66b5a80edb777eb7ac754fad309b9ce8745b08e8ce1c5f4cc27c109f84b558025f70bc53b754c1ef2e0ac4ccd3e4
6
+ metadata.gz: 543f9a5bea937226e974b430654c53d4fab1f4cbb79d025784888f6a4924aeb2c59bcceb2214257a78544274c217f555594cc100a9820dae2b8f90d72ef9b1ae
7
+ data.tar.gz: 205d65bf85cfd152e4cddb8f6344658cea65a12201aceba42a43a52a524efcbf02e9695ddfa543c99b5fc90f402b096e490fe6341697fbb07e7de5a5a7961c72
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 1.6.0 (2021/10/17)
2
+ * [#110](https://github.com/dblock/iex-ruby-client/pull/110): Drop `money_helper` dependency and utilize `money` gem directly - [@agrberg](https://github.com/agrberg).
3
+
1
4
  ### 1.5.0 (2021/08/15)
2
5
  * [#105](https://github.com/dblock/iex-ruby-client/pull/105): Added support for fetching latest foreign exchange rates - [@mathu97](https://github.com/mathu97).
3
6
  * [#106](https://github.com/dblock/iex-ruby-client/pull/106): Added support for fetching a single key stat with `key_stat(symbol, stat)` endpoint - [@agrberg](https://github.com/agrberg).
data/UPGRADING.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Upgrading iex-ruby-client
2
2
  =========================
3
3
 
4
+ ### Upgrading to >= 1.6.0
5
+
6
+ [#110](https://github.com/dblock/iex-ruby-client/pull/110) drops the dependency on `money_helper` in favor of using the `money` library directly.
7
+
8
+ Previously the `money_helper` library set `Money.locale_backend = :currency` globally. The default is `I18n` which looks up the thousands separator and decimal marker. Depending on your project you may need to set this value if you use `Money#format` without the `thousands_separator` or `decimal_mark` options. You are less likely to require this in a Rails project.
9
+
10
+ This represents a change in the `money` library's method of handling defaults and is similar to the deprecation warning the library provides until you set `Money.rounding_mode=`.
11
+
4
12
  ### Upgrading to >= 1.0.0
5
13
 
6
14
  On June 1, 2019, IEX API has been sunset for all non-IEX data. IEX Cloud, a non-Exchange platform, continues to provide access to third-party data sources and requires a token. When upgrading to 1.0.0, create an account and get a `publishable token` from [IEX Cloud Console](https://iexcloud.io).
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'faraday', '>= 0.17'
20
20
  s.add_dependency 'faraday_middleware'
21
21
  s.add_dependency 'hashie'
22
- s.add_dependency 'money_helper'
22
+ s.add_dependency 'money', '~> 6.0'
23
23
  s.add_development_dependency 'rake', '~> 10'
24
24
  s.add_development_dependency 'rspec'
25
25
  s.add_development_dependency 'rubocop', '0.72.0'
@@ -3,8 +3,8 @@ module IEX
3
3
  module HistoricalPrices
4
4
  def historical_prices(symbol, options = {})
5
5
  if options[:range] == 'date'
6
- raise ArgumentError unless options[:date].present?
7
- raise ArgumentError unless options[:chartByDay].present?
6
+ raise ArgumentError unless options[:date]
7
+ raise ArgumentError unless options[:chartByDay]
8
8
  end
9
9
 
10
10
  options = options.dup
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module IEX
2
4
  module Resources
3
5
  class Resource < Hashie::Trash
@@ -27,7 +29,9 @@ module IEX
27
29
  end
28
30
 
29
31
  def self.to_dollar(amount:, ignore_cents: true)
30
- MoneyHelper.money_to_text(amount, 'USD', nil, no_cents: ignore_cents)
32
+ return nil unless amount
33
+
34
+ Money.new(amount * 100, 'USD').format(decimal_mark: '.', no_cents: ignore_cents, thousands_separator: ',')
31
35
  end
32
36
  end
33
37
  end
data/lib/iex/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module IEX
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
@@ -2,7 +2,7 @@ require 'faraday'
2
2
  require 'faraday_middleware'
3
3
  require 'faraday_middleware/response_middleware'
4
4
  require 'hashie'
5
- require 'money_helper'
5
+ require 'money'
6
6
  require 'date'
7
7
 
8
8
  require_relative 'iex/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iex-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-15 00:00:00.000000000 Z
11
+ date: 2021-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: money_helper
56
+ name: money
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '6.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '6.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement