yahoo_quote 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/LICENSE.txt +1 -1
- data/README.markdown +0 -4
- data/lib/yahoo_quote/configuration.rb +3 -1
- data/lib/yahoo_quote/version.rb +1 -1
- data/test/yahoo_quote_test.rb +5 -6
- metadata +17 -7
data/.gitignore
CHANGED
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
module YahooQuote
|
2
4
|
class Configuration
|
3
5
|
|
@@ -6,7 +8,7 @@ module YahooQuote
|
|
6
8
|
@@cache_dir = nil
|
7
9
|
else
|
8
10
|
path = Pathname.new(path) if path.is_a? String
|
9
|
-
path
|
11
|
+
FileUtils.mkdir_p(path) unless path.directory?
|
10
12
|
@@cache_dir = path
|
11
13
|
end
|
12
14
|
end
|
data/lib/yahoo_quote/version.rb
CHANGED
data/test/yahoo_quote_test.rb
CHANGED
@@ -3,20 +3,19 @@ require 'minitest/autorun'
|
|
3
3
|
require 'pathname'
|
4
4
|
require 'fakeweb'
|
5
5
|
|
6
|
-
# TODO test 2 things: make intermediate dirs for cache and permissions
|
7
|
-
|
8
6
|
class TestYahooQuote < MiniTest::Unit::TestCase
|
9
7
|
def setup
|
10
8
|
@url_regexp = %r(http://download\.finance\.yahoo\.com/d/quotes\.csv\?)
|
11
9
|
FakeWeb.allow_net_connect = false
|
12
10
|
FakeWeb.register_uri(:get, @url_regexp, :response => File.read("test/fakeweb/aapl_good.csv"))
|
13
11
|
|
14
|
-
@
|
12
|
+
@base_cache_dir = Pathname.new('test/foo')
|
13
|
+
@cache_dir = @base_cache_dir.join('cache')
|
15
14
|
end
|
16
15
|
|
17
16
|
def remove_dir(dir_path)
|
18
|
-
|
19
|
-
dir_path.
|
17
|
+
dir_path.children.select {|p| p.directory?}.each {|f| remove_dir(f)}
|
18
|
+
dir_path.children.select {|p| p.file? }.each {|f| f.unlink}
|
20
19
|
dir_path.unlink
|
21
20
|
end
|
22
21
|
|
@@ -74,7 +73,7 @@ class TestYahooQuote < MiniTest::Unit::TestCase
|
|
74
73
|
end
|
75
74
|
|
76
75
|
def test_create_cache_dir
|
77
|
-
remove_dir @
|
76
|
+
remove_dir @base_cache_dir if @base_cache_dir.exist?
|
78
77
|
assert !@cache_dir.exist?
|
79
78
|
YahooQuote::Configuration.cache_dir = @cache_dir
|
80
79
|
assert @cache_dir.exist?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo_quote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fakeweb
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: ruby-debug19
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: Easy interaction with Yahoo Finance API
|
37
47
|
email:
|
38
48
|
- bcarreno@yahoo.com
|
@@ -73,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
83
|
version: '0'
|
74
84
|
requirements: []
|
75
85
|
rubyforge_project: yahoo_quote
|
76
|
-
rubygems_version: 1.8.
|
86
|
+
rubygems_version: 1.8.21
|
77
87
|
signing_key:
|
78
88
|
specification_version: 3
|
79
89
|
summary: Query Yahoo Finance API
|