ruby-jss 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-jss might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fd7571a4225c7255724e6de59c0fb44e6bd595b
4
- data.tar.gz: fb5de557c051ae61c7993db97590195b76fa6a30
3
+ metadata.gz: 2b8d799a470de3b5cb8dc73ecdc222cee1cad4cf
4
+ data.tar.gz: 815e00bb5c56346df7313b72801d7f49d2758dd6
5
5
  SHA512:
6
- metadata.gz: f8ca00b8718f58bad9529b5742964c8c0c19dcfb145ed97ad30e4b2c9b9ff69fcab44fa09fe32207671c56bafd181e0c3d10d1dbcba30f599b11471ba8a4002a
7
- data.tar.gz: 8ee7f5f01cf030dd356210e52f69b5cbcc0e231736412b0678755f6fc2ddc667d7bf47bb4c1694e8b70fa6eb234b3e41bc00a2fd2b92a7128a83396d0a65b79c
6
+ metadata.gz: aa5520456bc37cf2d23f8029b5b5dbfdd2092f9b1df4a5316d316022a3ed833209153e35743dc1dcc199a9981cf471041016b2bde79c3e38b245238d8f85939c
7
+ data.tar.gz: f454ec87777ab6c3541ccd4e1b9d4c9768462eab560bc8f6e7dcb8d64c84110ad16dfd9b260dcff6f8dbe586408559c3b0145a264899b12fd3061d2c1053f9e8
data/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change History
2
2
 
3
+ ## v 0.13.0, 2018-05-30
4
+
5
+ - Update: Now requires rest-client gem v2.0 and up, and ruby v 2.0.0 and up. Thanks to HIMANSHU-ELIGIBLE @ github for catching & fixing this one.
6
+
7
+ - Fix: a few minor bugs in JSS::Criteriable::Criterion
8
+
3
9
  ## v 0.12.0, 2018-04-16
4
10
 
5
11
  - Simplification: when building .pkg's with JSS::Composer.mk_pkg, only two params are related to Package Signing: 'signing_identity:' the name of the signing identity to use, and and 'signing_options:' a string of all other signing-related CLI options that will be passed to the pkgbuild command, e.g. keychain locations, timestamps, certs, etc. For details, see `man pkgbuild`
@@ -25,6 +25,7 @@
25
25
 
26
26
  ###
27
27
  module JSS
28
+
28
29
  module Criteriable
29
30
 
30
31
  #####################################
@@ -61,7 +62,7 @@ module JSS
61
62
  #####################################
62
63
 
63
64
  ### Criterion instances we maintain need these attributes.s
64
- CRITERION_ATTRIBUTES = [:priority, :and_or, :name, :search_type, :value]
65
+ CRITERION_ATTRIBUTES = [:priority, :and_or, :name, :search_type, :value].freeze
65
66
 
66
67
  #####################################
67
68
  ### Attributes
@@ -94,10 +95,10 @@ module JSS
94
95
  ### @return [void]
95
96
  ###
96
97
  def criteria= (new_criteria)
97
- unless new_criteria.is_a?(Array) && new_criteria.reject{ |c| c.is_a?(JSS::Criteriable::Criterion) }.empty?
98
- raise JSS::InvalidDataError, "Argument must be an Array of JSS::Criteriable::Criterion instances."
98
+ unless new_criteria.is_a?(Array) && new_criteria.reject { |c| c.is_a?(JSS::Criteriable::Criterion) }.empty?
99
+ raise JSS::InvalidDataError, 'Argument must be an Array of JSS::Criteriable::Criterion instances.'
99
100
  end
100
- new_criteria.each{ |nc| criterion_ok? nc }
101
+ new_criteria.each { |nc| criterion_ok? nc }
101
102
  @criteria = new_criteria
102
103
  set_priorities
103
104
  @container.should_update if @container
@@ -188,7 +189,7 @@ module JSS
188
189
  ### @return [void]
189
190
  ###
190
191
  def set_priorities
191
- @criteria.each_index{ |ci| @criteria[ci].priority = ci }
192
+ @criteria.each_index { |ci| @criteria[ci].priority = ci }
192
193
  end
193
194
 
194
195
  ###
@@ -202,15 +203,14 @@ module JSS
202
203
  raise JSS::MissingDataError, "Criteria can't be empty" if @criteria.empty?
203
204
  cr = REXML::Element.new 'criteria'
204
205
  @criteria.each { |c| cr << c.rest_xml }
205
- return cr
206
- end # rest_xml
206
+ cr
207
+ end # rest_xml
207
208
 
208
209
  #####################################
209
210
  ### Private Instance Methods
210
211
  #####################################
211
212
  private
212
213
 
213
-
214
214
  ###
215
215
  ### Chech the validity of a criterion.
216
216
  ### Note that this doesn't check the :priority
@@ -218,15 +218,17 @@ module JSS
218
218
  ###
219
219
  ### Return true or raise an error about the problem
220
220
  ###
221
- def criterion_ok? (criterion)
222
- raise JSS::InvalidDataError, "Duplicate criterion: #{criterion.signature.join(', ')}" if @criteria.select{|c| c == criterion}.count > 1
223
- raise JSS::InvalidDataError, "Missing :and_or for criterion: #{criterion.signature.join(', ')}" unless criterion.and_or
224
- raise JSS::InvalidDataError, "Missing :name for criterion: #{criterion.signature.join(', ')}" unless criterion.name
225
- raise JSS::InvalidDataError, "Missing :search_type for criterion: #{criterion.signature.join(', ')}" unless criterion.search_type
226
- raise JSS::InvalidDataError, "Missing :value for criterion: #{criterion.signature.join(', ')}" unless criterion.value
221
+ def criterion_ok?(criterion)
222
+ raise JSS::InvalidDataError, "Duplicate criterion: #{criterion.signature}" if @criteria.select { |c| c == criterion }.count > 1
223
+ raise JSS::InvalidDataError, "Missing :and_or for criterion: #{criterion.signature}" unless criterion.and_or
224
+ raise JSS::InvalidDataError, "Missing :name for criterion: #{criterion.signature}" unless criterion.name
225
+ raise JSS::InvalidDataError, "Missing :search_type for criterion: #{criterion.signature}" unless criterion.search_type
226
+ raise JSS::InvalidDataError, "Missing :value for criterion: #{criterion.signature}" unless criterion.value
227
227
  true
228
228
  end
229
229
 
230
230
  end # class Criteria
231
+
231
232
  end # module Criteriable
233
+
232
234
  end # module
@@ -123,10 +123,8 @@ module JSS
123
123
 
124
124
  @priority = args[:priority]
125
125
 
126
- if args[:and_or]
127
- @and_or = args[:and_or].to_sym
128
- raise JSS::InvalidDataError, ":and_or must be 'and' or 'or'." unless AND_OR.include? @and_or
129
- end
126
+ @and_or = (args[:and_or].downcase.to_sym if args[:and_or]) || :and
127
+ raise JSS::InvalidDataError, ":and_or must be 'and' or 'or'." unless AND_OR.include? @and_or
130
128
 
131
129
  @name = args[:name]
132
130
 
data/lib/jss/version.rb CHANGED
@@ -27,6 +27,6 @@
27
27
  module JSS
28
28
 
29
29
  ### The version of the JSS ruby gem
30
- VERSION = '0.12.0'.freeze
30
+ VERSION = '0.13.0'.freeze
31
31
 
32
32
  end # module
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lasell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-18 00:00:00.000000000 Z
12
+ date: 2018-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: plist
@@ -51,20 +51,14 @@ dependencies:
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.7'
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 1.7.2
54
+ version: '2.0'
58
55
  type: :runtime
59
56
  prerelease: false
60
57
  version_requirements: !ruby/object:Gem::Requirement
61
58
  requirements:
62
59
  - - "~>"
63
60
  - !ruby/object:Gem::Version
64
- version: '1.7'
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: 1.7.2
61
+ version: '2.0'
68
62
  - !ruby/object:Gem::Dependency
69
63
  name: net-ldap
70
64
  requirement: !ruby/object:Gem::Requirement
@@ -264,7 +258,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
258
  requirements:
265
259
  - - ">="
266
260
  - !ruby/object:Gem::Version
267
- version: 1.9.3
261
+ version: 2.0.0
268
262
  required_rubygems_version: !ruby/object:Gem::Requirement
269
263
  requirements:
270
264
  - - ">="