floodgate 0.0.17 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/floodgate/client.rb +6 -1
  4. data/lib/floodgate/config.rb +4 -0
  5. data/lib/floodgate/version.rb +1 -1
  6. data/spec/cassettes/Floodgate_Client/_add_ip_address/when_an_ip_address_is_specified/adds_it_to_the_list_of_allowed_ip_addresses.yml +35 -25
  7. data/spec/cassettes/Floodgate_Client/_allowed_ip_addresses/returns_the_allowed_ip_addresses.yml +21 -15
  8. data/spec/cassettes/Floodgate_Client/_close/changes_filter_traffic_from_false_to_true.yml +28 -20
  9. data/spec/cassettes/Floodgate_Client/_my_ip_address/is_an_ip_address.yml +4 -4
  10. data/spec/cassettes/Floodgate_Client/_open/changes_filter_traffic_from_true_to_false.yml +28 -20
  11. data/spec/cassettes/Floodgate_Client/_remove_ip_address/when_an_ip_address_is_specified/removes_it_from_the_list_of_allowed_ip_addresses.yml +28 -20
  12. data/spec/cassettes/Floodgate_Client/_set_redirect_url/when_a_redirect_url_is_specified/changes_the_redirect_url.yml +28 -20
  13. data/spec/cassettes/Floodgate_Client/_set_redirect_url/when_nil_is_specified/clears_the_redirect_url.yml +28 -20
  14. data/spec/cassettes/Floodgate_Client/_status/when_the_credentials_are_not_valid/returns_the_default_status.yml +7 -5
  15. data/spec/cassettes/Floodgate_Client/_status/when_the_credentials_are_valid/and_traffic_filtering_is_enabled/filter_traffic_is_true.yml +7 -5
  16. data/spec/cassettes/Floodgate_Client/_status/when_the_credentials_are_valid/and_traffic_filtering_is_not_enabled/filter_traffic_is_false.yml +7 -5
  17. data/spec/spec_helper.rb +2 -0
  18. metadata +2 -2
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://floodgate-api-staging.herokuapp.com/api/v1/apps/foo/status?api_token=bar
5
+ uri: http://staging.api.floodgate.io/api/apps/foo/status?api_token=bar
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
11
  - FloodgateAgent
12
+ Accept:
13
+ - application/vnd.floodgate-v1+json
12
14
  response:
13
15
  status:
14
16
  code: 401
@@ -19,13 +21,13 @@ http_interactions:
19
21
  content-type:
20
22
  - application/json
21
23
  date:
22
- - Fri, 28 Feb 2014 17:18:06 GMT
24
+ - Mon, 03 Mar 2014 20:59:48 GMT
23
25
  server:
24
26
  - WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25)
25
27
  x-request-id:
26
- - 621cd65a-a973-4301-9879-8ab579cce5a8
28
+ - 7ea7d8cd-5186-4ea8-a110-e114dacb3941
27
29
  x-runtime:
28
- - '0.010765'
30
+ - '0.006203'
29
31
  content-length:
30
32
  - '28'
31
33
  connection:
@@ -34,5 +36,5 @@ http_interactions:
34
36
  encoding: UTF-8
35
37
  string: "{\"error\":\"401 Unauthorized\"}"
36
38
  http_version:
37
- recorded_at: Fri, 28 Feb 2014 17:18:06 GMT
39
+ recorded_at: Mon, 03 Mar 2014 20:59:48 GMT
38
40
  recorded_with: VCR 2.8.0
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://floodgate-api-staging.herokuapp.com/api/v1/apps/fa5d63bcf3d6b557eee782c9e61e4002/status?api_token=da2f2d06c102eea0f1971c2c90936ee3
5
+ uri: http://staging.api.floodgate.io/api/apps/fa5d63bcf3d6b557eee782c9e61e4002/status?api_token=da2f2d06c102eea0f1971c2c90936ee3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
11
  - FloodgateAgent
12
+ Accept:
13
+ - application/vnd.floodgate-v1+json
12
14
  response:
13
15
  status:
14
16
  code: 200
@@ -19,15 +21,15 @@ http_interactions:
19
21
  content-type:
20
22
  - application/json
21
23
  date:
22
- - Fri, 28 Feb 2014 17:18:07 GMT
24
+ - Mon, 03 Mar 2014 20:59:49 GMT
23
25
  etag:
24
26
  - "\"dee747427e4c4ad6746155406732f396\""
25
27
  server:
26
28
  - WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25)
27
29
  x-request-id:
28
- - 555eecac-3da8-4fb0-ac94-c9d0ad6f4e56
30
+ - 360a9587-6f6b-46d2-9b82-7af47c874aa7
29
31
  x-runtime:
30
- - '0.016831'
32
+ - '0.013004'
31
33
  content-length:
32
34
  - '112'
33
35
  connection:
@@ -36,5 +38,5 @@ http_interactions:
36
38
  encoding: UTF-8
37
39
  string: "{\"allowed_ip_addresses\":[],\"filter_traffic\":true,\"name\":\"floodgate-gem-filter-traffic-true\",\"redirect_url\":null}"
38
40
  http_version:
39
- recorded_at: Fri, 28 Feb 2014 17:18:07 GMT
41
+ recorded_at: Mon, 03 Mar 2014 20:59:49 GMT
40
42
  recorded_with: VCR 2.8.0
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://floodgate-api-staging.herokuapp.com/api/v1/apps/cbaeb13b7f63956ef70c382a7a67407d/status?api_token=349d2b1ee8ec56eb04b909b1eb9993b0
5
+ uri: http://staging.api.floodgate.io/api/apps/cbaeb13b7f63956ef70c382a7a67407d/status?api_token=349d2b1ee8ec56eb04b909b1eb9993b0
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
11
  - FloodgateAgent
12
+ Accept:
13
+ - application/vnd.floodgate-v1+json
12
14
  response:
13
15
  status:
14
16
  code: 200
@@ -19,15 +21,15 @@ http_interactions:
19
21
  content-type:
20
22
  - application/json
21
23
  date:
22
- - Fri, 28 Feb 2014 17:18:07 GMT
24
+ - Mon, 03 Mar 2014 20:59:49 GMT
23
25
  etag:
24
26
  - "\"8843d65a25ba489ef0f7eea44981e1f6\""
25
27
  server:
26
28
  - WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25)
27
29
  x-request-id:
28
- - fb64ccea-f5a0-4b17-b7dd-95efe530d5d3
30
+ - 947e9be0-5789-48c8-be02-1a563d015efb
29
31
  x-runtime:
30
- - '0.139455'
32
+ - '0.009745'
31
33
  content-length:
32
34
  - '131'
33
35
  connection:
@@ -36,5 +38,5 @@ http_interactions:
36
38
  encoding: UTF-8
37
39
  string: "{\"allowed_ip_addresses\":[\"166.147.100.145\"],\"filter_traffic\":false,\"name\":\"floodgate-gem-filter-traffic-false\",\"redirect_url\":null}"
38
40
  http_version:
39
- recorded_at: Fri, 28 Feb 2014 17:18:07 GMT
41
+ recorded_at: Mon, 03 Mar 2014 20:59:49 GMT
40
42
  recorded_with: VCR 2.8.0
data/spec/spec_helper.rb CHANGED
@@ -8,6 +8,8 @@ require 'rspec'
8
8
 
9
9
  require 'floodgate'
10
10
 
11
+ ENV['FLOODGATE_TEST_MODE'] = 'TRUE'
12
+
11
13
  # Requires supporting ruby files with custom matchers and macros, etc,
12
14
  # in spec/support/ and its subdirectories.
13
15
  Dir[File.expand_path(File.join(__FILE__, '../support/**/*.rb'))].each { |f| require f }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: floodgate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark McEahern
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-28 00:00:00.000000000 Z
12
+ date: 2014-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday