limelm 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 600c6d87ca9354de4c78dcc31776e2cc9f0afd01
4
- data.tar.gz: fed5c40eee968bcfc110383f66fd4c97767b818c
3
+ metadata.gz: c9ebae6551c376099d0b7b01b5819e9f2cdbe3c6
4
+ data.tar.gz: bdd1f70ae0e83426a9948ea11ff922e1d48facad
5
5
  SHA512:
6
- metadata.gz: e181348de4d7f910b8de858e363384dcada7775c22e91541c4813ad5c0f900aede21215ebe1f9df6882928942e73fdd494e4af1b705b65292cffb20ff120d35e
7
- data.tar.gz: a9e453fe128ef39c5cdc378568593a2d7227718938ead006b85e494afe93e2216d589f89bf523ae30c2701dfe711fc2343ef86cf3abf4b50242e7e7cf5b3cd5f
6
+ metadata.gz: b3de3b8a67d9512babefb64cceadd1911140ce4a38beb98ddb75105ecce7a812c8cb831b57159b761f4e4fc97349d6d27b1d88b4998a6760f74cfb0d936653e7
7
+ data.tar.gz: a3a836b550ae12e89dda0054f024c7a97c3614c7abffc03f2a1b9639ac9f6ab575509df5c6a50c689fe68becd595687093042d37ac080d3095c21e0c643e69d6
data/README.md CHANGED
@@ -36,7 +36,6 @@ LimeLm::Key.find('imberdis.damien@gmail.com', version_id: '1')
36
36
 
37
37
  ## API endpoints not developed yet
38
38
  * [deactivate a specific activation](https://wyday.com/limelm/help/api/limelm.pkey.deactivate/)
39
- * [manual offline activation of a key](https://wyday.com/limelm/help/api/limelm.pkey.manualActivation/)
40
39
  * [manual offline deactivation of a key](https://wyday.com/limelm/help/api/limelm.pkey.manualDeactivation/)
41
40
  * [trial extension CRUD operation](https://wyday.com/limelm/help/api/)
42
41
  * [Remove a tag from all product keys](https://wyday.com/limelm/help/api/limelm.tag.delete/)
data/TODO.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # API endpoints not yet implemented
2
2
  * [deactivate a specific activation](https://wyday.com/limelm/help/api/limelm.pkey.deactivate/)
3
- * [manual offline activation of a key](https://wyday.com/limelm/help/api/limelm.pkey.manualActivation/)
4
3
  * [manual offline deactivation of a key](https://wyday.com/limelm/help/api/limelm.pkey.manualDeactivation/)
5
4
  * [trial extension CRUD operation](https://wyday.com/limelm/help/api/)
6
5
  * [Remove a tag from all product keys](https://wyday.com/limelm/help/api/limelm.tag.delete/)
7
-
8
- # Tests
9
- * LimeLm::Key.search: add more tests to cover some optional parameters
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -46,6 +46,11 @@ module LimeLm
46
46
  rescue LimeLm::ApiError => e
47
47
  e.message.include?('109') ? [] : raise(e)
48
48
  end
49
+
50
+ def manual_activation(act_req_content)
51
+ response = LimeLm::Connection.post_json({ method: 'limelm.pkey.manualActivation', act_req_xml: act_req_content})
52
+ response['act_resp_xml']['data']
53
+ end
49
54
  end
50
55
 
51
56
  def id(params={})
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: limelm 0.2.0 ruby lib
5
+ # stub: limelm 0.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "limelm"
9
- s.version = "0.2.0"
9
+ s.version = "0.3.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Damien Imberdis"]
14
- s.date = "2015-04-14"
14
+ s.date = "2015-04-24"
15
15
  s.description = "limelm is a Ruby wrapper for the LimeLM JSON API. LimeLM is a powerfull License and Online Activation Manager"
16
16
  s.email = "imberdis.damien@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -51,16 +51,20 @@ Gem::Specification.new do |s|
51
51
  "spec/fixtures/dish_cassettes/details_for_a_given_key_with_tags.yml",
52
52
  "spec/fixtures/dish_cassettes/find_keys_by_email.yml",
53
53
  "spec/fixtures/dish_cassettes/id_for_a_given_key.yml",
54
+ "spec/fixtures/dish_cassettes/invalid_activation_request.yml",
54
55
  "spec/fixtures/dish_cassettes/no_activity.yml",
55
56
  "spec/fixtures/dish_cassettes/remove_tag_for_a_given_key.yml",
56
57
  "spec/fixtures/dish_cassettes/revoke_key.yml",
57
58
  "spec/fixtures/dish_cassettes/set_tags_for_a_given_key.yml",
58
59
  "spec/fixtures/dish_cassettes/unrevoke_key.yml",
59
60
  "spec/fixtures/dish_cassettes/update_custom_feature.yml",
61
+ "spec/fixtures/dish_cassettes/valid_activation_request.yml",
60
62
  "spec/lib/lime_lm/feature_spec.rb",
61
63
  "spec/lib/lime_lm/key_spec.rb",
62
64
  "spec/lib/limelm_spec.rb",
63
- "spec/spec_helper.rb"
65
+ "spec/spec_helper.rb",
66
+ "spec/support/activation_request_file.xml",
67
+ "spec/support/invalid_activation_request_file.xml"
64
68
  ]
65
69
  s.homepage = "http://github.com/dam/limelm"
66
70
  s.licenses = ["MIT"]
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://wyday.com/limelm/api/rest?act_req_xml=%3Chello%3E%0A%3C/hello%3E&api_key=18pg92054ecbfc9215588.24249951&format=json&method=limelm.pkey.manualActivation
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, 24 Apr 2015 19:04:39 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=b8l87d7vstrgossogfbekr7j76; 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":103,"message":"Product version id
44
+ is invalid."})
45
+ http_version:
46
+ recorded_at: Fri, 24 Apr 2015 19:04:39 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?act_req_xml=valid_content&api_key=new_key_from_yaml&format=json&method=limelm.pkey.manualActivation
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, 24 Apr 2015 18:15:18 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - PHPSESSID=9bpj263rrsvhms13r06ju43ia2; 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","act_resp_xml":{"data":"valid response"}})
44
+ http_version:
45
+ recorded_at: Fri, 24 Apr 2015 18:15:18 GMT
46
+ recorded_with: VCR 2.9.3
@@ -229,4 +229,23 @@ describe LimeLm::Key do
229
229
  end
230
230
  end
231
231
  end
232
+
233
+ describe '.manual_activation' do
234
+ it 'returns an error if the activation request is invalid' do
235
+ VCR.use_cassette("invalid_activation_request", match_requests_on: [:path]) do
236
+ file_path = File.expand_path('../../../support/invalid_activation_request_file.xml', __FILE__)
237
+ unvalid_content = File.open(file_path, 'r').read
238
+ assert_raises(LimeLm::ApiError) { LimeLm::Key.manual_activation(unvalid_content) }
239
+ end
240
+ end
241
+
242
+ it 'returns the offline activation response content in case of success' do
243
+ VCR.use_cassette("valid_activation_request", match_requests_on: [:path]) do
244
+ file_path = File.expand_path('../../../support/activation_request_file.xml', __FILE__)
245
+ valid_content = File.open(file_path, 'r').read
246
+ result = LimeLm::Key.manual_activation(valid_content)
247
+ assert result.is_a?(String)
248
+ end
249
+ end
250
+ end
232
251
  end
@@ -0,0 +1 @@
1
+ valid content
@@ -0,0 +1,2 @@
1
+ <hello>
2
+ </hello>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limelm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Imberdis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -107,16 +107,20 @@ files:
107
107
  - spec/fixtures/dish_cassettes/details_for_a_given_key_with_tags.yml
108
108
  - spec/fixtures/dish_cassettes/find_keys_by_email.yml
109
109
  - spec/fixtures/dish_cassettes/id_for_a_given_key.yml
110
+ - spec/fixtures/dish_cassettes/invalid_activation_request.yml
110
111
  - spec/fixtures/dish_cassettes/no_activity.yml
111
112
  - spec/fixtures/dish_cassettes/remove_tag_for_a_given_key.yml
112
113
  - spec/fixtures/dish_cassettes/revoke_key.yml
113
114
  - spec/fixtures/dish_cassettes/set_tags_for_a_given_key.yml
114
115
  - spec/fixtures/dish_cassettes/unrevoke_key.yml
115
116
  - spec/fixtures/dish_cassettes/update_custom_feature.yml
117
+ - spec/fixtures/dish_cassettes/valid_activation_request.yml
116
118
  - spec/lib/lime_lm/feature_spec.rb
117
119
  - spec/lib/lime_lm/key_spec.rb
118
120
  - spec/lib/limelm_spec.rb
119
121
  - spec/spec_helper.rb
122
+ - spec/support/activation_request_file.xml
123
+ - spec/support/invalid_activation_request_file.xml
120
124
  homepage: http://github.com/dam/limelm
121
125
  licenses:
122
126
  - MIT