killbill-client 0.14.0 → 0.15.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48cdaec43be15b9b60a9f514d96410c2e1e680e0
4
- data.tar.gz: 77718ed5919682cbbd05215f23977132ff659a98
3
+ metadata.gz: 387b8be2ba133da76bc8ec821c2daac5698472da
4
+ data.tar.gz: 059c9a722277434e4fe97e367c6e3c61cff6e014
5
5
  SHA512:
6
- metadata.gz: 5e6ac6d1723ae4845e4e56af7c13c783d06665fe8a16c19082b2f39142b38edd9bdd8a2c6e7ceb05e049d5286aa1abc727027f860d57566f0a773b237895b1c9
7
- data.tar.gz: ec0d266d12ca09c07de46fe96788b17e62deec948eb6e42e35bb5404c44d033a7f3435ef1c05522048b072bfd6553001346da33f19c385f140fbc69ee140a759
6
+ metadata.gz: 2f6a28af56caa4cd8cd67079d8d5e7af482ba45d25de207914a3e78992973bb4fee062e454aafbdcf30b97735cc7bbe0997034009c2039039cf7a7a2244cc352
7
+ data.tar.gz: 7f9bdaab2f87fc4c8773b2123b0ccbcb40aea7d5e1f130a246252f62c59bae4f768c4b8a42b60950db332bff80c744f1cd645934e61c54734d5b37a57071705b
data/README.md CHANGED
@@ -11,7 +11,7 @@ Examples
11
11
 
12
12
  The following script will tag a list of accounts with OVERDUE_ENFORCEMENT_OFF and AUTO_PAY_OFF:
13
13
 
14
- ```
14
+ ```ruby
15
15
  require 'killbill_client'
16
16
 
17
17
  KillBillClient.url = 'http://127.0.0.1:8080'
@@ -34,7 +34,7 @@ Tests
34
34
 
35
35
  To run the integration tests:
36
36
 
37
- ```
37
+ ```bash
38
38
  rake test:remote:spec
39
39
  ```
40
40
 
@@ -110,7 +110,7 @@ module KillBillClient
110
110
  end
111
111
 
112
112
  def auto_pay_off?(options = {})
113
- control_tag_off?(AUTO_PAY_OFF_ID, options)
113
+ control_tag?(AUTO_PAY_OFF_ID, options)
114
114
  end
115
115
 
116
116
  def set_auto_pay_off(user = nil, reason = nil, comment = nil, options = {})
@@ -118,11 +118,11 @@ module KillBillClient
118
118
  end
119
119
 
120
120
  def remove_auto_pay_off(user = nil, reason = nil, comment = nil, options = {})
121
- remove_tag_from_definition_id(AUTO_PAY_OFF_ID.id, user, reason, comment, options)
121
+ remove_tag_from_definition_id(AUTO_PAY_OFF_ID, user, reason, comment, options)
122
122
  end
123
123
 
124
124
  def auto_invoicing_off?(options = {})
125
- control_tag_off?(AUTO_INVOICING_OFF_ID, options)
125
+ control_tag?(AUTO_INVOICING_OFF_ID, options)
126
126
  end
127
127
 
128
128
  def set_auto_invoicing_off(user = nil, reason = nil, comment = nil, options = {})
@@ -134,7 +134,7 @@ module KillBillClient
134
134
  end
135
135
 
136
136
  def overdue_enforcement_off?(options = {})
137
- control_tag_off?(OVERDUE_ENFORCEMENT_OFF_ID, options)
137
+ control_tag?(OVERDUE_ENFORCEMENT_OFF_ID, options)
138
138
  end
139
139
 
140
140
  def set_overdue_enforcement_off(user = nil, reason = nil, comment = nil, options = {})
@@ -146,7 +146,7 @@ module KillBillClient
146
146
  end
147
147
 
148
148
  def written_off?(options = {})
149
- control_tag_off?(WRITTEN_OFF_ID, options)
149
+ control_tag?(WRITTEN_OFF_ID, options)
150
150
  end
151
151
 
152
152
  def set_written_off(user = nil, reason = nil, comment = nil, options = {})
@@ -158,7 +158,7 @@ module KillBillClient
158
158
  end
159
159
 
160
160
  def manual_pay?(options = {})
161
- control_tag_off?(MANUAL_PAY_ID, options)
161
+ control_tag?(MANUAL_PAY_ID, options)
162
162
  end
163
163
 
164
164
  def set_manual_pay(user = nil, reason = nil, comment = nil, options = {})
@@ -170,7 +170,7 @@ module KillBillClient
170
170
  end
171
171
 
172
172
  def test?(options = {})
173
- control_tag_off?(TEST_ID, options)
173
+ control_tag?(TEST_ID, options)
174
174
  end
175
175
 
176
176
  def set_test(user = nil, reason = nil, comment = nil, options = {})
@@ -31,20 +31,11 @@ module KillBillClient
31
31
  def set_tags(tag_definition_ids, user = nil, reason = nil, comment = nil, options = {})
32
32
  current_tag_definition_ids = tags(false, 'NONE', options).map { |tag| tag.tag_definition_id }
33
33
 
34
- # Find tags to remove
35
- tags_to_remove = Set.new
36
- current_tag_definition_ids.each do |current_tag_definition_id|
37
- tags_to_remove << current_tag_definition_id unless tag_definition_ids.include?(current_tag_definition_id)
38
- end
39
-
40
- # Find tags to add
41
- tags_to_add = Set.new
42
- tag_definition_ids.each do |new_tag_definition_id|
43
- tags_to_add << new_tag_definition_id unless current_tag_definition_ids.include?(new_tag_definition_id)
44
- end
34
+ tags_to_remove = current_tag_definition_ids - tag_definition_ids
35
+ tags_to_add = tag_definition_ids - current_tag_definition_ids
45
36
 
46
- remove_tags_from_definition_ids(tags_to_remove.to_a, user, reason, comment, options) unless tags_to_remove.empty?
47
- add_tags_from_definition_ids(tags_to_add.to_a, user, reason, comment, options) unless tags_to_add.empty?
37
+ remove_tags_from_definition_ids(tags_to_remove.uniq, user, reason, comment, options) unless tags_to_remove.empty?
38
+ add_tags_from_definition_ids(tags_to_add.uniq, user, reason, comment, options) unless tags_to_add.empty?
48
39
  end
49
40
 
50
41
  def add_tag_from_definition_id(tag_definition_id, user = nil, reason = nil, comment = nil, options = {})
@@ -55,11 +46,10 @@ module KillBillClient
55
46
  remove_tags_from_definition_ids([tag_definition_id], user, reason, comment, options)
56
47
  end
57
48
 
58
- def control_tag_off?(control_tag_definition_id, options)
59
- res = tags('NONE', options)
60
- !((res || []).select do |t|
49
+ def control_tag?(control_tag_definition_id, options)
50
+ tags(false, 'NONE', options).any? do |t|
61
51
  t.tag_definition_id == control_tag_definition_id
62
- end.first.nil?)
52
+ end
63
53
  end
64
54
 
65
55
  module ClassMethods
@@ -2,6 +2,7 @@ module KillBillClient
2
2
  module Model
3
3
  class PaymentMethod < PaymentMethodAttributes
4
4
  KILLBILL_API_PAYMENT_METHODS_PREFIX = "#{KILLBILL_API_PREFIX}/paymentMethods"
5
+ EXTERNAL_PAYMENT = '__EXTERNAL_PAYMENT__'.freeze
5
6
 
6
7
  has_many :audit_logs, KillBillClient::Model::AuditLog
7
8
 
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 14
4
+ MINOR = 15
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
@@ -94,7 +94,7 @@ describe KillBillClient::Model do
94
94
  pm = KillBillClient::Model::PaymentMethod.new
95
95
  pm.account_id = account.account_id
96
96
  pm.is_default = true
97
- pm.plugin_name = '__EXTERNAL_PAYMENT__'
97
+ pm.plugin_name = KillBillClient::Model::PaymentMethod::EXTERNAL_PAYMENT
98
98
  pm.plugin_info = {}
99
99
  pm.payment_method_id.should be_nil
100
100
 
metadata CHANGED
@@ -1,65 +1,65 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.2.0
20
- requirement: !ruby/object:Gem::Requirement
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
21
23
  requirements:
22
- - - '>='
24
+ - - ">="
23
25
  - !ruby/object:Gem::Version
24
26
  version: 1.2.0
25
- prerelease: false
26
- type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 10.0.0
34
- requirement: !ruby/object:Gem::Requirement
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
35
37
  requirements:
36
- - - '>='
38
+ - - ">="
37
39
  - !ruby/object:Gem::Version
38
40
  version: 10.0.0
39
- prerelease: false
40
- type: :development
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
- version_requirements: !ruby/object:Gem::Requirement
43
+ requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.12.0
48
- requirement: !ruby/object:Gem::Requirement
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
49
51
  requirements:
50
- - - ~>
52
+ - - "~>"
51
53
  - !ruby/object:Gem::Version
52
54
  version: 2.12.0
53
- prerelease: false
54
- type: :development
55
55
  description: An API client library for Kill Bill.
56
56
  email: killbilling-users@googlegroups.com
57
57
  executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
- - .gitignore
62
- - .travis.yml
61
+ - ".gitignore"
62
+ - ".travis.yml"
63
63
  - Gemfile
64
64
  - README.md
65
65
  - Rakefile
@@ -167,26 +167,32 @@ homepage: http://www.killbilling.org
167
167
  licenses:
168
168
  - Apache License (2.0)
169
169
  metadata: {}
170
- post_install_message:
170
+ post_install_message:
171
171
  rdoc_options:
172
- - --exclude
173
- - .
172
+ - "--exclude"
173
+ - "."
174
174
  require_paths:
175
175
  - lib
176
176
  required_ruby_version: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: 1.8.6
181
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - '>='
183
+ - - ">="
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubyforge_project:
188
- rubygems_version: 2.1.9
189
- signing_key:
187
+ rubyforge_project:
188
+ rubygems_version: 2.4.6
189
+ signing_key:
190
190
  specification_version: 4
191
191
  summary: Kill Bill client library.
192
- test_files: []
192
+ test_files:
193
+ - spec/killbill_client/model_relation_spec.rb
194
+ - spec/killbill_client/remote/api_spec.rb
195
+ - spec/killbill_client/remote/model_spec.rb
196
+ - spec/killbill_client/resource_spec.rb
197
+ - spec/killbill_client/resources_spec.rb
198
+ - spec/spec_helper.rb