quandl 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDE0ZTgyNWUyNmExYWE1YWFiMTdmNTU1ZWVkNDA1MDQ4MWIxMTI2YQ==
4
+ YzhlMjUzZDNiOGE3Njg4YTQ5MmQ3M2RjMmYzMmRhYmNmYzdiYzc2NQ==
5
5
  data.tar.gz: !binary |-
6
- ZGI0ZDZiYjVlYzI3N2QxMDE2ZTNhNzg2ZjZlMTdlYzUwYjM5MGYyZQ==
6
+ ZTA0MWM5Zjg1YmMxN2JmMTU5NzI5MGM4YmY0Y2ZkYzM3ZjEzMTczZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Njc4M2NiMjg3ZGJiMzA1MzYyYWJhYzFlZWQyMzkzMTA4YTUyMWRkMTA4MzM0
10
- YzJkODQyODk5MDRmYWQ0NjhiYjc4YzVlZDEzZjgxYWI4NWU2YTQwZDlkMDIx
11
- ODc0ZDYyNjFmOGM5NDc3N2ViNDI0YThiYTdjZDMxMDYyMDZjZjQ=
9
+ NWRkMWE0NTI5NzhhMzQxMTYwMWMwMGRkNzJjYjVhZGEzZDQ0ODY3ZjA4YmZl
10
+ NjAyZDg1ZTBjOWFkZjI3NmU0NmQwOTA4MTAzN2M5NDFkZWE4ZTAxMDQyMDAx
11
+ NmFiYmUyOWFhMzY2MDk0OWMzMTU2MTE5NGVkNGNmNGQ5NDJjNWE=
12
12
  data.tar.gz: !binary |-
13
- ZjQ1NjNjZGJjNmE3NGVjYjhlYWYxNDFkNmNhM2I4MTk0NjRjZmVkZTY5YjNm
14
- YTg3MWY1YWMwM2RjZDEyNmU5ZTVlOTZjY2VlYTkwYWY2MWQ3NzQ5OGFhODkx
15
- NzkwNDA2NjFmY2MxOTg0MDA0MWM4M2Y0ZTE0ODFjNDdhZTYyYjQ=
13
+ MmRmN2Q5ODY2YTRmZGJiZjY3M2MxYzhkMTNmNjVjOTJmZDUzMDE3ZGQ2NGU1
14
+ NmEzMjU0OWJiZmY1Yjg4YmIwYTRjYzE3ZWIxYzRiY2YyZjZiYWJhYjU3Yjll
15
+ ZjlkYjUzZDMwZTc1NmFlNWE3MTlhOTY5OGRmYTIzODc3OWVmNzk=
data/UPGRADE.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.4.2
2
+
3
+ * fix threading issue with silently failing threads
4
+
5
+
6
+
1
7
  ## 0.4.1
2
8
 
3
9
  * added schedule run (now) feature
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -8,6 +8,7 @@ module Threading
8
8
 
9
9
  included do
10
10
 
11
+ before_execute :force_load_json_support
11
12
  before_execute :shutdown_thread_pool_on_sigint
12
13
 
13
14
  after_execute :shutdown_thread_pool_uninterruptedly!
@@ -104,6 +105,10 @@ module Threading
104
105
  threads? && thread_pool.shutdown?
105
106
  end
106
107
 
108
+ def force_load_json_support
109
+ { force_load: true }.to_json
110
+ end
111
+
107
112
  protected
108
113
 
109
114
  def shutdown_thread_pool_uninterruptedly!
@@ -3,7 +3,58 @@ require 'yaml'
3
3
 
4
4
  module Spec
5
5
  module Config
6
- Quandl = OpenStruct.new(YAML.load(File.read(File.join(ENV['HOME'], '.quandl/test'))))
6
+ class Quandl
7
+
8
+ class << self
9
+
10
+ def config
11
+ @@config ||= self.new
12
+ end
13
+
14
+ def method_missing(meth, *args, &block)
15
+ self.config.data[meth.to_s]
16
+ end
17
+
18
+ end
19
+
20
+ attr_accessor :data
21
+
22
+ def initialize
23
+ @data = resolve_data
24
+ end
25
+
26
+ private
27
+
28
+ def resolve_data
29
+ return load_file if file?
30
+ load_environment
31
+ end
32
+
33
+ def load_environment
34
+ if ENV['QUANDL_ADMIN_TOKEN'].blank? || ENV['QUANDL_USER_TOKEN'].blank?
35
+ raise "ENV['QUANDL_ADMIN_TOKEN'] and ENV['QUANDL_USER_TOKEN'] must be defined!"
36
+ end
37
+ {
38
+ token: ENV['QUANDL_ADMIN_TOKEN'],
39
+ user_token: ENV['QUANDL_USER_TOKEN'],
40
+ quandl_url: 'http://staging.quandl.com/api/',
41
+ send_crash_reports: false,
42
+ }
43
+ end
44
+
45
+ def load_file
46
+ YAML.load(File.read(file_path))
47
+ end
48
+
49
+ def file?
50
+ File.exists?(file_path)
51
+ end
52
+
53
+ def file_path
54
+ @file_path ||= File.join(ENV['HOME'], '.quandl/test')
55
+ end
56
+
57
+ end
7
58
  end
8
59
  end
9
60
 
@@ -38,10 +38,6 @@ describe "./bin/quandl schedule" do
38
38
  its(:stdout){ should match "You have successfully scheduled 'scraper-test-file.rb'" }
39
39
  end
40
40
 
41
- context "list" do
42
- its(:stdout){ should match "scraper-test-file.rb Scheduled: every day at 23:00"}
43
- end
44
-
45
41
  context "delete scraper-test-file.rb --force-yes" do
46
42
  its(:stdout){ should match "You have successfully deleted 'scraper-test-file.rb'" }
47
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
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-05-23 00:00:00.000000000 Z
11
+ date: 2014-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander