limelm 0.1.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 (42) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/Gemfile +15 -0
  4. data/Gemfile.lock +75 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.md +75 -0
  7. data/Rakefile +50 -0
  8. data/TODO.md +10 -0
  9. data/VERSION +1 -0
  10. data/lib/lime_lm/connection.rb +23 -0
  11. data/lib/lime_lm/exceptions.rb +6 -0
  12. data/lib/lime_lm/feature.rb +62 -0
  13. data/lib/lime_lm/key.rb +83 -0
  14. data/lib/lime_lm/utils.rb +7 -0
  15. data/lib/limelm.rb +30 -0
  16. data/limelm.gemspec +89 -0
  17. data/spec/fixtures/dish_cassettes/all_features.yml +47 -0
  18. data/spec/fixtures/dish_cassettes/create_custom_feature.yml +46 -0
  19. data/spec/fixtures/dish_cassettes/create_detailed_key.yml +46 -0
  20. data/spec/fixtures/dish_cassettes/create_key_default_configuration.yml +46 -0
  21. data/spec/fixtures/dish_cassettes/create_key_new_version.yml +46 -0
  22. data/spec/fixtures/dish_cassettes/create_keys_with_email.yml +46 -0
  23. data/spec/fixtures/dish_cassettes/create_product_default_feature.yml +46 -0
  24. data/spec/fixtures/dish_cassettes/default_search.yml +46 -0
  25. data/spec/fixtures/dish_cassettes/default_search_pagination.yml +46 -0
  26. data/spec/fixtures/dish_cassettes/destroy_feature.yml +46 -0
  27. data/spec/fixtures/dish_cassettes/destroy_key.yml +46 -0
  28. data/spec/fixtures/dish_cassettes/destroy_random_key.yml +47 -0
  29. data/spec/fixtures/dish_cassettes/details_for_a_given_key.yml +46 -0
  30. data/spec/fixtures/dish_cassettes/details_for_a_given_key_with_tags.yml +46 -0
  31. data/spec/fixtures/dish_cassettes/find_keys_by_email.yml +46 -0
  32. data/spec/fixtures/dish_cassettes/id_for_a_given_key.yml +46 -0
  33. data/spec/fixtures/dish_cassettes/remove_tag_for_a_given_key.yml +46 -0
  34. data/spec/fixtures/dish_cassettes/revoke_key.yml +46 -0
  35. data/spec/fixtures/dish_cassettes/set_tags_for_a_given_key.yml +46 -0
  36. data/spec/fixtures/dish_cassettes/unrevoke_key.yml +46 -0
  37. data/spec/fixtures/dish_cassettes/update_custom_feature.yml +46 -0
  38. data/spec/lib/lime_lm/feature_spec.rb +86 -0
  39. data/spec/lib/lime_lm/key_spec.rb +212 -0
  40. data/spec/lib/limelm_spec.rb +37 -0
  41. data/spec/spec_helper.rb +70 -0
  42. metadata +142 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.advancedSearch
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Tue, 03 Mar 2015 16:28:42 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=s9ad7u1vqu5l20dov832rtdlo1; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok","pkeys":{"pages":1,"total":"2","pkey":[{"id":"1","key":"AAA-B","acts":"1","acts_used":"0","version_id":"1","total_deacts":"0","deac_limit":"2","for_tfs":"false","allow_vm":"no"}, {"id":"2","key":"BBB-A","acts":"5","acts_used":"0","version_id":"4","total_deacts":"0","deac_limit":"2","for_tfs":"false","allow_vm":"yes","email":"imberdis.damien@gmail.com"}]}})
44
+ http_version:
45
+ recorded_at: Tue, 03 Mar 2015 16:28:42 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.advancedSearch&num=2&page=3
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Tue, 03 Mar 2015 18:10:26 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=uo82ubjnv0hi03dec8ifmpsug1; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok","pkeys":{"pages":5,"total":"9","pkey":[{"id":"10","key":"CCC","acts":"1","acts_used":"0","version_id":"2","total_deacts":"0","deac_limit":"unlimited","for_tfs":"false","allow_vm":"yes"},{"id":"12","key":"CCC","acts":"1","acts_used":"1","version_id":"2","total_deacts":"0","deac_limit":"1","for_tfs":"false","allow_vm":"yes"}]}})
44
+ http_version:
45
+ recorded_at: Tue, 03 Mar 2015 18:10:26 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&feature_id=3&format=json&method=limelm.feature.delete
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Tue, 03 Mar 2015 20:56:17 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=vu0aecv65ujm1c6evhov3ubn22; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok"})
44
+ http_version:
45
+ recorded_at: Tue, 03 Mar 2015 20:56:16 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.delete&pkey_id=1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Fri, 27 Feb 2015 17:36:02 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=mif5umvq99ahb0ethtj4pscg87; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok"})
44
+ http_version:
45
+ recorded_at: Fri, 27 Feb 2015 17:36:02 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.delete&pkey_id=3
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Fri, 27 Feb 2015 17:43:54 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=ueor686d472t1qevl3bqm8a353; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"fail","code":1,"message":"Invalid pkey_id - product
44
+ key not found."})
45
+ http_version:
46
+ recorded_at: Fri, 27 Feb 2015 17:43:54 GMT
47
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.getDetails&pkey_id=1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Thu, 26 Feb 2015 21:32:58 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=41m920ulhuem0tjep0sdrvlcs2; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok","pkey":{"key":"AAAA-BBBB","acts":"1","acts_used":"0","total_deacts":"0","deac_limit":"unlimited","for_tfs":"false","allow_vm":"yes","email":"imberdis.damien@gmail.com"}})
44
+ http_version:
45
+ recorded_at: Thu, 26 Feb 2015 21:32:58 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.getDetails&pkey_id=1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Fri, 27 Feb 2015 15:16:52 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=9d0aoqpcepfl4e2p9ke1esktk5; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok","pkey":{"key":"AAAA-BBBB","acts":"1","acts_used":"0","total_deacts":"0","deac_limit":"unlimited","for_tfs":"false","allow_vm":"yes","email":"imberdis.damien@gmail.com","tags":{"tag":[{"name":"enterprise"},{"name":"demo"}]}}})
44
+ http_version:
45
+ recorded_at: Fri, 27 Feb 2015 15:16:52 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&email=imberdis.damien@gmail.com&format=json&method=limelm.pkey.find&version_id=1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Thu, 26 Feb 2015 20:19:01 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=0ksgqtgifdu5kto8b3n62v9630; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok","pkeys":{"total":2,"pkey":[{"id":"1","key":"AAAA-BBBB","acts":"1","acts_used":"0"},{"id":"2","key":"AAAA-BBBA","acts":"20","acts_used":"0"}]}})
44
+ http_version:
45
+ recorded_at: Thu, 26 Feb 2015 20:19:00 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.getID&pkey=AAAA-BBBB&version_id=1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Fri, 27 Feb 2015 14:39:26 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=kbtfqutt6jff1b69b592l5ujc7; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok","pkey":{"id":"1"}})
44
+ http_version:
45
+ recorded_at: Fri, 27 Feb 2015 14:39:26 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?api_key=new_key_from_yaml&format=json&method=limelm.pkey.removeTag&pkey_id=1&tag=demo
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Fri, 27 Feb 2015 15:40:39 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=1dbfl9o0kipqrjio9aec6itrb0; path=/
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ X-Frame-Options:
40
+ - SAMEORIGIN
41
+ body:
42
+ encoding: UTF-8
43
+ string: jsonLimeLMApi({"stat":"ok"})
44
+ http_version:
45
+ recorded_at: Fri, 27 Feb 2015 15:40:38 GMT
46
+ recorded_with: VCR 2.9.3