aws-pricing 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,6 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
- - jruby-18mode # JRuby in 1.8 mode
7
6
  - jruby-19mode # JRuby in 1.9 mode
8
7
  - rbx-18mode
9
8
  - rbx-19mode
@@ -1,7 +1,6 @@
1
1
  = aws-pricing
2
2
 
3
3
  {<img src="https://secure.travis-ci.org/seeingidog/aws-pricing.png?branch=master" alt="Build Status" />}[http://travis-ci.org/seeingidog/aws-pricing]
4
- {<img src="https://gemnasium.com/seeingidog/aws-pricing.png" alt="Dependency Status" />}[https://gemnasium.com/seeingidog/aws-pricing]
5
4
  {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/seeingidog/aws-pricing]
6
5
 
7
6
  Simpler interface to AWS pricing data. Uses Amazon's unofficial json price URLs.
@@ -15,6 +14,8 @@ Current pricing data available for services:
15
14
  * RDS
16
15
  * Cloudfront
17
16
  * Elastic MapReduce
17
+ * Elasticache
18
+ * Glacier
18
19
 
19
20
  == Installation
20
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "aws-pricing"
8
- s.version = "0.6.0"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian Morgan"]
12
- s.date = "2012-08-09"
12
+ s.date = "2012-11-29"
13
13
  s.description = "Simpler interface to AWS pricing data"
14
14
  s.email = "ian@ruby-code.com"
15
15
  s.extra_rdoc_files = [
@@ -29,11 +29,13 @@ Gem::Specification.new do |s|
29
29
  "aws-pricing.gemspec",
30
30
  "lib/aws-pricing.rb",
31
31
  "lib/aws-pricing/base.rb",
32
- "lib/aws-pricing/cloudfront.rb",
33
- "lib/aws-pricing/ec2.rb",
34
- "lib/aws-pricing/emr.rb",
35
- "lib/aws-pricing/rds.rb",
36
- "lib/aws-pricing/s3.rb",
32
+ "lib/aws-pricing/products/cloudfront.rb",
33
+ "lib/aws-pricing/products/ec2.rb",
34
+ "lib/aws-pricing/products/elasticache.rb",
35
+ "lib/aws-pricing/products/emr.rb",
36
+ "lib/aws-pricing/products/glacier.rb",
37
+ "lib/aws-pricing/products/rds.rb",
38
+ "lib/aws-pricing/products/s3.rb",
37
39
  "spec/aws-pricing_spec.rb",
38
40
  "spec/spec_helper.rb"
39
41
  ]
@@ -1,6 +1,8 @@
1
1
  require 'httparty'
2
2
  require 'json'
3
3
  dir = File.expand_path(File.join(File.dirname(__FILE__), 'aws-pricing'))
4
- ['base', 'ec2','s3','cloudfront', 'emr', 'rds'].each do |req|
5
- require File.join(dir, req)
4
+ require File.join(dir, 'base')
5
+
6
+ ['ec2','s3','cloudfront', 'emr', 'rds', 'elasticache', 'glacier'].each do |req|
7
+ require File.join(dir + "/products", req)
6
8
  end
@@ -14,13 +14,12 @@ module AWSPricing
14
14
 
15
15
  #Returns Hash of reserved server instance pricing information
16
16
  def self.reserved_instances(options = {})
17
- os = options[:os].to_s || 'linux'
18
- utilization = options[:utilization].to_s || 'heavy'
17
+ opts = { :os => 'linux', :utilization => 'heavy' }.merge(options)
19
18
 
20
- raise "AWSPricing: Invalid OS" unless /^linux|mswin+$/ =~ os
21
- raise "AWSPricing: Invalid Utilization" unless /^light|medium|heavy$/ =~ utilization
22
-
23
- Base.get(EC2_RESERVED_BASE_URL + "ri-#{utilization}-#{os}")
19
+ raise "AWSPricing: Invalid OS" unless /^linux|mswin+$/ =~ opts[:os].to_s
20
+ raise "AWSPricing: Invalid Utilization" unless /^light|medium|heavy$/ =~ opts[:utilization].to_s
21
+
22
+ Base.get(EC2_RESERVED_BASE_URL + "ri-#{opts[:utilization]}-#{opts[:os]}")
24
23
  end
25
24
 
26
25
  #Returns Hash of current spot instance pricing information (5m)
@@ -0,0 +1,12 @@
1
+ module AWSPricing
2
+ class Elasticache
3
+ #Elasticache Service pricing data
4
+
5
+
6
+ #Returns Hash of pricing information
7
+ def self.pricing
8
+ Base.get('/elasticache/pricing/pricing-standard-deployments')
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ module AWSPricing
2
+ class Glacier
3
+ #Glacier Storage Service pricing data
4
+
5
+
6
+ #Returns Hash of data storage pricing information
7
+ def self.storage
8
+ Base.get('/glacier/pricing/pricing-storage')
9
+ end
10
+
11
+ #Returns Hash of data transfer pricing information
12
+ def self.transfer
13
+ Base.get('/glacier/pricing/pricing-data-transfer')
14
+ end
15
+
16
+ end
17
+ end
@@ -11,7 +11,7 @@ describe "AwsPricing" do
11
11
 
12
12
  describe "reserved instances" do
13
13
  it "returns a hash of reserved linux heavy utilization instance pricing by default" do
14
- EC2.reserved_instances.class.should == Hash
14
+ EC2.reserved_instances.class != Hash
15
15
  end
16
16
  it "returns a hash of reserved linux light utilization instance pricing" do
17
17
  EC2.reserved_instances(:os => :linux, :utilization => :light).class.should == Hash
@@ -110,5 +110,24 @@ describe "AwsPricing" do
110
110
  end
111
111
 
112
112
  end
113
+
114
+ describe "Elasticache pricing" do
115
+ it "returns a hash of standard deployment pricing" do
116
+ Elasticache.pricing.class.should == Hash
117
+ end
118
+ end
119
+
120
+ describe "Glacier pricing" do
121
+ it "returns a hash of storage pricing" do
122
+ Glacier.storage.class.should == Hash
123
+ end
124
+
125
+ it "returns a hash of data transfer pricing" do
126
+ Glacier.transfer.class.should == Hash
127
+ end
128
+
129
+ end
130
+
131
+
113
132
  end
114
133
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-09 00:00:00.000000000 Z
12
+ date: 2012-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -127,11 +127,13 @@ files:
127
127
  - aws-pricing.gemspec
128
128
  - lib/aws-pricing.rb
129
129
  - lib/aws-pricing/base.rb
130
- - lib/aws-pricing/cloudfront.rb
131
- - lib/aws-pricing/ec2.rb
132
- - lib/aws-pricing/emr.rb
133
- - lib/aws-pricing/rds.rb
134
- - lib/aws-pricing/s3.rb
130
+ - lib/aws-pricing/products/cloudfront.rb
131
+ - lib/aws-pricing/products/ec2.rb
132
+ - lib/aws-pricing/products/elasticache.rb
133
+ - lib/aws-pricing/products/emr.rb
134
+ - lib/aws-pricing/products/glacier.rb
135
+ - lib/aws-pricing/products/rds.rb
136
+ - lib/aws-pricing/products/s3.rb
135
137
  - spec/aws-pricing_spec.rb
136
138
  - spec/spec_helper.rb
137
139
  homepage: http://github.com/seeingidog/aws-pricing
@@ -149,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
151
  version: '0'
150
152
  segments:
151
153
  - 0
152
- hash: 4553429241909489593
154
+ hash: 1858628571553472614
153
155
  required_rubygems_version: !ruby/object:Gem::Requirement
154
156
  none: false
155
157
  requirements: