metasploit-model 0.30.1-java → 0.30.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: 11a2997b51e66fb84f748536e612342a3306b6f3
4
- data.tar.gz: 08731750d71bc4b661cc30947c963cee82264576
3
+ metadata.gz: 71dbfade9bc3dadcb2cddebb038dad178105d8cf
4
+ data.tar.gz: 97503a66392d5bef40f9464040a5a3beb22bbf52
5
5
  SHA512:
6
- metadata.gz: afbab2bd870f0468a376afc36634d5da4c3de86b836d1d7ea4fa1d3bc9e841dfe062c90f5c49f3483975263d6dd5710cc16592ba42cbf2ae99f66bd3cf7aa0f1
7
- data.tar.gz: 7ffb17ef74e9832b31aede6a6e70a78fd7ffd010d0af8123e887b65e1d3f6df0264de69089456754c4c88f7be58887df5d8cca8171a4c40e34c323f20f9cd977
6
+ metadata.gz: a0facbd5978eeab0ad10c468441c302946283d8ff6c727ed7494d2ecac5a4e8c5f5e299af71ddafc4c4c10df3b6fc409f0a62f7628af5d85723590649395d86d
7
+ data.tar.gz: 877eae203836cfd0a220cabc2ee8bfd0e4e67143c198aac84497bbec64b9cee6a5c90029d1da2c5220861f48a05c6ba96c89e39a2e810976f287daebeef1e08e
@@ -0,0 +1,6 @@
1
+ # Next Release
2
+
3
+ * Enhancements
4
+ * Bug Fixes
5
+ * Deprecations
6
+ * Incompatible Changes
@@ -25,19 +25,18 @@ issue tracking software.
25
25
 
26
26
  ### `PRERELEASE`
27
27
 
28
- 1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/model/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
28
+ 1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/model/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
29
29
  ```
30
- # The prerelease version, scoped to the {PATCH} version number.
30
+ # The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version number.
31
31
  PRERELEASE = '<SUMMARY>'
32
32
  ```
33
33
  2. `rake spec`
34
34
  3. Verify the specs pass, which indicates that `PRERELEASE` was updated correctly.
35
35
  4. Commit the change `git commit -a`
36
36
 
37
-
38
37
  ### Your changes
39
38
 
40
- Make your changes or however many commits you like, commiting each with `git commit`.
39
+ Make your changes or however many commits you like, committing each with `git commit`.
41
40
 
42
41
  ### Pre-Pull Request Testing
43
42
 
@@ -46,12 +45,12 @@ Make your changes or however many commits you like, commiting each with `git com
46
45
 
47
46
  ### Push
48
47
 
49
- Push your branch to your fork on gitub: `git push push TYPE/ISSUE/SUMMARY`
48
+ Push your branch to your fork on github: `git push TYPE/ISSUE/SUMMARY`
50
49
 
51
50
  ### Pull Request
52
51
 
53
52
  * [Create new Pull Request](https://github.com/rapid7/metasploit-model/compare/)
54
- * Add a Verification Steps comment
53
+ * Add a Verification Steps to the description comment
55
54
 
56
55
  ```
57
56
  # Verification Steps
@@ -62,6 +61,7 @@ Push your branch to your fork on gitub: `git push push TYPE/ISSUE/SUMMARY`
62
61
  - [ ] `rake spec`
63
62
  - [ ] VERIFY no failures
64
63
  ```
64
+
65
65
  You should also include at least one scenario to manually check the changes outside of specs.
66
66
 
67
67
  * Add a Post-merge Steps comment
@@ -106,7 +106,7 @@ Perform these steps prior to pushing to DESTINATION or the build will be broke o
106
106
  - [ ] Change `PRERELEASE` from `SOURCE_SUMMARY` to `DESTINATION_SUMMARY` to match the branch (DESTINATION) summary (DESTINATION_SUMMARY)
107
107
 
108
108
  ## Gem build
109
- - [ ] gem build *.gemspec
109
+ - [ ] gem build metasploit-model.gemspec
110
110
  - [ ] VERIFY the prerelease suffix has change on the gem.
111
111
 
112
112
  ## RSpec
@@ -118,45 +118,5 @@ Perform these steps prior to pushing to DESTINATION or the build will be broke o
118
118
  - [ ] `git push origin DESTINATION`
119
119
  ```
120
120
 
