rticker 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,7 @@ module RTicker
23
23
  uri_param = symbols.map{|x| x+"=X"}.join(",")
24
24
  uri = "http://download.finance.yahoo.com/d/quotes.csv?s=%s&f=sl1d1t1ba&e=.csv" % CGI::escape(uri_param)
25
25
  response = RTicker::Net.get_response(uri) rescue return
26
- return if response =~ /"N\/A"/ # Yahoo sometimes returns bogus info.
26
+ return if response.empty? or response =~ /"N\/A"/ # Yahoo sometimes returns bogus info.
27
27
  results = response.split("\n")
28
28
  entries.zip(results) do |entry, result|
29
29
  # Yahoo uses A CSV format.
@@ -62,6 +62,7 @@ module RTicker
62
62
  symbols = entries.map { |e| e.real_symbol }
63
63
  uri = "http://download.finance.yahoo.com/d/quotes.csv?s=%s&f=l1c1d1va2xj1b4j4dyekjm3m4rr5p5p6s7" % CGI.escape(symbols.join(","))
64
64
  response = RTicker::Net.get_response(uri) rescue return
65
+ return if response.empty?
65
66
  results = response.split("\n")
66
67
  entries.zip(results) do |_entry, result|
67
68
  # Yahoo uses A CSV format.
@@ -40,6 +40,8 @@ module RTicker
40
40
  def Option.run_update (entry)
41
41
  uri = "http://finance.yahoo.com/q?s=%s" % CGI::escape(entry.symbol)
42
42
  response = RTicker::Net.get_response(uri) rescue Thread.current.exit
43
+ Thread.current.exit if response.empty?
44
+
43
45
  # Rake through the HTML and find the bits we want.
44
46
  # This can be a bit messy.
45
47
  begin
data/rticker.gemspec CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.name = "rticker"
4
4
  s.summary = "Command line-based stock ticker application"
5
5
  s.description = File.read(File.join(File.dirname(__FILE__), 'README'))
6
- s.version = "1.1.1"
6
+ s.version = "1.1.2"
7
7
  s.author = "Alfred J. Fazio"
8
8
  s.email = "alfred.fazio@gmail.com"
9
9
  s.platform = Gem::Platform::RUBY
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rticker
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alfred J. Fazio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-13 00:00:00 -05:00
18
+ date: 2011-12-14 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21