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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -0
- data/lib/optimizely/engine.rb +2 -0
- data/lib/optimizely/exceptions.rb +1 -0
- data/lib/optimizely/version.rb +1 -1
- data/test/test_optimizely.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9e48555c06465e2d96afa5d32ffef4ce2f3f153
|
4
|
+
data.tar.gz: 291e3967815cddb539da8ba5ff298b81c6398e9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb3586e8fd419984b65956423a7581c554436e9dd26517fad5b2e7e9b16e4fd9a8d04accc024995d1a6fa0d8defcda029d07a8a26416836647de7a10c78c9b2
|
7
|
+
data.tar.gz: 35c1ff56dfd0c1505eed79f9debbd8b8325863ec409657b5e575a9849d4b7e0b22f6168e28ac056c90b28c59becad98b187deae08f0d7e52323ec25b8a37c282
|
data/Gemfile.lock
CHANGED
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
|
data/lib/optimizely/engine.rb
CHANGED
@@ -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]
|
data/lib/optimizely/version.rb
CHANGED
data/test/test_optimizely.rb
CHANGED
@@ -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
|