Skip to content

Commit d172b27

Browse files
author
Ruan Carlos
authored
Merge pull request #27 from quandl/drop-2.4
Drop support for ruby 2.4
2 parents df37040 + e0739bd commit d172b27

File tree

14 files changed

+49
-41
lines changed

14 files changed

+49
-41
lines changed

.rubocop.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
AllCops:
22
DisplayCopNames: true
33
DisplayStyleGuide: true
4+
NewCops: enable
5+
TargetRubyVersion: 2.5
46
Layout/LineLength:
57
Max: 180
8+
Metrics/MethodLength:
9+
Max: 40
610
Metrics/AbcSize:
711
Enabled: false
812
Metrics/CyclomaticComplexity:
913
Enabled: false
10-
Metrics/MethodLength:
11-
Max: 40
1214
Metrics/PerceivedComplexity:
1315
Enabled: false
1416
Style/Documentation:
@@ -17,3 +19,5 @@ Style/FrozenStringLiteralComment:
1719
Enabled: false
1820
Style/MissingRespondToMissing:
1921
Enabled: false
22+
Lint/MissingSuper:
23+
Enabled: false

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
sudo: false
22
language: ruby
33
rvm:
4-
- '2.4.1'
5-
- '2.5.5'
6-
- '2.6.3'
4+
- '2.5.0'
5+
- '2.5'
6+
- '2.6.0'
7+
- '2.6'
78

89
install:
910
- gem install bundler -v '~> 1.17.3'

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
###1.2.0 - 2020-10-29
2+
3+
* Drop support to ruby 2.4 as it reach [EOL](https://www.ruby-lang.org/en/news/2020/04/05/support-of-ruby-2-4-has-ended/).
4+
15
###1.1.1 - 2020-07-28
26

37
* Update gem dependencies

Gemfile.lock

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
quandl (1.1.1)
4+
quandl (1.2.0)
55
activesupport (>= 5.2.4.3)
66
json (~> 2.3.0)
77
rest-client (~> 2.0.2)
@@ -30,18 +30,23 @@ GEM
3030
domain_name (~> 0.5)
3131
i18n (1.8.5)
3232
concurrent-ruby (~> 1.0)
33+
io-console (0.5.6)
34+
irb (1.2.7)
35+
reline (>= 0.1.5)
3336
json (2.3.1)
3437
mime-types (3.3.1)
3538
mime-types-data (~> 3.2015)
3639
mime-types-data (3.2020.0512)
3740
minitest (5.14.1)
3841
netrc (0.11.0)
3942
parallel (1.19.2)
40-
parser (2.7.1.4)
43+
parser (2.7.2.0)
4144
ast (~> 2.4.1)
4245
public_suffix (4.0.5)
4346
rainbow (3.0.0)
44-
regexp_parser (1.7.1)
47+
regexp_parser (1.8.2)
48+
reline (0.1.6)
49+
io-console (~> 0.5)
4550
rest-client (2.0.2)
4651
http-cookie (>= 1.0.2, < 2.0)
4752
mime-types (>= 1.16, < 4.0)
@@ -60,17 +65,17 @@ GEM
6065
diff-lcs (>= 1.2.0, < 2.0)
6166
rspec-support (~> 3.9.0)
6267
rspec-support (3.9.3)
63-
rubocop (0.88.0)
68+
rubocop (1.1.0)
6469
parallel (~> 1.10)
65-
parser (>= 2.7.1.1)
70+
parser (>= 2.7.1.5)
6671
rainbow (>= 2.2.2, < 4.0)
67-
regexp_parser (>= 1.7)
72+
regexp_parser (>= 1.8)
6873
rexml
69-
rubocop-ast (>= 0.1.0, < 1.0)
74+
rubocop-ast (>= 1.0.1)
7075
ruby-progressbar (~> 1.7)
7176
unicode-display_width (>= 1.4.0, < 2.0)
72-
rubocop-ast (0.2.0)
73-
parser (>= 2.7.0.1)
77+
rubocop-ast (1.1.0)
78+
parser (>= 2.7.1.5)
7479
ruby-progressbar (1.10.1)
7580
safe_yaml (1.0.5)
7681
thread_safe (0.3.6)
@@ -90,6 +95,7 @@ PLATFORMS
9095

9196
DEPENDENCIES
9297
factory_girl (~> 4.5.0)
98+
irb
9399
quandl!
94100
rspec
95101
rubocop

lib/quandl/connection.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def self.request(http_verb, url, options = {}, &block)
88
headers = { accept: accept_value, request_source: 'ruby', request_source_version: Quandl::VERSION }.merge(headers)
99
headers = { x_api_token: ApiConfig.api_key }.merge(headers) if ApiConfig.api_key
1010

11-
request_url = ApiConfig.api_base + '/' + url
12-
request_url = request_url + '?' + params.to_query if params.present?
11+
request_url = "#{ApiConfig.api_base}/#{url}"
12+
request_url = "#{request_url}?#{params.to_query}" if params.present?
1313

1414
request_opts = { url: request_url, headers: headers, method: http_verb }
1515
response = execute_request(request_opts, &block)

lib/quandl/errors/quandl_error.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# based off of stripe gem: https://github.com/stripe/stripe-ruby
22
module Quandl
33
class QuandlError < StandardError
4-
attr_reader :quandl_message
5-
attr_reader :http_status
6-
attr_reader :http_body
7-
attr_reader :http_headers
8-
attr_reader :request_id
9-
attr_reader :json_body
10-
attr_reader :quandl_error_code
4+
attr_reader :quandl_message, :http_status, :http_body, :http_headers, :request_id, :json_body, :quandl_error_code
115

126
# rubocop:disable Metrics/ParameterLists
137
def initialize(quandl_message = nil, http_status = nil, http_body = nil, json_body = nil,

lib/quandl/model/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Quandl
22
class ModelBase
33
def initialize(data, _options = {})
4-
@raw_data = ActiveSupport::HashWithIndifferentAccess.new(Hash[data.map { |k, v| [Quandl::Util.methodize(k), v] }])
4+
@raw_data = ActiveSupport::HashWithIndifferentAccess.new(data.transform_keys { |k| Quandl::Util.methodize(k) })
55
end
66

77
def data_fields

lib/quandl/model/database.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@ def bulk_download_url(options = {})
1111
options.assert_valid_keys(:params)
1212

1313
url = bulk_download_path
14-
url = Quandl::ApiConfig.api_base + '/' + url
14+
url = "#{Quandl::ApiConfig.api_base}/#{url}"
1515
url = Quandl::Util.constructed_path(url, id: database_code)
1616

1717
params = options[:params] || {}
1818
params['api_key'] = Quandl::ApiConfig.api_key if Quandl::ApiConfig.api_key
1919
params['api_version'] = Quandl::ApiConfig.api_version if Quandl::ApiConfig.api_version
2020

21-
url += '?' + params.to_query if params.any?
21+
url += "?#{params.to_query}" if params.any?
2222
url
2323
end
2424

2525
def bulk_download_path
26-
path = self.class.default_path + '/data'
27-
path = Quandl::Util.constructed_path(path, id: database_code)
28-
path
26+
path = "#{self.class.default_path}/data"
27+
Quandl::Util.constructed_path(path, id: database_code)
2928
end
3029

3130
def bulk_download_to_file(file_or_folder_path, options = {})

lib/quandl/model/dataset.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Dataset < ModelBase
55

66
# rubocop:disable Naming/AccessorMethodName
77
def self.get_path
8-
default_path + '/metadata'
8+
"#{default_path}/metadata"
99
end
1010
# rubocop:enable Naming/AccessorMethodName
1111

lib/quandl/model/list.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module Quandl
22
class List
3-
attr_reader :meta
4-
attr_reader :values
3+
attr_reader :meta, :values
54

65
def initialize(klass, values, meta)
76
@klass = klass

0 commit comments

Comments
 (0)