121
- * Add a 'Release Steps' comment
122
-
123
- The 'Release Steps' are a reminder to the reviewer of the Pull Request of how to release the gem.
124
-
125
- ```
126
- # Release
127
-
128
- Complete these steps on DESTINATION
129
-
130
- ## Version
131
-
132
- ### Compatible changes
133
-
134
- If the change are compatible with the previous branch's API, then increment [`PATCH`](lib/metasploit/model/version.rb).
135
-
136
- ### Incompatible changes
137
-
138
- If your changes are incompatible with the previous branch's API, then increment
139
- [`MINOR`](lib/metasploit/model/version.rb) and reset [`PATCH`](lib/metasploit/model/version.rb) to `0`.
140
-
141
- - [ ] Following the rules for [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html), update
142
- [`MINOR`](lib/metasploit/model/version.rb) and [`PATCH`](lib/metasploit/model/version.rb) and commit the changes.
143
-
144
- ## JRuby
145
- - [ ] `rvm use jruby@metasploit-model`
146
- - [ ] `rm Gemfile.lock`
147
- - [ ] `bundle install`
148
- - [ ] `rake release`
149
-
150
- ## MRI Ruby
151
- - [ ] `rvm use ruby-2.1@metasploit-model`
152
- - [ ] `rm Gemfile.lock`
153
- - [ ] `bundle install`
154
- - [ ] `rake release`
155
- ```
156
-
157
- ### Downstream dependencies
158
-
159
- When releasing new versions, the following projects may need to be updated:
160
-
161
- * [metasploit_data_models](https://github.com/rapid7/metasploit_data_models)
162
- * [metasploit-credential](https://github.com/rapid7/metasploit-credential)
121
+ To update the [CHANGELOG.md](CHANGELOG.md) with the merged changes or release the merged code see
122
+ [RELEASING.md](RELEASING.md)
@@ -0,0 +1,86 @@
1
+ # Releasing
2
+
3
+ These steps can be added to the Pull Request description's task list to remind the reviewer of how to release the
4
+ gem.
5
+
6
+ ```
7
+ # Release
8
+
9
+ Complete these steps on DESTINATION
10
+
11
+ ## [CHANGELOG.md](CHANGELOG.md)
12
+
13
+ ### Terminology
14
+
15
+ * "Enhancements" are widdening the API, such as by adding new classes or methods.
16
+ * "Bug Fixes" are fixes to the implementation that do not affect the public API. If the public API is affected then
17
+ the change should be listed as both a "Bug Fix" and either an "Enhancement" or "Incompatible Change" depending on how
18
+ the bug was fixed.
19
+ * "Deprecations" are changes to the implementation that cause deprecation warnings to be issued for APIs which will be
20
+ removed in a future major release. "Deprecations" are usually accompanied by an Enhancement that creates a new API
21
+ that is meant to be used in favor of the deprecated API.
22
+ * "Incompatbile Changes" are the removal of classes or methods or new required arguments or setup that shrink the API.
23
+ It is best practice to make a "Deprecation" for the API prior to its removal.
24
+
25
+ ### Task List
26
+
27
+ - [ ] Generate the list of changes since the last release: `git log v<LAST_MAJOR>.<LAST_MINOR>.<LAST_PATCH>..HEAD`
28
+ - [ ] For each commit in the release, find the corresponding PR by search for the commit on Github.
29
+ - [ ] For each PR, determine whether it is an Enhancement, Bug Fix, Deprecation, and/or Incompatible Change. A PR can
30
+ be in more than one category, in which case it should be listed in each category it belongs, but with a category
31
+ specific description of the change.
32
+ - [ ] Add an item to each category's list in the following format: `[#<PR>](https://github.com/rapid7/metasploit-model/pull/<PR>) <consumer summary> - [@<github_user>](https://github.com/<github_user>)`
33
+ `consumer_summary` should be a summary of the Enhancement, Bug Fix, Deprecation, or Incompatible Change from a
34
+ downstream consumer's of the library's perspective. `github_user` should be Github handle of the author of the
35
+ PR.
36
+ - [ ] If you added any Deprecations or Incompatible Changes, then adding upgrading information to
37
+ [UPGRADING.md](UPGRADING.md)
38
+
39
+ ## `VERSION`
40
+
41
+ The entries in the [CHANGELOG.md](CHANGELOG.md) can be used to help determine how the `VERSION` should be bumped.
42
+
43
+ ### Compatible changes
44
+
45
+ If the [CHANGELOG.md](CHANGELOG.md) contains only Enhancements, Bug Fixes, and/or Deprecations for the Next Release then
46
+ increment [`PATCH`](lib/metasploit/model/version.rb).
47
+
48
+ ### Incompatible changes
49
+
50
+ If the [CHANGELOG.md](CHANGELOG.md) contains any Incompatible Changes for the Next Release, then you can either (1)
51
+ decide to remain pre-1.0.0 or (2) advance to 1.0.0.
52
+
53
+ 1. To remain pre-1..0.0, then increment [`MINOR`](lib/metasploit/model/version.rb) and reset [`PATCH`](lib/metasploit/model/version.rb) to `0`.
54
+ 2. To advance to 1.0.0, increment [`MAJOR`](lib/metasploit/model/version.rb) and reset [`MINOR`](lib/metasploit/model/version.rb and [`PATCH`](lib/metasploit/model/version.rb) to `0`.
55
+
56
+ ## Setup [CHANGELOG.md](CHANGELOG.md) for next release
57
+
58
+ - [ ] Change `Next Release` section name at the top of [CHANGELOG.md](CHANGELOG.md) to match the current `VERSION`.
59
+ - [ ] Add a new `Next Release` section above the `VERSION`'s section you just renamed:
60
+ <pre>
61
+ # Next Release
62
+
63
+ * Enhancements
64
+ * Bug Fixes
65
+ * Deprecations
66
+ * Incompatible Changes
67
+ </pre>
68
+
69
+ ## Release to rubygems.org
70
+
71
+ ## jruby
72
+ - [ ] `rvm use jruby@metasploit-model`
73
+ - [ ] `rm Gemfile.lock`
74
+ - [ ] `bundle install`
75
+ - [ ] `rake release`
76
+
77
+ ## ruby-2.1
78
+ - [ ] `rvm use ruby-2.1@metasploit-model`
79
+ - [ ] `rm Gemfile.lock`
80
+ - [ ] `bundle install`
81
+ - [ ] `rake release`
82
+ ```
83
+
84
+ ### Downstream dependencies
85
+
86
+ There are currently no known downstream dependencies
@@ -0,0 +1 @@
1
+ No Deprecations or Incompatible Changes have been introduced at this time
@@ -2,18 +2,29 @@ module Metasploit
2
2
  module Model
3
3
  # Holds components of {VERSION} as defined by {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0}.
4
4
  module Version
5
+ #
6
+ # CONSTANTS
7
+ #
8
+
5
9
  # The major version number.
6
10
  MAJOR = 0
7
11
  # The minor version number, scoped to the {MAJOR} version number.
8
12
  MINOR = 30
9
- # The patch number, scoped to the {MAJOR} and {MINOR} version numbers.
10
- PATCH = 1
13
+ # The patch version number, scoped to the {MAJOR} and {MINOR} version numbers.
14
+ PATCH = 2
15
+
16
+ #
17
+ # Module Methods
18
+ #
11
19
 
12
- # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
20
+ # The full version string, including the {Metasploit::Model::Version::MAJOR},
21
+ # {Metasploit::Model::Version::MINOR}, {Metasploit::Model::Version::PATCH}, and optionally, the
22
+ # `Metasploit::Model::Version::PRERELEASE` in the
13
23
  # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
14
24
  #
15
- # @return [String] '{MAJOR}.{MINOR}.{PATCH}' on master. '{MAJOR}.{MINOR}.{PATCH}-{PRERELEASE}' on any branch
16
- # other than master.
25
+ # @return [String] '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}'
26
+ # on master. '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}-PRERELEASE'
27
+ # on any branch other than master.
17
28
  def self.full
18
29
  version = "#{MAJOR}.#{MINOR}.#{PATCH}"
19
30
 
@@ -24,20 +35,23 @@ module Metasploit
24
35
  version
25
36
  end
26
37
 
27
- # The full gem version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
38
+ # The full gem version string, including the {Metasploit::Model::Version::MAJOR},
39
+ # {Metasploit::Model::Version::MINOR}, {Metasploit::Model::Version::PATCH}, and optionally, the
40
+ # `Metasploit::Model::Version::PRERELEASE` in the
28
41
  # {http://guides.rubygems.org/specification-reference/#version RubyGems versioning} format.
29
42
  #
30
- # @return [String] '{MAJOR}.{MINOR}.{PATCH}' on master. '{MAJOR}.{MINOR}.{PATCH}.{PRERELEASE}' on any branch
31
- # other than master.
43
+ # @return [String] '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}'
44
+ # on master. '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}.PRERELEASE'
45
+ # on any branch other than master.
32
46
  def self.gem
33
47
  full.gsub('-', '.pre.')
34
48
  end
35
49
  end
36
50
 
37
- # @see Version.gem
51
+ # (see Version.gem)
38
52
  GEM_VERSION = Version.gem
39
53
 
40
- # @see Version.full
54
+ # (see Version.full)
41
55
  VERSION = Version.full
42
56
  end
43
57
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.required_ruby_version = '>= 2.1'
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'metasploit-version', '~> 0.1.3'
22
23
  spec.add_development_dependency 'metasploit-yard', '~> 1.0'
23
24
  spec.add_development_dependency 'rake'
24
25
 
@@ -1,139 +1,3 @@
1
1
  RSpec.describe Metasploit::Model::Version do
2
- context 'CONSTANTS' do
3
- context 'MAJOR' do
4
- subject(:major) do
5
- described_class::MAJOR
6
- end
7
-
8
- it 'is 0 because the API is not locked yet' do
9
- expect(major).to eq(0)
10
- end
11
- end
12
-
13
- context 'MINOR' do
14
- subject(:minor) do
15
- described_class::MINOR
16
- end
17
-
18
- it { is_expected.to be_a Integer }
19
- end
20
-
21
- context 'PATCH' do
22
- subject(:patch) do
23
- described_class::PATCH
24
- end
25
-
26
- it { is_expected.to be_a Integer }
27
- end
28
-
29
- pull_request = ENV['TRAVIS_PULL_REQUEST']
30
-
31
- # a pull request cannot check PRERELEASE because it will be tested in the target branch, but the source itself
32
- # is from the source branch and so has the source branch PRERELEASE.
33
- #
34
- # PRERELEASE can only be set appropriately for a merge by merging to the target branch and then updating PRERELEASE
35
- # on the target branch before committing and/or pushing to github and travis-ci.
36
- if pull_request.nil? || pull_request == 'false'
37
- context 'PREPRELEASE' do
38
- subject(:prerelease) do
39
- described_class::PRERELEASE
40
- end
41
-
42
- branch = ENV['TRAVIS_BRANCH']
43
-
44
- if branch.blank?
45
- branch = `git rev-parse --abbrev-ref HEAD`.strip
46
- end
47
-
48
- if branch == 'master'
49
- it 'does not have a PRERELEASE' do
50
- expect(defined? described_class::PRERELEASE).to be_nil
51
- end
52
- else
53
- branch_regex = /\A(?<type>bug|chore|feature|staging)(\/(?<story>[^\/]+))?\/(?<prerelease>[^\/]+)\z/
54
- match = branch.match(branch_regex)
55
-
56
- if match
57
- it 'matches the branch relative name' do
58
- expect(prerelease).to eq(match[:prerelease])
59
- end
60
- else
61
- tag_regex = /\Av(?<major>\d+).(?<minor>\d+).(?<patch>\d+)(\.pre\.(?<prerelease>.*))?\z/
62
- # travis-ci sets TRAVIS_BRANCH to the tag name for tag builds
63
- match = branch.match(tag_regex)
64
-
65
- if match
66
- tag_prerelease = match[:prerelease]
67
-
68
- if tag_prerelease
69
- it 'matches the tag prerelease converted from a gem version to a VERSION' do
70
- expect(prerelease).to eq(tag_prerelease.gsub('.pre.', '-'))
71
- end
72
- else
73
- it 'does not have a PRERELEASE' do
74
- expect(defined? described_class::PRERELEASE).to be_nil
75
- end
76
- end
77
- else
78
- it 'has a abbreviated reference that can be parsed for prerelease' do
79
- fail "Do not know how to parse #{branch.inspect} for PRERELEASE"
80
- end
81
- end
82
- end
83
- end
84
- end
85
- end
86
- end
87
-
88
- context 'full' do
89
- subject(:full) do
90
- described_class.full
91
- end
92
-
93
- #
94
- # lets
95
- #
96
-
97
- let(:major) do
98
- 1
99
- end
100
-
101
- let(:minor) do
102
- 2
103
- end
104
-
105
- let(:patch) do
106
- 3
107
- end
108
-
109
- before(:each) do
110
- stub_const("#{described_class}::MAJOR", major)
111
- stub_const("#{described_class}::MINOR", minor)
112
- stub_const("#{described_class}::PATCH", patch)
113
- end
114
-
115
- context 'with PRERELEASE' do
116
- let(:prerelease) do
117
- 'prerelease'
118
- end
119
-
120
- before(:each) do
121
- stub_const("#{described_class}::PRERELEASE", prerelease)
122
- end
123
-
124
- it 'is <major>.<minor>.<patch>-<prerelease>' do
125
- expect(full).to eq("#{major}.#{minor}.#{patch}-#{prerelease}")
126
- end
127
- end
128
-
129
- context 'without PRERELEASE' do
130
- before(:each) do
131
- hide_const("#{described_class}::PRERELEASE")
132
- end
133
-
134
- it 'is <major>.<minor>.<patch>' do
135
- expect(full).to eq("#{major}.#{minor}.#{patch}")
136
- end
137
- end
138
- end
139
- end
2
+ it_should_behave_like 'Metasploit::Version Version Module'
3
+ end
@@ -0,0 +1,4 @@
1
+ RSpec.describe Metasploit::Model do
2
+ it_should_behave_like 'Metasploit::Version GEM_VERSION constant'
3
+ it_should_behave_like 'Metasploit::Version VERSION constant'
4
+ end
@@ -15,10 +15,18 @@ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
15
15
  require File.expand_path('../dummy/config/environment.rb', __FILE__)
16
16
  require 'rspec/rails'
17
17
 
18
- spec_pathname = Metasploit::Model::Engine.root.join('spec')
18
+ # Use find_all_by_name instead of find_by_name as find_all_by_name will return pre-release versions
19
+ gem_specification = Gem::Specification.find_all_by_name('metasploit-version').first
19
20
 
20
- Dir[spec_pathname.join('support', '**', '*.rb')].each do |f|
21
- require f
21
+ roots = [
22
+ Metasploit::Model::Engine.root.to_path,
23
+ gem_specification.gem_dir
24
+ ]
25
+
26
+ roots.each do |root|
27
+ Dir[File.join(root, 'spec', 'support', '**', '*.rb')].each do |f|
28
+ require f
29
+ end
22
30
  end
23
31
 
24
32
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
@@ -94,7 +102,7 @@ RSpec.configure do |config|
94
102
  config.before(:suite) do
95
103
  # this must be explicitly set here because it should always be spec/tmp for w/e project is using
96
104
  # Metasploit::Model::Spec to handle file system clean up.
97
- Metasploit::Model::Spec.temporary_pathname = spec_pathname.join('tmp')
105
+ Metasploit::Model::Spec.temporary_pathname = Metasploit::Model::Engine.root.join('spec', 'tmp')
98
106
  # Clean up any left over files from a previously aborted suite
99
107
  Metasploit::Model::Spec.remove_temporary_pathname
100
108
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.1
4
+ version: 0.30.2
5
5
  platform: java
6
6
  authors:
7
7
  - Luke Imhoff
@@ -24,6 +24,20 @@ dependencies:
24
24
  version: '1.3'
25
25
  prerelease: false
26
26
  type: :development
27
+ - !ruby/object:Gem::Dependency
28
+ name: metasploit-version
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.3
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: 0.1.3
39
+ prerelease: false
40
+ type: :development
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: metasploit-yard
29
43
  version_requirements: !ruby/object:Gem::Requirement
@@ -121,11 +135,14 @@ files:
121
135
  - .simplecov
122
136
  - .travis.yml
123
137
  - .yardopts
138
+ - CHANGELOG.md
124
139
  - CONTRIBUTING.md
125
140
  - Gemfile
126
141
  - LICENSE
127
142
  - README.md
143
+ - RELEASING.md
128
144
  - Rakefile
145
+ - UPGRADING.md
129
146
  - app/models/metasploit/model/association/reflection.rb
130
147
  - app/models/metasploit/model/search/group/base.rb
131
148
  - app/models/metasploit/model/search/group/intersection.rb
@@ -297,6 +314,7 @@ files:
297
314
  - spec/lib/metasploit/model/translation_spec.rb
298
315
  - spec/lib/metasploit/model/version_spec.rb
299
316
  - spec/lib/metasploit/model/visitation/visit_spec.rb
317
+ - spec/lib/metasploit/model_spec.rb
300
318
  - spec/matchers/validate_nilness_of_spec.rb
301
319
  - spec/spec_helper.rb
302
320
  - spec/support/matchers/allow_attribute.rb
@@ -428,6 +446,7 @@ test_files:
428
446
  - spec/lib/metasploit/model/translation_spec.rb
429
447
  - spec/lib/metasploit/model/version_spec.rb
430
448
  - spec/lib/metasploit/model/visitation/visit_spec.rb
449
+ - spec/lib/metasploit/model_spec.rb
431
450
  - spec/matchers/validate_nilness_of_spec.rb
432
451
  - spec/spec_helper.rb
433
452
  - spec/support/matchers/allow_attribute.rb