ystock 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.rdoc +1 -1
  2. data/lib/ystock.rb +13 -12
  3. data/ystock.gemspec +2 -2
  4. metadata +20 -29
data/README.rdoc CHANGED
@@ -24,7 +24,7 @@ This gem uses Yahoo Finance (yahoo.finance.com) to get stock quotes. Remember th
24
24
  # :change
25
25
  # :volume
26
26
 
27
- Get multiple stock information at once.
27
+ Get multiple stock information at once. Returns a hash.
28
28
 
29
29
  Ystock.find(['aapl', 'goog', 'lcre'])
30
30
 
data/lib/ystock.rb CHANGED
@@ -18,19 +18,20 @@ module Ystock
18
18
  @@service_uri = "http://download.finance.yahoo.com/d/quotes.csv"
19
19
 
20
20
  # Ystock.find(['stock', 'stock'])
21
- def self.find(args)
22
- output = Array.new
23
- args.each do |stock|
24
- s = send_request(stock.to_s)
25
- a = s.chomp.split(",")
26
- output << {:symbol => stock.to_s,
27
- :price => a[0],
28
- :change => a[1],
29
- :volume => a[2]}
21
+ def self.find(args)
22
+ output = Hash.new
23
+ args.each do |stock|
24
+ s = send_request(stock.to_s)
25
+ a = s.chomp.split(",")
26
+
27
+ output[stock.to_sym] = {:symbol => stock.to_s,
28
+ :price => a[0],
29
+ :change => a[1],
30
+ :volume => a[2]}
30
31
 
31
- end
32
- return output
33
- end
32
+ end
33
+ return output
34
+ end
34
35
 
35
36
  def self.get_stock(stock)
36
37
  output = Array.new
data/ystock.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ystock}
5
- s.version = "0.2.4"
5
+ s.version = "0.2.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Greg Winn"]
9
- s.date = %q{2011-03-03}
9
+ s.date = %q{2012-05-18}
10
10
  s.description = %q{Get stock information from Yahoo Finance}
11
11
  s.email = %q{greg@winn.ws}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/ystock.rb"]
metadata CHANGED
@@ -1,67 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ystock
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.5
4
5
  prerelease:
5
- version: 0.2.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Greg Winn
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-03-03 00:00:00 -06:00
14
- default_executable:
12
+ date: 2012-05-18 00:00:00.000000000 Z
15
13
  dependencies: []
16
-
17
14
  description: Get stock information from Yahoo Finance
18
15
  email: greg@winn.ws
19
16
  executables: []
20
-
21
17
  extensions: []
22
-
23
- extra_rdoc_files:
18
+ extra_rdoc_files:
24
19
  - README.rdoc
25
20
  - lib/ystock.rb
26
- files:
21
+ files:
27
22
  - Manifest
28
23
  - README.rdoc
29
24
  - Rakefile
30
25
  - init.rb
31
26
  - lib/ystock.rb
32
27
  - ystock.gemspec
33
- has_rdoc: true
34
28
  homepage: http://github.com/gregwinn/ystock
35
29
  licenses: []
36
-
37
30
  post_install_message:
38
- rdoc_options:
31
+ rdoc_options:
39
32
  - --line-numbers
40
33
  - --inline-source
41
34
  - --title
42
35
  - Ystock
43
36
  - --main
44
37
  - README.rdoc
45
- require_paths:
38
+ require_paths:
46
39
  - lib
47
- required_ruby_version: !ruby/object:Gem::Requirement
40
+ required_ruby_version: !ruby/object:Gem::Requirement
48
41
  none: false
49
- requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: "0"
53
- required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
47
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- version: "1.2"
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '1.2'
59
52
  requirements: []
60
-
61
53
  rubyforge_project: ystock
62
- rubygems_version: 1.5.0
54
+ rubygems_version: 1.8.24
63
55
  signing_key:
64
56
  specification_version: 3
65
57
  summary: Get stock information from Yahoo Finance
66
58
  test_files: []
67
-