metasploit-model 0.29.0-java → 0.29.2-java

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: d6fd8588b44d2db517e862dfcc6a992e67ed7911
4
- data.tar.gz: eff2999cb386b96f608c4f8223890e48bc2767a2
3
+ metadata.gz: b150c41b2ca68b5d851bf1861493f2b53e5d0d1d
4
+ data.tar.gz: 66cceb2757470aa2e26efcdb41d8cd0d665212f7
5
5
  SHA512:
6
- metadata.gz: 5b0cb8525e65fdc000f439b28dc12bace602b07278d5345ee91c34c16692caa462bfa35b95c809dc4a52680e7793f0b3e740ffdf4943c3bb8b31b6ffea149884
7
- data.tar.gz: f23fc173b6e153b39fa537b488dcc1345521c92e9bd350118f760e6b0e5e4698a39e58ce9280f6cea4bfb08ff1a8ca076c3072c4cf7a05afe7ead7dd002245fb
6
+ metadata.gz: 4a270f0baf6f4763df5ac967078687d648bb4acdb48e03d7bd16c945feadd188d8a682e2ff7fdf6f741a6754dba1450b4429c3c6d16f66abd0f11443678459e3
7
+ data.tar.gz: 47d3cde65dd04c7569f9783ce0f2ec9cd4c92a8a4e4118195550ca63fb7686a858d8c92342f703a65526eb96d4a2135275520d329ffef36e940a1e2c45677f77
data/.simplecov CHANGED
@@ -7,7 +7,7 @@ unless ENV['RM_INFO']
7
7
  end
8
8
 
9
9
  SimpleCov.configure do
10
- load_adapter('rails')
10
+ load_profile('rails')
11
11
 
12
12
  # ignore this file
13
13
  add_filter '.simplecov'
data/.travis.yml CHANGED
@@ -1,8 +1,6 @@
1
1
  cache: bundler
2
2
  language: ruby
3
3
  rvm:
4
- - '1.9.3'
5
- - '2.0'
6
4
  - '2.1'
7
5
  # < 1.7.14
8
6
  - 'jruby-1.7.13'
data/CONTRIBUTING.md CHANGED
@@ -148,7 +148,7 @@ If your changes are incompatible with the previous branch's API, then increment
148
148
  - [ ] `rake release`
149
149
 
150
150
  ## MRI Ruby
151
- - [ ] `rvm use ruby-1.9.3@metasploit-model`
151
+ - [ ] `rvm use ruby-2.1@metasploit-model`
152
152
  - [ ] `rm Gemfile.lock`
153
153
  - [ ] `bundle install`
154
154
  - [ ] `rake release`
@@ -6,8 +6,8 @@ module Metasploit
6
6
  MAJOR = 0
7
7
  # The minor version number, scoped to the {MAJOR} version number.
8
8
  MINOR = 29
9
- # The patch number, scoped to the {MINOR} version number.
10
- PATCH = 0
9
+ # The patch number, scoped to the {MAJOR} and {MINOR} version numbers.
10
+ PATCH = 2
11
11
 
12
12
  # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
13
13
  # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
@@ -16,6 +16,8 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = %w{app/models app/validators lib}
18
18
 
19
+ spec.required_ruby_version = '>= 2.1'
20
+
19
21
  spec.add_development_dependency 'bundler', '~> 1.3'
20
22
  spec.add_development_dependency 'rake'
21
23
 
@@ -6,8 +6,8 @@ Dummy::Application.configure do
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+
10
+ config.eager_load = false
11
11
 
12
12
  # Show full error reports and disable caching
13
13
  config.consider_all_requests_local = true
@@ -4,6 +4,8 @@ Dummy::Application.configure do
4
4
  # Code is not reloaded between requests
5
5
  config.cache_classes = true
6
6
 
7
+ config.eager_load = true
8
+
7
9
  # Full error reports are disabled and caching is turned on
8
10
  config.consider_all_requests_local = false
9
11
  config.action_controller.perform_caching = true
@@ -7,12 +7,12 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
+ config.eager_load = true
11
+
10
12
  # Configure static asset server for tests with Cache-Control for performance
11
13
  config.serve_static_assets = true
12
14
  config.static_cache_control = "public, max-age=3600"
13
15
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
16
 
17
17
  # Show full error reports and disable caching
18
18
  config.consider_all_requests_local = true
