amazon-pricing 0.1.51 → 0.1.52

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWEzNTE0ZTc2NmY3ZGVmMGUzZTJmZTAwYWVjN2QwMWJjYzY2NDA0Nw==
4
+ ZjhmYmJjYTBkNmVmYzk3NWUwM2FhZTk4ZTFhZGQ4MjM5NTg1YWE0Nw==
5
5
  data.tar.gz: !binary |-
6
- YjYzZDRiODEyNWFjNjM3MTcwNzY4NWU5Mjc0ZDI2YTc2NmRiNjM5OA==
6
+ NzdlMjYwNWRlMDBhZDA4ZWUxY2RmOWFhY2NhMjU4ZmRiYTA4NmMyNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDliMjdiNWVjMzUxYzM3YWJjZDIwZDQxNzYzZTA0NmEwYTRiNjcyZTgyZWYy
10
- MTcwMDBhYmRkYTAxMzk3OWExMzJlNTE1ZWIyMjllNWRiYWQ2ZjM4ZjFkNTdl
11
- ZTU4OTUyNjYzZGUyN2I3MTRjYzgxNjYyODU0ZDUyNjhiOTM2MjY=
9
+ YTI2ZGQwZGRiZjUxNjEyNDlhZTkwMWM5MmI5NjAzM2RlMDAxZTFlZTY0OTAw
10
+ NTY1YTZmMWJiZmUwNWM3N2MwMjZmODlmZjNjYTIxYmJhNDllOGNkNTEzMTEx
11
+ Y2QxOTI3OGZlODUyOTdhZjIyZWQxZjE3MDljM2QzYTIwZTljNTQ=
12
12
  data.tar.gz: !binary |-
13
- YTU2NjZmYWQ0YjM0NTg1N2FjNzk5YmFmYzBkNjkwN2M1MzQ4MmY3NDZhNzQy
14
- N2E2NDdlOWU3MDk1NTYwMzYzMWI4MWFkOTQ4M2U4NTI4YTI1OWRiMzVjMjYz
15
- MDE0NGZkMTZkZWU2ZmRhZGM1YjZjY2IxZGJiZmJjNDk5ZWJiNDU=
13
+ YTY1NTI5MWE5Njg1Y2VhYjA0MmJiNDcwYTM1MjMzZDdlMTEzNThmZWQ4YTU2
14
+ MmE1MmJjMTI2NDQ0NjFjNDM4MjhmMjg0YjQ3Y2I5YzI0NjI0MjRkYjhmN2Jj
15
+ NTYwZGIxNDliMGU3ZjBkOGFiNzExNDBjMGRlMzczZTIyNTVmYjI=
@@ -19,23 +19,23 @@ module AwsPricing
19
19
  :noupfront_price_per_hour_1_year, :noupfront_price_per_hour_3_year
20
20
 
21
21
  def allupfront_effective_rate_1_year
22
- allupfront_prepay_1_year / 365 / 24
22
+ (allupfront_prepay_1_year / 365 / 24).round(4)
23
23
  end
24
24
 
25
25
  def allupfront_effective_rate_3_year
26
- allupfront_prepay_3_year / 3 / 365 / 24
26
+ (allupfront_prepay_3_year / 3 / 365 / 24).round(4)
27
27
  end
28
28
 
29
29
  def partialupfront_effective_rate_1_year
30
- partialupfront_prepay_1_year / 365 / 24 + partialupfront_price_per_hour_1_year
30
+ (partialupfront_prepay_1_year / 365 / 24 + partialupfront_price_per_hour_1_year).round(4)
31
31
  end
32
32
 
33
33
  def partialupfront_effective_rate_3_year
34
- partialupfront_prepay_3_year / 3 / 365 / 24 + partialupfront_price_per_hour_3_year
34
+ (partialupfront_prepay_3_year / 3 / 365 / 24 + partialupfront_price_per_hour_3_year).round(4)
35
35
  end
36
36
 
37
37
  def noupfront_effective_rate_1_year
38
- noupfront_price_per_hour_1_year
38
+ (noupfront_price_per_hour_1_year).round(4)
39
39
  end
40
40
 
41
41
  def initialize(instance_type=nil, name=nil)
@@ -8,5 +8,5 @@
8
8
  # Home:: http://github.com/CloudHealth/amazon-pricing
9
9
  #++
10
10
  module AwsPricing
11
- VERSION = '0.1.51'
11
+ VERSION = '0.1.52'
12
12
  end
@@ -112,11 +112,11 @@ class TestEc2InstanceTypes < Test::Unit::TestCase
112
112
  assert os.allupfront_prepay_1_year == 542
113
113
  assert os.partialupfront_prepay_3_year == 508
114
114
  assert os.allupfront_prepay_3_year == 1020
115
- assert os.noupfront_effective_rate_1_year.round(4) == 0.0730
116
- assert os.partialupfront_effective_rate_1_year.round(4) == 0.0632
117
- assert os.allupfront_effective_rate_1_year.round(4) == 0.0619
118
- assert os.partialupfront_effective_rate_3_year.round(4) == 0.0413
119
- assert os.allupfront_effective_rate_3_year.round(4) == 0.0388
115
+ assert os.noupfront_effective_rate_1_year == 0.0730
116
+ assert os.partialupfront_effective_rate_1_year == 0.0632
117
+ assert os.allupfront_effective_rate_1_year == 0.0619
118
+ assert os.partialupfront_effective_rate_3_year == 0.0413
119
+ assert os.allupfront_effective_rate_3_year == 0.0388
120
120
  end
121
121
 
122
122
  def test_bad_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.51
4
+ version: 0.1.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Kinsella