rupee 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -55,7 +55,7 @@ Fargo using the following (note that you only need to <tt>require</tt> the
55
55
  <tt>quote</tt> module):
56
56
 
57
57
  require "rupee/quote"
58
- wfc = Rupee::Quote.new("WFC")
58
+ wfc = Rupee::Quote.new(:wfc)
59
59
 
60
60
  wfc.get :price, :change, :pct_chg
61
61
  #=> {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
data/ext/rupee/option.c CHANGED
@@ -104,7 +104,7 @@ bs_gamma(call_put_flag, S, K, T, r, q, v)
104
104
  * volatility)
105
105
  *
106
106
  * Returns the delta options Greek (sensitivity to changes in the underlying's
107
- * price
107
+ * price)
108
108
  */
109
109
  static VALUE
110
110
  rupee_delta(self, _call_put_flag, _S, _K, _T, _r, _q, _v)
@@ -52,12 +52,12 @@ module Rupee
52
52
  # # Pirates generally observe the Federal Reserve holiday schedule
53
53
  # Blackbeard = US.copy
54
54
  #
55
- # # But they do observer Talk Like a Pirate Day
55
+ # # But they do observe Talk Like a Pirate Day
56
56
  # Blackbeard.has_day_off_on :talk_like_a_pirate_day do |date|
57
57
  # date.month == SEPTEMBER && date.day == 19
58
58
  # end
59
59
  #
60
- # # And curse the flag Columbus flew under
60
+ # # And curse the Spanish Crown
61
61
  # Blackbeard.remove_day_off_for :columbus_day
62
62
  # end
63
63
  #
@@ -233,6 +233,20 @@ module Rupee
233
233
  date.day == day
234
234
  end
235
235
  end
236
+
237
+ # Calculates whether the provided date is the day requested or, if the
238
+ # day requested falls on a Sunday, the following Monday
239
+ def next_monday_if_sunday(date, day)
240
+ case date.wday
241
+ when 1 # Monday
242
+ date.day.between?(day, day + 1)
243
+ when 0, 6 # Weekends
244
+ false
245
+ else # Tuesday - Friday
246
+ date.day == day
247
+ end
248
+ end
249
+
236
250
  end
237
251
  end
238
252
  end
@@ -6,49 +6,76 @@ module Rupee
6
6
  # Weekends
7
7
  Japan.has_weekends_off
8
8
 
9
- # Fixed and solar holidays
10
- Japan.has_day_off_when do |date|
11
- case date.month
12
- when JANUARY
13
- # New Year's Day
14
- date.day == 1
15
- when FEBRUARY
16
- # National Foundation Day
17
- date.day == 11
18
- when MARCH
19
- # Vernal Equinox Day
20
- date.day == 20
21
- when APRIL
22
- # Showa Day
23
- date.day == 29
24
- when MAY
25
- # Golden Week: Constitution Memorial Day, Greenery Day and Children's
26
- # Day, respectively
27
- date.day.between?(3, 5)
28
- when SEPTEMBER
29
- # Autumnal Equinox Day
30
- date.day == 23
31
- when NOVEMBER
32
- # Culture Day and Labour Thanksgiving Day
33
- date.day == 3 || date.day == 23
34
- when DECEMBER
35
- # Emperor's Birthday
36
- date.day == 23
37
- end
38
- end
39
-
40
- # Mondays
41
- Japan.has_day_off_when do |date|
42
- if date.monday?
43
- case date.month
44
- when JANUARY, OCTOBER
45
- # Coming of Age Day, Health and Sports Day
46
- week_of(date) == 2
47
- when JULY, SEPTEMBER
48
- # Marine Day, Respect-for-the-Aged Day
49
- week_of(date) == 3
50
- end
51
- end
9
+ # New Year's Day
10
+ Japan.has_day_off_on :ganjitsu do |date|
11
+ date.month == JANUARY && date.day == 1
12
+ end
13
+
14
+ # Unofficially, banks and most companies close from December 31 - January 3
15
+ Japan.has_day_off_on :bank_holidays do |date|
16
+ (date.month == JANUARY && date.day <= 3) ||
17
+ (date.month == DECEMBER && date.day == 31)
18
+ end
19
+
20
+ # Coming of Age Day
21
+ Japan.has_day_off_on :seijin_no_hi do |date|
22
+ date.month == JANUARY && week_of(date) == 2
23
+ end
24
+
25
+ # National Foundation Day
26
+ Japan.has_day_off_on :kenkoku_kinen_no_hi do |date|
27
+ date.month == FEBRUARY && next_monday_if_sunday(date, 11)
28
+ end
29
+
30
+ # Vernal Equinox Day
31
+ Japan.has_day_off_on :shunbun do |date|
32
+ date.month == MARCH && date.day == 20
33
+ end
34
+
35
+ # Showa Day
36
+ Japan.has_day_off_on :showa_no_hi do |date|
37
+ date.month == APRIL && next_monday_if_sunday(date, 29)
38
+ end
39
+
40
+ # Golden Week: Constitution Memorial Day, Greenery Day and Children's # Day, respectively
41
+ Japan.has_day_off_on :golden_week do |date|
42
+ date.month == MAY && (date.day.between?(3, 5) ||
43
+ ((date.monday? || date.tuesday?) && date.day == 6))
44
+ end
45
+
46
+ # Marine Day
47
+ Japan.has_day_off_on :umi_no_hi do |date|
48
+ date.month == JULY && week_of(date) == 3
49
+ end
50
+
51
+ # Respect-for-the-Aged Day
52
+ Japan.has_day_off_on :keiro_no_hi do |date|
53
+ date.month == SEPTEMBER && week_of(date) == 3
54
+ end
55
+
56
+ # Autumnal Equinox Day
57
+ Japan.has_day_off_on :setsubun do |date|
58
+ date.month == SEPTEMBER && next_monday_if_sunday(date, 23)
59
+ end
60
+
61
+ # Health and Sports Day
62
+ Japan.has_day_off_on :taiiku_no_hi do |date|
63
+ date.month == OCTOBER && week_of(date) == 2
64
+ end
65
+
66
+ # Culture Day
67
+ Japan.has_day_off_on :bunka_no_hi do |date|
68
+ date.month == NOVEMBER && next_monday_if_sunday(date, 3)
69
+ end
70
+
71
+ # Labour Thanksgiving Day
72
+ Japan.has_day_off_on :kinro_kansha_no_hi do |date|
73
+ date.month == NOVEMBER && next_monday_if_sunday(date, 23)
74
+ end
75
+
76
+ # Emperor's Birthday
77
+ Japan.has_day_off_on :tenno_tanjobi do |date|
78
+ date.month == DECEMBER && next_monday_if_sunday(date, 23)
52
79
  end
53
80
  end
54
81
  end
File without changes
data/lib/rupee/quote.rb CHANGED
@@ -10,16 +10,16 @@ module Rupee
10
10
  #
11
11
  # require "rupee/quote"
12
12
  #
13
- # wfc = Rupee::Quote.new("WFC")
13
+ # wfc = Rupee::Quote.new(:wfc)
14
14
  #
15
15
  # wfc.get :price, :change, :pct_chg
16
- # #=> {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
16
+ # # => {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
17
17
  #
18
18
  # wfc.price
19
- # #=> 24.96
19
+ # # => 24.96
20
20
  #
21
21
  # wfc.change
22
- # #=> 0.17
22
+ # # => 0.17
23
23
  class Quote
24
24
  # A ticker symbol
25
25
  attr_accessor :ticker
@@ -35,11 +35,11 @@ module Rupee
35
35
 
36
36
  # Creates a new Rupee::Quote object.
37
37
  #
38
- # wfc = Rupee::Quote.new("WFC")
38
+ # wfc = Rupee::Quote.new(:wfc)
39
39
  #
40
40
  # is equivalent to
41
41
  #
42
- # wfc = Rupee::Quote.new("WFC", :source => :bloomberg, :frequency => 15)
42
+ # wfc = Rupee::Quote.new(:wfc, :source => :bloomberg, :frequency => 15)
43
43
  #
44
44
  # Configuration options
45
45
  #
@@ -51,7 +51,7 @@ module Rupee
51
51
  # quote source, in seconds (default is +15+).
52
52
  def initialize(ticker, opts = {})
53
53
  opts = { :source => :bloomberg, :frequency => 15 }.merge opts
54
- @ticker = ticker
54
+ @ticker = ticker.upcase
55
55
  @source = Quote.sources[opts[:source]]
56
56
  @frequency = opts[:frequency]
57
57
  @next_pull = Time.now
@@ -59,8 +59,8 @@ module Rupee
59
59
 
60
60
  # Retrieves the current information for a security
61
61
  #
62
- # Rupee::Quote.new("WFC").get :price, :change, :pct_chg
63
- # #=> {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
62
+ # Rupee::Quote.new(:wfc).get :price, :change, :pct_chg
63
+ # # => {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
64
64
  def get(*params)
65
65
  now = Time.now
66
66
  params = [:price] if params.empty?
@@ -91,15 +91,15 @@ module Rupee
91
91
 
92
92
  # Retrieves the current information for a security
93
93
  #
94
- # Rupee::Quote.new("WFC")[:price, :change, :pct_chg]
95
- # #=> {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
94
+ # Rupee::Quote.new(:wfc)[:price, :change, :pct_chg]
95
+ # # => {:price=>24.96, :change=>0.17, :pct_chg =>0.686}
96
96
  alias :[] :get
97
97
 
98
98
  # call-seq: #price
99
99
  #
100
100
  # Test
101
- [:price, :change, :pct_change, :date, :time, :bid, :ask, :open, :high,
102
- :low, :volume, :mkt_cap, :p_e].each do |method_name|
101
+ [:price, :change, :pct_chg, :date, :time, :bid, :ask, :open, :high, :low,
102
+ :volume, :mkt_cap, :p_e].each do |method_name|
103
103
  define_method method_name do
104
104
  get method_name
105
105
  end
@@ -142,8 +142,8 @@ module Rupee
142
142
 
143
143
  # Parses an object that might be a number
144
144
  #
145
- # parse "15" #=> 15
146
- # parse "abc" #=> "abc"
145
+ # parse "15" # => 15
146
+ # parse "abc" # => "abc"
147
147
  def parse(result)
148
148
  begin
149
149
  Float(result.gsub /,/, "")
@@ -155,7 +155,7 @@ module Rupee
155
155
  # Scans the values provided for the number with the greatest number of
156
156
  # decimal places, then returns that number of decimal places
157
157
  #
158
- # precision 0, 1.5, 2.25, 3 #=> 2
158
+ # precision 0, 1.5, 2.25, 3 # => 2
159
159
  def precision(*values)
160
160
  values.map do |value|
161
161
  temp = value.to_s.split(".")
@@ -15,7 +15,7 @@ module Rupee
15
15
  # :volatility => 0.3
16
16
  # )
17
17
  # puts call.black_scholes
18
- # #=> 2.1333718619275794
18
+ # # => 2.1333718619275794
19
19
  #
20
20
  # You still have the option of avoiding the creation of an object (and the
21
21
  # overhead it entails) by using the class methods directly:
@@ -23,7 +23,7 @@ module Rupee
23
23
  # require "rupee"
24
24
  #
25
25
  # puts Rupee::Option.black_scholes "c", 60, 65, 0.25, 0.08, 0, 0.3
26
- # #=> 2.1333718619275794
26
+ # # => 2.1333718619275794
27
27
  def initialize(opts = {})
28
28
  opts.each do |key, value|
29
29
  writer = key.to_s.+("=").to_sym
data/lib/rupee/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Rupee
2
2
  # The current version
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.4"
4
4
  end
@@ -1,85 +1,145 @@
1
1
  require File.dirname(__FILE__) + "/../spec_helper"
2
2
 
3
3
  describe Calendar do
4
+ def test_calendar(calendar, holidays)
5
+ holidays.each do |holiday|
6
+ year, month, day = holiday
7
+ calendar.day_off?(Time.new(year, month, day)).should_not be false
8
+ end
9
+ end
10
+
4
11
  describe "for Federal Reserve holidays" do
12
+ before :each do
13
+ @holidays = {
14
+ :new_years => [[2011, 1 , 1], [2012, 1, 2], [2013, 1, 1], [2014, 1, 1], [2015, 1, 1]],
15
+ :mlk_day => [[2011, 1, 17], [2012, 1, 16], [2013, 1, 21], [2014, 1, 20], [2015, 1, 19]],
16
+ :washingtons_day => [[2011, 2, 21], [2012, 2, 20], [2013, 2, 18], [2014, 2, 17], [2015, 2, 16]],
17
+ :memorial_day => [[2011, 5, 30], [2012, 5, 28], [2013, 5, 27], [2014, 5, 26], [2015, 5, 25]],
18
+ :independence_day => [[2011, 7, 4], [2012, 7, 4], [2013, 7, 4], [2014, 7, 4], [2015, 7, 4]],
19
+ :labor_day => [[2011, 9, 5], [2012, 9, 3], [2013, 9, 2], [2014, 9, 1], [2015, 9, 7]],
20
+ :columbus_day => [[2011, 10, 10], [2012, 10, 8], [2013, 10, 14], [2014, 10, 13], [2015, 10, 12]],
21
+ :veterans_day => [[2011, 11, 11], [2012, 11, 12], [2013, 11, 11], [2014, 11, 11], [2015, 11, 11]],
22
+ :thanksgiving => [[2011, 11, 24], [2012, 11, 22], [2013, 11, 28], [2014, 11, 27], [2015, 11, 26]],
23
+ :christmas => [[2011, 12, 26], [2012, 12, 25], [2013, 12, 25], [2014, 12, 25], [2015, 12, 25]]
24
+ }
25
+ end
26
+
5
27
  it "should be accurate for New Year's Day" do
6
- Calendar::US.day_off?(Time.new(2011, 1, 1)).should_not be false
7
- Calendar::US.day_off?(Time.new(2012, 1, 2)).should_not be false
8
- Calendar::US.day_off?(Time.new(2013, 1, 1)).should_not be false
9
- Calendar::US.day_off?(Time.new(2014, 1, 1)).should_not be false
10
- Calendar::US.day_off?(Time.new(2015, 1, 1)).should_not be false
28
+ test_calendar Calendar::US, @holidays[:new_years]
11
29
  end
12
30
 
13
31
  it "should be accurate for Martin Luther King's Birthday" do
14
- Calendar::US.day_off?(Time.new(2011, 1, 17)).should_not be false
15
- Calendar::US.day_off?(Time.new(2012, 1, 16)).should_not be false
16
- Calendar::US.day_off?(Time.new(2013, 1, 21)).should_not be false
17
- Calendar::US.day_off?(Time.new(2014, 1, 20)).should_not be false
18
- Calendar::US.day_off?(Time.new(2015, 1, 19)).should_not be false
32
+ test_calendar Calendar::US, @holidays[:mlk_day]
19
33
  end
20
34
 
21
35
  it "should be accurate for Washington's Birthday" do
22
- Calendar::US.day_off?(Time.new(2011, 2, 21)).should_not be false
23
- Calendar::US.day_off?(Time.new(2012, 2, 20)).should_not be false
24
- Calendar::US.day_off?(Time.new(2013, 2, 18)).should_not be false
25
- Calendar::US.day_off?(Time.new(2014, 2, 17)).should_not be false
26
- Calendar::US.day_off?(Time.new(2015, 2, 16)).should_not be false
36
+ test_calendar Calendar::US, @holidays[:washingtons_day]
27
37
  end
28
38
 
29
39
  it "should be accurate for Memorial Day" do
30
- Calendar::US.day_off?(Time.new(2011, 5, 30)).should_not be false
31
- Calendar::US.day_off?(Time.new(2012, 5, 28)).should_not be false
32
- Calendar::US.day_off?(Time.new(2013, 5, 27)).should_not be false
33
- Calendar::US.day_off?(Time.new(2014, 5, 26)).should_not be false
34
- Calendar::US.day_off?(Time.new(2015, 5, 25)).should_not be false
40
+ test_calendar Calendar::US, @holidays[:memorial_day]
35
41
  end
36
42
 
37
43
  it "should be accurate for Independence Day" do
38
- Calendar::US.day_off?(Time.new(2011, 7, 4)).should_not be false
39
- Calendar::US.day_off?(Time.new(2012, 7, 4)).should_not be false
40
- Calendar::US.day_off?(Time.new(2013, 7, 4)).should_not be false
41
- Calendar::US.day_off?(Time.new(2014, 7, 4)).should_not be false
42
- Calendar::US.day_off?(Time.new(2015, 7, 4)).should_not be false
44
+ test_calendar Calendar::US, @holidays[:independence_day]
43
45
  end
44
46
 
45
47
  it "should be accurate for Labor Day" do
46
- Calendar::US.day_off?(Time.new(2011, 9, 5)).should_not be false
47
- Calendar::US.day_off?(Time.new(2012, 9, 3)).should_not be false
48
- Calendar::US.day_off?(Time.new(2013, 9, 2)).should_not be false
49
- Calendar::US.day_off?(Time.new(2014, 9, 1)).should_not be false
50
- Calendar::US.day_off?(Time.new(2015, 9, 7)).should_not be false
48
+ test_calendar Calendar::US, @holidays[:labor_day]
51
49
  end
52
50
 
53
51
  it "should be accurate for Columbus Day" do
54
- Calendar::US.day_off?(Time.new(2011, 10, 10)).should_not be false
55
- Calendar::US.day_off?(Time.new(2012, 10, 8)).should_not be false
56
- Calendar::US.day_off?(Time.new(2013, 10, 14)).should_not be false
57
- Calendar::US.day_off?(Time.new(2014, 10, 13)).should_not be false
58
- Calendar::US.day_off?(Time.new(2015, 10, 12)).should_not be false
52
+ test_calendar Calendar::US, @holidays[:columbus_day]
59
53
  end
60
54
 
61
55
  it "should be accurate for Veterans Day" do
62
- Calendar::US.day_off?(Time.new(2011, 11, 11)).should_not be false
63
- Calendar::US.day_off?(Time.new(2012, 11, 12)).should_not be false
64
- Calendar::US.day_off?(Time.new(2013, 11, 11)).should_not be false
65
- Calendar::US.day_off?(Time.new(2014, 11, 11)).should_not be false
66
- Calendar::US.day_off?(Time.new(2015, 11, 11)).should_not be false
56
+ test_calendar Calendar::US, @holidays[:veterans_day]
67
57
  end
68
58
 
69
59
  it "should be accurate for Thanksgiving Day" do
70
- Calendar::US.day_off?(Time.new(2011, 11, 24)).should_not be false
71
- Calendar::US.day_off?(Time.new(2012, 11, 22)).should_not be false
72
- Calendar::US.day_off?(Time.new(2013, 11, 28)).should_not be false
73
- Calendar::US.day_off?(Time.new(2014, 11, 27)).should_not be false
74
- Calendar::US.day_off?(Time.new(2015, 11, 26)).should_not be false
60
+ test_calendar Calendar::US, @holidays[:thanksgiving]
75
61
  end
76
62
 
77
63
  it "should be accurate for Christmas Day" do
78
- Calendar::US.day_off?(Time.new(2011, 12, 26)).should_not be false
79
- Calendar::US.day_off?(Time.new(2012, 12, 25)).should_not be false
80
- Calendar::US.day_off?(Time.new(2013, 12, 25)).should_not be false
81
- Calendar::US.day_off?(Time.new(2014, 12, 25)).should_not be false
82
- Calendar::US.day_off?(Time.new(2015, 12, 25)).should_not be false
64
+ test_calendar Calendar::US, @holidays[:christmas]
65
+ end
66
+ end
67
+
68
+ describe "for Japanese holidays" do
69
+ before :each do
70
+ @holidays = {
71
+ :bank_holidays => [[2011, 1, 1], [2011, 1, 2], [2011, 1, 3], [2011, 12, 31],
72
+ [2012, 1, 1], [2012, 1, 2], [2012, 1, 3], [2012, 12, 31],
73
+ [2013, 1, 1], [2013, 1, 2], [2013, 1, 3], [2013, 12, 31],
74
+ [2014, 1, 1], [2014, 1, 2], [2014, 1, 3], [2014, 12, 31]],
75
+ :seijin_no_hi => [[2011, 1, 10], [2012, 1, 9], [2013, 1, 14], [2014, 1, 13]],
76
+ :kenkoku_kinen_no_hi => [[2011, 2, 11], [2012, 2, 11], [2013, 2, 11], [2014, 2, 11]],
77
+ :shunbun => [[2011, 3, 21], [2012, 3, 20], [2013, 3, 20], [2014, 3, 21]],
78
+ :showa_no_hi => [[2011, 4, 29], [2012, 4, 30], [2013, 4, 29], [2014, 4, 29]],
79
+ :golden_week => [[2011, 5, 3], [2011, 5, 4], [2011, 5, 5],
80
+ [2012, 5, 3], [2012, 5, 4], [2012, 5, 5],
81
+ [2013, 5, 3], [2013, 5, 4], [2013, 5, 5], [2013, 5, 6],
82
+ [2014, 5, 3], [2014, 5, 4], [2014, 5, 5], [2014, 5, 6]],
83
+ :umi_no_hi => [[2011, 7, 18], [2012, 7, 16], [2013, 7, 15], [2014, 7, 21]],
84
+ :keiro_no_hi => [[2011, 9, 19], [2012, 9, 17], [2013, 9, 16], [2014, 9, 15]],
85
+ :setsubun => [[2011, 9, 23], [2012, 9, 22], [2013, 9, 23], [2014, 9, 23]],
86
+ :taiiku_no_hi => [[2011, 10, 10], [2012, 10, 8], [2013, 10, 14], [2014, 10, 13]],
87
+ :bunka_no_hi => [[2011, 11, 3], [2012, 11, 3], [2013, 11, 4], [2014, 11, 3]],
88
+ :kinro_kansha_no_hi => [[2011, 11, 23], [2012, 11, 23], [2013, 11, 23], [2014, 11, 24]],
89
+ :tenno_tanjobi => [[2011, 12, 23], [2012, 12, 23], [2013, 12, 23], [2014, 12, 23]]
90
+ }
91
+ end
92
+
93
+ it "should be accurate for year-end bank holidays" do
94
+ test_calendar Calendar::Japan, @holidays[:bank_holidays]
95
+ end
96
+
97
+ it "should be accurate for Coming of Age Day" do
98
+ test_calendar Calendar::Japan, @holidays[:seijin_no_hi]
99
+ end
100
+
101
+ it "should be accurate for National Foundation Day" do
102
+ test_calendar Calendar::Japan, @holidays[:kenkoku_kinen_no_hi]
103
+ end
104
+
105
+ it "should be accurate for Vernal Equinox Day" do
106
+ # test_calendar Calendar::Japan, @holidays[:shunbun]
107
+ end
108
+
109
+ it "should be accurate for Showa Day" do
110
+ test_calendar Calendar::Japan, @holidays[:showa_no_hi]
111
+ end
112
+
113
+ it "should be accurate for Golden Week" do
114
+ test_calendar Calendar::Japan, @holidays[:golden_week]
115
+ end
116
+
117
+ it "should be accurate for Marine Day" do
118
+ test_calendar Calendar::Japan, @holidays[:umi_no_hi]
119
+ end
120
+
121
+ it "should be accurate for Respect-for-the-Aged Day" do
122
+ test_calendar Calendar::Japan, @holidays[:keiro_no_hi]
123
+ end
124
+
125
+ it "should be accurate for Autumnal Equinox Day" do
126
+ # test_calendar Calendar::Japan, @holidays[:setsubun]
127
+ end
128
+
129
+ it "should be accurate for Health and Sports Day" do
130
+ test_calendar Calendar::Japan, @holidays[:taiiku_no_hi]
131
+ end
132
+
133
+ it "should be accurate for Culture Day" do
134
+ test_calendar Calendar::Japan, @holidays[:bunka_no_hi]
135
+ end
136
+
137
+ it "should be accurate for Labour Thanksgiving Day" do
138
+ test_calendar Calendar::Japan, @holidays[:kinro_kansha_no_hi]
139
+ end
140
+
141
+ it "should be accurate for the Emperor's Birthday" do
142
+ test_calendar Calendar::Japan, @holidays[:tenno_tanjobi]
83
143
  end
84
144
  end
85
145
  end
@@ -8,7 +8,7 @@ describe Quote do
8
8
  describe "when pulling quotes" do
9
9
  describe "without any parameters specified" do
10
10
  before :each do
11
- @wfc = Quote.new("WFC")
11
+ @wfc = Quote.new(:wfc)
12
12
  end
13
13
 
14
14
  it "should default to pulling the price" do
data/test_rubies CHANGED
File without changes
metadata CHANGED
@@ -1,58 +1,60 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rupee
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.2
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.2.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Bryan McKelvey
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-30 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-10-01 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: bundler
16
- requirement: &79929690 !ruby/object:Gem::Requirement
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
17
19
  none: false
18
- requirements:
20
+ requirements:
19
21
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '1.0'
22
+ - !ruby/object:Gem::Version
23
+ version: "1.0"
22
24
  type: :development
23
- prerelease: false
24
- version_requirements: *79929690
25
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
26
27
  name: rspec
27
- requirement: &79929290 !ruby/object:Gem::Requirement
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
28
30
  none: false
29
- requirements:
31
+ requirements:
30
32
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
33
+ - !ruby/object:Gem::Version
34
+ version: "2.0"
33
35
  type: :development
34
- prerelease: false
35
- version_requirements: *79929290
36
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
37
38
  name: sdoc
38
- requirement: &79928970 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
39
41
  none: false
40
- requirements:
42
+ requirements:
41
43
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '0.3'
44
+ - !ruby/object:Gem::Version
45
+ version: "0.3"
44
46
  type: :development
45
- prerelease: false
46
- version_requirements: *79928970
47
- description: ! " rupee aims to provide user-friendly tools for
48
- use in\n financial gems and applications.\n"
49
- email:
47
+ version_requirements: *id003
48
+ description: " rupee aims to provide user-friendly tools for use in\n financial gems and applications.\n"
49
+ email:
50
50
  - bryan.mckelvey@gmail.com
51
51
  executables: []
52
- extensions:
52
+
53
+ extensions:
53
54
  - ext/rupee/extconf.rb
54
55
  extra_rdoc_files: []
55
- files:
56
+
57
+ files:
56
58
  - .autotest
57
59
  - .gitignore
58
60
  - .rspec
@@ -72,6 +74,7 @@ files:
72
74
  - lib/rupee/calendar.rb
73
75
  - lib/rupee/calendar/japan.rb
74
76
  - lib/rupee/calendar/us.rb
77
+ - lib/rupee/generators/install.rb
75
78
  - lib/rupee/option.rb
76
79
  - lib/rupee/quote.rb
77
80
  - lib/rupee/quote/source.rb
@@ -89,30 +92,33 @@ files:
89
92
  - test_rubies
90
93
  homepage: https://github.com/brymck/rupee
91
94
  licenses: []
95
+
92
96
  post_install_message:
93
97
  rdoc_options: []
94
- require_paths:
98
+
99
+ require_paths:
95
100
  - lib
96
101
  - ext
97
- required_ruby_version: !ruby/object:Gem::Requirement
102
+ required_ruby_version: !ruby/object:Gem::Requirement
98
103
  none: false
99
- requirements:
100
- - - ! '>='
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
- required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: "0"
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
109
  none: false
105
- requirements:
106
- - - ! '>='
107
- - !ruby/object:Gem::Version
108
- version: '0'
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: "0"
109
114
  requirements: []
115
+
110
116
  rubyforge_project: rupee
111
117
  rubygems_version: 1.8.10
112
118
  signing_key:
113
119
  specification_version: 3
114
120
  summary: Financial tools for Ruby
115
- test_files:
121
+ test_files:
116
122
  - spec/native/bond_spec.rb
117
123
  - spec/native/future_spec.rb
118
124
  - spec/native/option_spec.rb