@@ -0,0 +1,82 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe 'validate_nilness_of' do
4
+ let(:record) {
5
+ record_class.new
6
+ }
7
+
8
+ context 'a model with a nil validation' do
9
+ let(:attribute) {
10
+ :nil_thing
11
+ }
12
+
13
+ let(:record_class) {
14
+ # capture attribute for Class.new scope
15
+ attribute = self.attribute
16
+
17
+ Class.new do
18
+ include ActiveModel::Validations
19
+
20
+ #
21
+ # Attributes
22
+ #
23
+
24
+ attr_accessor attribute
25
+
26
+ #
27
+ # Validations
28
+ #
29
+
30
+ validates attribute,
31
+ nil: true
32
+ end
33
+ }
34
+
35
+ it 'accepts' do
36
+ expect(record).to validate_nilness_of(attribute)
37
+ end
38
+
39
+ it 'provides correct error message when negated' do
40
+ expect {
41
+ expect(record).not_to validate_nilness_of(attribute)
42
+ }.to raise_error(
43
+ RSpec::Expectations::ExpectationNotMetError,
44
+ "Expected errors not to include 'must be nil' when #{attribute} is set"
45
+ )
46
+ end
47
+ end
48
+
49
+ context 'a model without a nil validation' do
50
+ let(:attribute) {
51
+ :non_nil_thing
52
+ }
53
+
54
+ let(:record_class) {
55
+ # capture attribute for Class.new scope
56
+ attribute = self.attribute
57
+
58
+ Class.new do
59
+ include ActiveModel::Validations
60
+
61
+ #
62
+ # Attributes
63
+ #
64
+
65
+ attr_accessor attribute
66
+ end
67
+ }
68
+
69
+ it 'rejects' do
70
+ expect(record).not_to validate_nilness_of(attribute)
71
+ end
72
+
73
+ it 'provides the correct failure message' do
74
+ expect {
75
+ expect(record).to validate_nilness_of(attribute)
76
+ }.to raise_error(
77
+ RSpec::Expectations::ExpectationNotMetError,
78
+ "Expected errors to include 'must be nil' when #{attribute} is set to an arbitrary string"
79
+ )
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,46 @@
1
+ RSpec::Matchers.define :validate_nilness_of do |attribute|
2
+ description do
3
+ "require nil for #{attribute}"
4
+ end
5
+
6
+ failure_message_method = :failure_message_for_should
7
+
8
+ # RSpec compatibility without deprecation warnings
9
+ if respond_to?(:failure_message)
10
+ failure_message_method = :failure_message
11
+ end
12
+
13
+ send(failure_message_method) do |instance|
14
+ "Expected errors to include 'must be nil' when #{attribute} is set to an arbitrary string"
15
+ end
16
+
17
+ failure_message_when_negated_method = :failure_message_for_should_not
18
+
19
+ # RSpec compatibility without deprecation warnings
20
+ if respond_to?(:failure_message_when_negated)
21
+ failure_message_when_negated_method = :failure_message_when_negated
22
+ end
23
+
24
+ send(failure_message_when_negated_method) do |instance|
25
+ "Expected errors not to include 'must be nil' when #{attribute} is set"
26
+ end
27
+
28
+ match do |instance|
29
+ writer = :"#{attribute}="
30
+ instance.send(writer, nil)
31
+ instance.valid?
32
+ allow_nil = instance.errors[attribute].empty?
33
+
34
+ empty = ''
35
+ instance.send(writer, empty)
36
+ instance.valid?
37
+ disallow_empty = instance.errors[attribute].include?('must be nil')
38
+
39
+ present = 'present'
40
+ instance.send(writer, present)
41
+ instance.valid?
42
+ disallow_present = instance.errors[attribute].include?('must be nil')
43
+
44
+ allow_nil && disallow_empty && disallow_present
45
+ end
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.29.2
5
5
  platform: java
6
6
  authors:
7
7
  - Luke Imhoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -284,7 +284,10 @@ files:
284
284
  - spec/lib/metasploit/model/translation_spec.rb
285
285
  - spec/lib/metasploit/model/version_spec.rb
286
286
  - spec/lib/metasploit/model/visitation/visit_spec.rb
287
+ - spec/matchers/validate_nilness_of_spec.rb
287
288
  - spec/spec_helper.rb
289
+ - spec/support/matchers/allow_attribute.rb
290
+ - spec/support/matchers/validate_nilness_of.rb
288
291
  - spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb
289
292
  - spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb
290
293
  - spec/support/shared/examples/metasploit/model/search/operation/value/string.rb
@@ -294,7 +297,6 @@ files:
294
297
  - spec/support/shared/examples/search_association.rb
295
298
  - spec/support/shared/examples/search_attribute.rb
296
299
  - spec/support/shared/examples/search_with.rb
297
- - spec/support/shared/matchers/allow_attribute.rb
298
300
  homepage:
299
301
  licenses: []
300
302
  metadata: {}
@@ -308,7 +310,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
308
310
  requirements:
309
311
  - - '>='
310
312
  - !ruby/object:Gem::Version
311
- version: '0'
313
+ version: '2.1'
312
314
  required_rubygems_version: !ruby/object:Gem::Requirement
313
315
  requirements:
314
316
  - - '>='
@@ -316,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
318
  version: '0'
317
319
  requirements: []
318
320
  rubyforge_project:
319
- rubygems_version: 2.1.9
321
+ rubygems_version: 2.2.2
320
322
  signing_key:
321
323
  specification_version: 4
322
324
  summary: Metasploit Model Mixins and Validators
@@ -413,7 +415,10 @@ test_files:
413
415
  - spec/lib/metasploit/model/translation_spec.rb
414
416
  - spec/lib/metasploit/model/version_spec.rb
415
417
  - spec/lib/metasploit/model/visitation/visit_spec.rb
418
+ - spec/matchers/validate_nilness_of_spec.rb
416
419
  - spec/spec_helper.rb
420
+ - spec/support/matchers/allow_attribute.rb
421
+ - spec/support/matchers/validate_nilness_of.rb
417
422
  - spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb
418
423
  - spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb
419
424
  - spec/support/shared/examples/metasploit/model/search/operation/value/string.rb
@@ -423,5 +428,4 @@ test_files:
423
428
  - spec/support/shared/examples/search_association.rb
424
429
  - spec/support/shared/examples/search_attribute.rb
425
430
  - spec/support/shared/examples/search_with.rb
426
- - spec/support/shared/matchers/allow_attribute.rb
427
431
  has_rdoc: