statraptor 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,3 +28,7 @@
28
28
  ## 0.2.3 (March 1, 2012)
29
29
 
30
30
  * Add suppoort for `client.find_or_create_user`
31
+
32
+ ## 0.2.4 (March 6, 2012)
33
+
34
+ * Drop support for Typhoeus
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- statraptor (0.2.1)
4
+ statraptor (0.2.4)
5
5
  activeresource (>= 2.3.5)
6
6
  json (>= 1.4.6)
7
7
  rest-client (>= 1.6.6)
@@ -10,13 +10,13 @@ PATH
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- activemodel (3.2.1)
14
- activesupport (= 3.2.1)
13
+ activemodel (3.2.2)
14
+ activesupport (= 3.2.2)
15
15
  builder (~> 3.0.0)
16
- activeresource (3.2.1)
17
- activemodel (= 3.2.1)
18
- activesupport (= 3.2.1)
19
- activesupport (3.2.1)
16
+ activeresource (3.2.2)
17
+ activemodel (= 3.2.2)
18
+ activesupport (= 3.2.2)
19
+ activesupport (3.2.2)
20
20
  i18n (~> 0.6)
21
21
  multi_json (~> 1.0)
22
22
  addressable (2.2.6)
@@ -1,5 +1,4 @@
1
1
  require 'rubygems'
2
- require 'typhoeus'
3
2
  require 'json'
4
3
  require 'rest_client'
5
4
  require 'statraptor/version'
@@ -16,7 +16,6 @@ module StatRaptor
16
16
  include StatRaptor::Client::Graphs
17
17
 
18
18
  require 'statraptor/client/adapters/rest_client'
19
- require 'statraptor/client/adapters/typhoeus'
20
19
 
21
20
  attr_accessor *Config::VALID_OPTIONS_KEYS
22
21
 
@@ -1,3 +1,3 @@
1
1
  module StatRaptor
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -38,5 +38,23 @@ describe StatRaptor::Client::Projects do
38
38
  client.delete_project(:user_credentials => "abc123", :subdomain => "modern-marvels")
39
39
  }.should raise_error(StatRaptor::Error::Unauthorized, "Invalid user API key specified")
40
40
  end
41
+
42
+ it "allows re-creating a deleted project" do
43
+ # Set up a user and project
44
+ user = client.create_user(:email => random_email, :chargify_api_key => "ABC123")
45
+ project = client.create_project(:user_credentials => user["user_credentials"], :project => {
46
+ :name => "Modern Marvels", :subdomain => "modern-marvels", :component => "advanced"
47
+ })
48
+
49
+ # Delete the project
50
+ client.delete_project(:user_credentials => user["user_credentials"], :subdomain => "modern-marvels")
51
+
52
+ # Recreate the project
53
+ lambda {
54
+ project = client.create_project(:user_credentials => user["user_credentials"], :project => {
55
+ :name => "Modern Marvels", :subdomain => "modern-marvels", :component => "advanced"
56
+ })
57
+ }.should_not raise_error(StatRaptor::Error, "Subdomain has already been taken")
58
+ end
41
59
  end
42
60
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statraptor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shay Frendt
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - "="
124
124
  - !ruby/object:Gem::Version
125
- hash: 3403259733
125
+ hash: -3911612848
126
126
  segments:
127
127
  - 2
128
128
  - 0
@@ -233,7 +233,6 @@ files:
233
233
  - lib/statraptor.rb
234
234
  - lib/statraptor/client.rb
235
235
  - lib/statraptor/client/adapters/rest_client.rb
236
- - lib/statraptor/client/adapters/typhoeus.rb
237
236
  - lib/statraptor/client/graphs.rb
238
237
  - lib/statraptor/client/projects.rb
239
238
  - lib/statraptor/client/users.rb
@@ -245,7 +244,6 @@ files:
245
244
  - spec/spec.opts
246
245
  - spec/spec_helper.rb
247
246
  - spec/statrapator/client/adapters/rest_client_spec.rb
248
- - spec/statrapator/client/adapters/typhoeus_spec.rb
249
247
  - spec/statrapator/client/graphs_spec.rb
250
248
  - spec/statrapator/client/projects_spec.rb
251
249
  - spec/statrapator/client/user_spec.rb
@@ -294,7 +292,6 @@ test_files:
294
292
  - spec/spec.opts
295
293
  - spec/spec_helper.rb
296
294
  - spec/statrapator/client/adapters/rest_client_spec.rb
297
- - spec/statrapator/client/adapters/typhoeus_spec.rb
298
295
  - spec/statrapator/client/graphs_spec.rb
299
296
  - spec/statrapator/client/projects_spec.rb
300
297
  - spec/statrapator/client/user_spec.rb
@@ -1,19 +0,0 @@
1
- module StatRaptor
2
- class Client
3
- module Adapters
4
- module Typhoeus
5
- def self.request_api_response(method, path, params = {})
6
- params.merge!(:platform_credentials => StatRaptor.platform_credentials)
7
-
8
- ::Typhoeus::Request.run(
9
- "#{StatRaptor.endpoint}/api/v1#{path}",
10
- :method => method,
11
- :params => params,
12
- :disable_ssl_peer_verification => StatRaptor.disable_ssl_peer_verification,
13
- :timeout => StatRaptor.timeout
14
- )
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,10 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe StatRaptor::Client::Adapters::Typhoeus do
4
- describe ".request_api_response", :vcr do
5
- it "returns a typhoeus response" do
6
- response = StatRaptor::Client::Adapters::Typhoeus.request_api_response(:get, "/users.json")
7
- response.should be_a(Typhoeus::Response)
8
- end
9
- end
10
- end