intrinio 0.1.1 → 0.1.2

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: 1445cecea92901fa631ab950788949e4ffb8472e
4
- data.tar.gz: a984c027e44ba371c037e9bf9f595c5b8b260787
3
+ metadata.gz: 0ad910c06f61af3d4a326bb69330dfb634ca1326
4
+ data.tar.gz: 9ecbad98ff3d48215612b0f715c4091566cffeaa
5
5
  SHA512:
6
- metadata.gz: f45beb9d024f240d330a8b39b3e18dc33378d97865ff75980bfbf149ea43c2942dd185fbd89a7ee61a298b1f5e51aa9d14943021b9ca4b05b192aa98bd23e7a2
7
- data.tar.gz: 3e5af5e586f14760f6c10b2ab79105af113cef36fcc1209bcb9771dbb4ab88e7fb9439debb1c16d20d51b2af9aa29061adc4adaf68330a3bc1113c74a6cb4d47
6
+ metadata.gz: 6419fa9d9c991a7e39d22a6684f404ab0dda3d0dd39a50c7628ccba030bb0b542d93aad595d8fca6a438ad51902b36695dba21b3a2825b60abe7f8d0e31e9fcf
7
+ data.tar.gz: dd553ef8709e94066bd3bd0ffca61cf3c2ea3e3470c250b6aaaba933507d0c5b9b480a125006f22451e112dd851a1b4bae85b6f73b6a6f8b31ebc5ffa2a59728
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'intrinio'
4
- Intrinio::CommandLine.instance.execute ARGV
4
+
5
+ begin
6
+ Intrinio::CommandLine.instance.execute ARGV
7
+ rescue Intrinio::BadResponse, Intrinio::IncompatibleResponse => e
8
+ STDERR.puts "#{e.class} - #{e.message}"
9
+ end
@@ -44,9 +44,10 @@ module Intrinio
44
44
 
45
45
  def get_csv(*args)
46
46
  result = get *args
47
-
48
- raise Intrinio::BadResponse, "Result is not a hash" unless result.is_a? Hash
49
- raise Intrinio::IncompatibleResponse, "Result does not contain a data attribute" unless result.has_key? :data
47
+
48
+ raise Intrinio::BadResponse, "API said '#{result}'" if result.is_a? String
49
+ raise Intrinio::BadResponse, "Got a #{result.class},expected a Hash" unless result.is_a? Hash
50
+ raise Intrinio::IncompatibleResponse, "There is no data attribute in the response" unless result.has_key? :data
50
51
 
51
52
  data = result[:data]
52
53
 
@@ -1,3 +1,3 @@
1
1
  module Intrinio
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intrinio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt