optimizely 1.2.0 → 1.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b66e79d51fa50c9646d90e3dfdce45969256c33
4
- data.tar.gz: 7fa873506a686f2e4e691cb280ee35ac44c6c250
3
+ metadata.gz: f9e48555c06465e2d96afa5d32ffef4ce2f3f153
4
+ data.tar.gz: 291e3967815cddb539da8ba5ff298b81c6398e9d
5
5
  SHA512:
6
- metadata.gz: f48dd35107452634ae87980421b0ca0a9bf645230fe8755f82e379a5738bb57fdd8f6cc37a3b3ecd3335dc41f71c3d770d5ee9009561ef4ed547e8a0bc33f80b
7
- data.tar.gz: 8d484df17bffcd2adf824aa9840db07ef7e867d7f75329d39ea66c60d1890aabecd626038465c65b410cffd698dc124023a0b138d389f06134b6a525669a0ee1
6
+ metadata.gz: 6cb3586e8fd419984b65956423a7581c554436e9dd26517fad5b2e7e9b16e4fd9a8d04accc024995d1a6fa0d8defcda029d07a8a26416836647de7a10c78c9b2
7
+ data.tar.gz: 35c1ff56dfd0c1505eed79f9debbd8b8325863ec409657b5e575a9849d4b7e0b22f6168e28ac056c90b28c59becad98b187deae08f0d7e52323ec25b8a37c282
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- optimizely (1.1.2)
4
+ optimizely (1.2.1)
5
5
 
6
6
  GEM
7
7
  remote: http://www.rubygems.org/
data/README.md CHANGED
@@ -34,6 +34,10 @@ The fields that are available for a project: project_name, project_status, id an
34
34
  Retrieve a specific project:
35
35
  project = optimizely.project(12345)
36
36
 
37
+ Delete a project, you need to retrieve the project first:
38
+ project = optimizely.project(12345)
39
+ optimizely.delete
40
+
37
41
  ## Experiments
38
42
 
39
43
  The fields that are available for an experiment: id, project_id, variation_ids, edit_url and status.
@@ -44,6 +48,10 @@ The fields that are available for an experiment: id, project_id, variation_ids,
44
48
  Retrieve a specific experiment:
45
49
  experiment = optimizely.experiment(12345)
46
50
 
51
+ Delete an experiment, you need to retrieve the experiment first:
52
+ experiment = optimizely.experiment(12345)
53
+ optimizely.delete
54
+
47
55
  ## Variations
48
56
 
49
57
  The fields that are available for a varation: is_paused, description, weight, created, variation_id, section_id, js_component, experiment_id, project_id and id.
@@ -54,6 +62,10 @@ The fields that are available for a varation: is_paused, description, weight, cr
54
62
  Retrieve a specific variation:
55
63
  variation = optimizely.variation(12345)
56
64
 
65
+ Delete a variation, you need to retrieve the variation first:
66
+ variation = optimizely.variation(12345)
67
+ optimizely.delete
68
+
57
69
  ## Audiences
58
70
 
59
71
  The fields that are available for an audience: id, name, project_id and description.
@@ -64,6 +76,10 @@ The fields that are available for an audience: id, name, project_id and descript
64
76
  Retrieve a specific audience:
65
77
  audience = optimizely.audience(12345)
66
78
 
79
+ Delete an audience, you need to retrieve the audience first:
80
+ audience = optimizely.audience(12345)
81
+ optimizely.delete
82
+
67
83
  # Information
68
84
 
69
85
  ### Changelog
@@ -198,6 +198,8 @@ module Optimizely
198
198
  end
199
199
 
200
200
  def delete
201
+ raise OptimizelyError::NoId, "An ID is required to delete data." if @url.nil?
202
+
201
203
  uri = URI.parse("#{BASE_URL}#{@url}")
202
204
  https = Net::HTTP.new(uri.host, uri.port)
203
205
  https.read_timeout = @options[:timeout] if @options[:timeout]
@@ -14,4 +14,5 @@ module OptimizelyError
14
14
  class NoExperimentID < StandardError; end;
15
15
  class NoVariationID < StandardError; end;
16
16
  class NoAudienceID < StandardError; end;
17
+ class NoId < StandardError; end;
17
18
  end
@@ -1,3 +1,3 @@
1
1
  module Optimizely
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -66,4 +66,11 @@ class OptimizelyTest < Test::Unit::TestCase
66
66
  optimizely.projects
67
67
  end
68
68
  end
69
+
70
+ def test_delete_no_id
71
+ optimizely = Optimizely.new({ api_token: '1234567890:xxxxx' })
72
+ assert_raise OptimizelyError::NoId do
73
+ optimizely.delete
74
+ end
75
+ end
69
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optimizely
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martijn Scheijbeler