quandl_client 2.4.5 → 2.4.6

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
  SHA1:
3
- metadata.gz: 7125726d7cceeb967eeea4dee62a6defd9609ac3
4
- data.tar.gz: 019a336addadb9238b9290054730b926cf7ba1ac
3
+ metadata.gz: 14ef2307a4ae4d35586ec924b530d4d6a130bb1c
4
+ data.tar.gz: 49c4b0c24f13a74a3211a6f0ad4ae5c0cab4f945
5
5
  SHA512:
6
- metadata.gz: 287b3674ebd754821827d74d044b5362af1af32eb68967c980fb25d6638227f21183dd7b6007de54d16569025566abb6c8ec75e163a221ab325cb68f5ceaba4f
7
- data.tar.gz: 670806360ff1824f7c9963daa6d1fdde4a24e3599e3baeac17d3a4d1a7aba980813af601236b7b6cf41a16be19c47b0d79ba437238e312987cf56d03307fcd40
6
+ metadata.gz: 3236ed60a30d3159f1face6085eae6dc4cbb213f53c862c071862ac904041b96cc58f8ae55ad5b95108b706ea80dd40ff1be2c33ea1f20efd5c51c1a38454390
7
+ data.tar.gz: 331e27847d1e1cd3e015b91a72db6826033628498b74381479fa78cf8d2e15c4932eb2d6fba64adab64358c0e9d3b74ffb3b891797d694ce071b702cc7acee91
data/UPGRADE.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 2.4.6
2
+
3
+ * QUGC-43 improved message on wrong number of colums
4
+ * QUGC-41 enforce code formatting. always upcase codes
5
+ * improved example of valid code
6
+ * revise code pattern
7
+
8
+
1
9
  # 2.4.5
2
10
 
3
11
  * QUGC-40 add validation to enforce: You may not change number of columns in a dataset
@@ -11,8 +11,13 @@ class Quandl::Client::Dataset < Quandl::Client::Base
11
11
  end
12
12
 
13
13
  def find(value)
14
- # ensure slashes are forward facing
15
- value = value.gsub("\\","/") if value.is_a?(String)
14
+ # enforce code formatting
15
+ if value.is_a?(String)
16
+ # ensure slashes are forward facing
17
+ value = value.gsub("\\","/")
18
+ # ensure uppercase
19
+ value = value.upcase
20
+ end
16
21
  # short-circuit if value is illegal
17
22
  return nil unless value.is_a?(Integer) || value.to_s =~ %r{^#{Quandl::Pattern.full_code}$}
18
23
  super(value)
@@ -118,7 +123,7 @@ class Quandl::Client::Dataset < Quandl::Client::Base
118
123
 
119
124
  def data_columns_should_not_exceed_column_names!
120
125
  if dataset_data.data? && column_names.present? && data.first.count != column_names.count
121
- self.errors.add( :data, "You may not change the number of columns in a dataset!" )
126
+ self.errors.add( :data, "You may not change the number of columns in a dataset. This dataset has #{column_names.count} columns but you tried to send #{data.first.count} columns." )
122
127
  return false
123
128
  end
124
129
  true
@@ -1,6 +1,6 @@
1
1
  module Quandl
2
2
  module Client
3
- VERSION = '2.4.5'
3
+ VERSION = '2.4.6'
4
4
  API_VERSION = 'v2'
5
5
 
6
6
  class << self
@@ -2,8 +2,8 @@ module Quandl
2
2
  class Pattern
3
3
 
4
4
  define_pattern :dataset_date, /[0-9]{4}\-[0-9]{2}\-[0-9]{2}/, example: "yyyy-mm-dd"
5
- define_pattern :code, /[A-Z0-9_]{2,}+/, example: 'ALPHA_NUMERIC_1024'
6
- define_pattern :full_code, /(#{code}\/)?(#{code})/, example: "(SOURCE_CODE/)#{code.to_example}"
5
+ define_pattern :code, /[A-Z0-9_]+/, example: 'ALPHA_NUMERIC_ALL_CAPS'
6
+ define_pattern :full_code, /(#{code}+)\/?(#{code})?/, example: "(SOURCE_CODE/)#{code.to_example}"
7
7
 
8
8
  end
9
9
  end
@@ -51,7 +51,7 @@ describe Quandl::Client::Dataset::Data do
51
51
  end
52
52
 
53
53
  context "#column_spec" do
54
- before(:each){ subject.column_spec = "[0,[\"Date \\n\",{}],[\"Column 1 \",{}],[\"New Column Name \",{}]]"; sleep(1); subject.save }
54
+ before(:each){ subject.column_spec = "[0,[\"Date\",{}],[\"c1 \",{}],[\"c2 \",{}],[\"c3 \",{}],[\"c234 \",{}]]"; sleep(1); subject.save }
55
55
  its(:updated_at){ should_not eq dataset.updated_at }
56
56
  its(:column_spec){ should_not eq dataset.column_spec }
57
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.5
4
+ version: 2.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake