metasploit-version 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/.travis.yml +10 -3
- data/CHANGELOG.md +6 -0
- data/CONTRIBUTING.md +10 -44
- data/Gemfile +12 -8
- data/RELEASING.md +86 -0
- data/Rakefile +5 -4
- data/UPGRADING.md +1 -0
- data/app/templates/.rspec.tt +2 -0
- data/app/templates/CHANGELOG.md.tt +18 -0
- data/app/templates/CONTRIBUTING.md.tt +122 -0
- data/app/templates/RELEASING.md.tt +99 -0
- data/app/templates/Rakefile.tt +7 -0
- data/app/templates/UPGRADING.md.tt +1 -0
- data/app/templates/lib/versioned/version.rb.tt +64 -0
- data/app/templates/spec/lib/versioned/version_spec.rb.tt +3 -0
- data/app/templates/spec/lib/versioned_spec.rb.tt +4 -0
- data/app/templates/spec/spec_helper.rb.tt +76 -0
- data/bin/metasploit-version +12 -0
- data/config/cucumber.yml +3 -0
- data/features/metasploit-version/install/add_development_dependency.feature +68 -0
- data/features/metasploit-version/install/bundle_install.feature +24 -0
- data/features/metasploit-version/install/changelog.feature +29 -0
- data/features/metasploit-version/install/conflict.feature +45 -0
- data/features/metasploit-version/install/contributing.feature +139 -0
- data/features/metasploit-version/install/namespace_spec/gem_version_constant.feature +154 -0
- data/features/metasploit-version/install/namespace_spec/namespace.feature +33 -0
- data/features/metasploit-version/install/namespace_spec/version_constant.feature +179 -0
- data/features/metasploit-version/install/rake_spec.feature +27 -0
- data/features/metasploit-version/install/releasing/ruby_versions.feature +50 -0
- data/features/metasploit-version/install/releasing/versioning.feature +138 -0
- data/features/metasploit-version/install/steps/gemspec_steps.rb +19 -0
- data/features/metasploit-version/install/upgrading.feature +19 -0
- data/features/metasploit-version/install/version.feature +11 -0
- data/features/metasploit-version/install/version/namespace.feature +157 -0
- data/features/metasploit-version/install/version/prerelease.feature +154 -0
- data/features/metasploit-version/install/version_spec/namespace.feature +32 -0
- data/features/metasploit-version/install/version_spec/testing/branch_from_master.feature +40 -0
- data/features/metasploit-version/install/version_spec/testing/branching_from_branch.feature +161 -0
- data/features/metasploit-version/install/version_spec/testing/merge_branch_to_master.feature +97 -0
- data/features/{shared/examples/metasploit/version/version_module/prerelease/git/step_definitions → step_definitions}/environment_variable_steps.rb +1 -1
- data/features/{shared/examples/metasploit/version/version_module/prerelease/git/step_definitions → step_definitions}/git_steps.rb +11 -3
- data/features/support/env.rb +15 -11
- data/lib/metasploit/version.rb +1 -0
- data/lib/metasploit/version/cli.rb +321 -0
- data/lib/metasploit/version/version.rb +2 -2
- data/metasploit-version.gemspec +2 -2
- data/spec/lib/metasploit/version/branch_spec.rb +1 -3
- data/spec/lib/metasploit/version/cli_spec.rb +514 -0
- data/spec/lib/metasploit/version/version_spec.rb +2 -4
- data/spec/lib/metasploit/version_spec.rb +2 -4
- data/spec/spec_helper.rb +63 -1
- data/spec/support/shared/examples/metasploit/version/version_module.rb +3 -1
- metadata +82 -8
@@ -0,0 +1 @@
|
|
1
|
+
No Deprecations or Incompatible Changes have been introduced at this time
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<%- namespaces.each_with_index do |module_name, i| -%>
|
2
|
+
<%= ' ' * i %>module <%= module_name %>
|
3
|
+
<%- end -%>
|
4
|
+
<%- indent = ' ' * namespaces.length -%>
|
5
|
+
<%= indent %># Holds components of {VERSION} as defined by {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0}.
|
6
|
+
<%= indent %>module Version
|
7
|
+
<%= indent %> #
|
8
|
+
<%= indent %> # CONSTANTS
|
9
|
+
<%= indent %> #
|
10
|
+
|
11
|
+
<%= indent %> # The major version number.
|
12
|
+
<%= indent %> MAJOR = <%= options[:major] %>
|
13
|
+
<%= indent %> # The minor version number, scoped to the {MAJOR} version number.
|
14
|
+
<%= indent %> MINOR = <%= options[:minor] %>
|
15
|
+
<%= indent %> # The patch version number, scoped to the {MAJOR} and {MINOR} version numbers.
|
16
|
+
<%= indent %> PATCH = <%= options[:patch] %>
|
17
|
+
<%- if prerelease -%>
|
18
|
+
<%= indent %> # The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version numbers.
|
19
|
+
<%= indent %> PRERELEASE = '<%= prerelease %>'
|
20
|
+
<%- end -%>
|
21
|
+
|
22
|
+
<%= indent %> #
|
23
|
+
<%= indent %> # Module Methods
|
24
|
+
<%= indent %> #
|
25
|
+
|
26
|
+
<%= indent %> # The full version string, including the {<%= namespace_name %>::Version::MAJOR},
|
27
|
+
<%= indent %> # {<%= namespace_name %>::Version::MINOR}, {<%= namespace_name %>::Version::PATCH}, and optionally, the
|
28
|
+
<%= indent %> # `<%= namespace_name %>::Version::PRERELEASE` in the
|
29
|
+
<%= indent %> # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
|
30
|
+
<%= indent %> #
|
31
|
+
<%= indent %> # @return [String] '{<%= namespace_name %>::Version::MAJOR}.{<%= namespace_name %>::Version::MINOR}.{<%= namespace_name %>::Version::PATCH}' on master.
|
32
|
+
<%= indent %> # '{<%= namespace_name %>::Version::MAJOR}.{<%= namespace_name %>::Version::MINOR}.{<%= namespace_name %>::Version::PATCH}-PRERELEASE'
|
33
|
+
<%= indent %> # on any branch other than master.
|
34
|
+
<%= indent %> def self.full
|
35
|
+
<%= indent %> version = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
36
|
+
|
37
|
+
<%= indent %> if defined? PRERELEASE
|
38
|
+
<%= indent %> version = "#{version}-#{PRERELEASE}"
|
39
|
+
<%= indent %> end
|
40
|
+
|
41
|
+
<%= indent %> version
|
42
|
+
<%= indent %> end
|
43
|
+
|
44
|
+
<%= indent %> # The full gem version string, including the {<%= namespace_name %>::Version::MAJOR},
|
45
|
+
<%= indent %> # {<%= namespace_name %>::Version::MINOR}, {<%= namespace_name %>::Version::PATCH}, and optionally, the
|
46
|
+
<%= indent %> # `<%= namespace_name %>::Version::PRERELEASE` in the
|
47
|
+
<%= indent %> # {http://guides.rubygems.org/specification-reference/#version RubyGems versioning} format.
|
48
|
+
<%= indent %> #
|
49
|
+
<%= indent %> # @return [String] '{<%= namespace_name %>::Version::MAJOR}.{<%= namespace_name %>::Version::MINOR}.{<%= namespace_name %>::Version::PATCH}'
|
50
|
+
<%= indent %> # on master. '{<%= namespace_name %>::Version::MAJOR}.{<%= namespace_name %>::Version::MINOR}.{<%= namespace_name %>::Version::PATCH}.PRERELEASE'
|
51
|
+
<%= indent %> # on any branch other than master.
|
52
|
+
<%= indent %> def self.gem
|
53
|
+
<%= indent %> full.gsub('-', '.pre.')
|
54
|
+
<%= indent %> end
|
55
|
+
<%= indent %>end
|
56
|
+
|
57
|
+
<%= indent %># (see Version.gem)
|
58
|
+
<%= indent %>GEM_VERSION = Version.gem
|
59
|
+
|
60
|
+
<%= indent %># (see Version.full)
|
61
|
+
<%= indent %>VERSION = Version.full
|
62
|
+
<%- (namespaces.length - 1).downto(0) do |i| -%>
|
63
|
+
<%= ' ' * i %>end
|
64
|
+
<%- end -%>
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
|
3
|
+
#
|
4
|
+
# Gems
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'metasploit/version'
|
8
|
+
|
9
|
+
#
|
10
|
+
# Project
|
11
|
+
#
|
12
|
+
|
13
|
+
require '<%= namespaced_path %>'
|
14
|
+
|
15
|
+
# Use find_all_by_name instead of find_by_name as find_all_by_name will return pre-release versions
|
16
|
+
gem_specification = Gem::Specification.find_all_by_name('metasploit-version').first
|
17
|
+
|
18
|
+
Dir[File.join(gem_specification.gem_dir, 'spec', 'support', '**', '*.rb')].each do |f|
|
19
|
+
require f
|
20
|
+
end
|
21
|
+
|
22
|
+
RSpec.configure do |config|
|
23
|
+
config.expose_dsl_globally = false
|
24
|
+
|
25
|
+
# These two settings work together to allow you to limit a spec run
|
26
|
+
# to individual examples or groups you care about by tagging them with
|
27
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
28
|
+
# get run.
|
29
|
+
config.filter_run :focus
|
30
|
+
config.run_all_when_everything_filtered = true
|
31
|
+
|
32
|
+
# allow more verbose output when running an individual spec file.
|
33
|
+
if config.files_to_run.one?
|
34
|
+
# RSpec filters the backtrace by default so as not to be so noisy.
|
35
|
+
# This causes the full backtrace to be printed when running a single
|
36
|
+
# spec file (e.g. to troubleshoot a particular spec failure).
|
37
|
+
config.full_backtrace = true
|
38
|
+
end
|
39
|
+
|
40
|
+
# Print the 10 slowest examples and example groups at the
|
41
|
+
# end of the spec run, to help surface which specs are running
|
42
|
+
# particularly slow.
|
43
|
+
config.profile_examples = 10
|
44
|
+
|
45
|
+
# Run specs in random order to surface order dependencies. If you find an
|
46
|
+
# order dependency and want to debug it, you can fix the order by providing
|
47
|
+
# the seed, which is printed after each run.
|
48
|
+
# --seed 1234
|
49
|
+
config.order = :random
|
50
|
+
|
51
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
52
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
53
|
+
# test failures related to randomization by passing the same `--seed` value
|
54
|
+
# as the one that triggered the failure.
|
55
|
+
Kernel.srand config.seed
|
56
|
+
|
57
|
+
config.expect_with :rspec do |expectations|
|
58
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
59
|
+
expectations.syntax = :expect
|
60
|
+
end
|
61
|
+
|
62
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
63
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
64
|
+
config.mock_with :rspec do |mocks|
|
65
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
66
|
+
# For more details, see:
|
67
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
68
|
+
mocks.syntax = :expect
|
69
|
+
|
70
|
+
mocks.patch_marshal_to_support_partial_doubles = false
|
71
|
+
|
72
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
73
|
+
# a real object.
|
74
|
+
mocks.verify_partial_doubles = true
|
75
|
+
end
|
76
|
+
end
|
data/config/cucumber.yml
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
Feature: metasploit-version install adds 'metasploit-version' as a development dependency
|
2
|
+
|
3
|
+
The `metasploit-version install` command will add 'metasploit-version' to the gem's gemspec if it is not already
|
4
|
+
added.
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given I successfully run `bundle gem add_development_dependency`
|
8
|
+
And I cd to "add_development_dependency"
|
9
|
+
|
10
|
+
Scenario: Not added to gemspec
|
11
|
+
When I successfully run `metasploit-version install --force --no-bundle-install`
|
12
|
+
Then metasploit-version should be development dependency with semantic version restriction in "add_development_dependency.gemspec"
|
13
|
+
|
14
|
+
Scenario: No semantic version restriction
|
15
|
+
Given I overwrite "add_development_dependency.gemspec" with:
|
16
|
+
"""
|
17
|
+
# coding: utf-8
|
18
|
+
|
19
|
+
Gem::Specification.new do |spec|
|
20
|
+
spec.name = "add_development_dependency"
|
21
|
+
spec.version = '0.0.0'
|
22
|
+
spec.authors = ["Luke Imhoff"]
|
23
|
+
spec.email = ["luke_imhoff@rapid7.com"]
|
24
|
+
spec.summary = %q{TODO: Write a short summary. Required.}
|
25
|
+
spec.description = %q{TODO: Write a longer description. Optional.}
|
26
|
+
spec.homepage = ""
|
27
|
+
spec.license = "MIT"
|
28
|
+
|
29
|
+
spec.files = `git ls-files -z`.split("\x0")
|
30
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
31
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
35
|
+
spec.add_development_dependency 'metasploit-version'
|
36
|
+
spec.add_development_dependency "rake"
|
37
|
+
end
|
38
|
+
"""
|
39
|
+
When I successfully run `metasploit-version install --force --no-bundle-install`
|
40
|
+
Then metasploit-version should be development dependency with semantic version restriction in "add_development_dependency.gemspec"
|
41
|
+
|
42
|
+
Scenario: Semantic version restriction in gemspec
|
43
|
+
Given I overwrite "add_development_dependency.gemspec" with:
|
44
|
+
"""
|
45
|
+
# coding: utf-8
|
46
|
+
|
47
|
+
Gem::Specification.new do |spec|
|
48
|
+
spec.name = "add_development_dependency"
|
49
|
+
spec.version = '0.0.0'
|
50
|
+
spec.authors = ["Luke Imhoff"]
|
51
|
+
spec.email = ["luke_imhoff@rapid7.com"]
|
52
|
+
spec.summary = %q{TODO: Write a short summary. Required.}
|
53
|
+
spec.description = %q{TODO: Write a longer description. Optional.}
|
54
|
+
spec.homepage = ""
|
55
|
+
spec.license = "MIT"
|
56
|
+
|
57
|
+
spec.files = `git ls-files -z`.split("\x0")
|
58
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
59
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
60
|
+
spec.require_paths = ["lib"]
|
61
|
+
|
62
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
63
|
+
spec.add_development_dependency 'metasploit-version', '~> 0.0.0'
|
64
|
+
spec.add_development_dependency "rake"
|
65
|
+
end
|
66
|
+
"""
|
67
|
+
When I successfully run `metasploit-version install --force --no-bundle-install`
|
68
|
+
Then metasploit-version should be development dependency with semantic version restriction in "add_development_dependency.gemspec"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: metasploit-version install will install dependencies with bundle install
|
2
|
+
|
3
|
+
After `metasploit-version install` adds the `metasploit-version` as a development dependency to the gemspec,
|
4
|
+
`metasploit-version install` should run `bundle install` so that `metasploit-version` itself and its dependencies,
|
5
|
+
such as `rspec` are installed so that user can immediately run `rake spec`
|
6
|
+
|
7
|
+
Scenario:
|
8
|
+
Given I build gem from project's "metasploit-version.gemspec"
|
9
|
+
And I'm using a clean gemset "installed"
|
10
|
+
When I run `bundle list`
|
11
|
+
Then the output from "bundle list" should not contain "metasploit-version"
|
12
|
+
Given I install latest local "metasploit-version" gem
|
13
|
+
And I successfully run `bundle gem installed`
|
14
|
+
And I cd to "installed"
|
15
|
+
And my git identity is configured
|
16
|
+
And I successfully run `git commit --message "bundle gem installed"`
|
17
|
+
And I unset the environment variable "TRAVIS_BRANCH"
|
18
|
+
And I set the environment variables to:
|
19
|
+
| variable | value |
|
20
|
+
| TRAVIS_PULL_REQUEST | false |
|
21
|
+
And I successfully run `metasploit-version install --force`
|
22
|
+
When I run `bundle list`
|
23
|
+
Then the output from "bundle list" should contain "metasploit-version"
|
24
|
+
And the output from "bundle list" should contain "rspec"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: metasploit-version install should add CHANGELOG.md
|
2
|
+
|
3
|
+
`metasploit-version install` should generate CHANGELOG.md which details the Enhancements, Bug Fixes, Deprecations and
|
4
|
+
Incompatible Changes for each release version. Items in each category should link to the associated PR with a
|
5
|
+
user-facing summary and contributor credit using their github handle.
|
6
|
+
|
7
|
+
See https://github.com/intridea/hashie/blob/master/CHANGELOG.md for an example of this item format and
|
8
|
+
https://github.com/elixir-lang/elixir/blob/e38f960d7edbf564c8e1b44bd2266ad9eaf6a453/CHANGELOG.md for an example of the
|
9
|
+
category breakdown.
|
10
|
+
|
11
|
+
Scenario:
|
12
|
+
Given I successfully run `bundle gem changed`
|
13
|
+
And I cd to "changed"
|
14
|
+
And my git identity is configured
|
15
|
+
And I successfully run `git commit --message "bundle gem changed"`
|
16
|
+
And I unset the environment variable "TRAVIS_BRANCH"
|
17
|
+
And I set the environment variables to:
|
18
|
+
| variable | value |
|
19
|
+
| TRAVIS_PULL_REQUEST | false |
|
20
|
+
When I successfully run `metasploit-version install --force --no-bundle-install`
|
21
|
+
Then the file "CHANGELOG.md" should contain:
|
22
|
+
"""
|
23
|
+
# Next Release
|
24
|
+
|
25
|
+
* Enhancements
|
26
|
+
* Bug Fixes
|
27
|
+
* Deprecations
|
28
|
+
* Incompatible Changes
|
29
|
+
"""
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Feature: metasploit-version install handles conflicts in 'version.rb' and 'Rakefile'
|
2
|
+
|
3
|
+
`metasploit-version install` will detect if the a version.rb file and/or Rakefile already exists and prompt the user
|
4
|
+
for conflict resolution. The user can also non-interactive force the files to be overwritten with --force or skip
|
5
|
+
overwriting the files with --skip.
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I successfully run `bundle gem metasploit_version_install_conflict`
|
9
|
+
And I cd to "metasploit_version_install_conflict"
|
10
|
+
And I write to "spec/lib/metasploit_version_install_conflict_spec.rb" with:
|
11
|
+
"""
|
12
|
+
RSpec.describe MetasploitVersionInstallConflict do
|
13
|
+
it 'is a Module' do
|
14
|
+
expect(described_class).to be_a Module
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
"""
|
19
|
+
|
20
|
+
Scenario: Prompts for confirmation if --force or --skip is not used
|
21
|
+
When I run `metasploit-version install --no-bundle-install` interactively
|
22
|
+
# to overwrite version.rb
|
23
|
+
And I type "y"
|
24
|
+
# to overwrite Rakefile
|
25
|
+
And I type "y"
|
26
|
+
# to overwrite metasploit_version_install_spec.rb
|
27
|
+
And I type "y"
|
28
|
+
Then the output should contain "conflict Rakefile"
|
29
|
+
And the output should contain "conflict lib/metasploit_version_install_conflict/version.rb"
|
30
|
+
And the output should contain "conflict spec/lib/metasploit_version_install_conflict_spec.rb"
|
31
|
+
And the output should contain "force Rakefile"
|
32
|
+
And the output should contain "force lib/metasploit_version_install_conflict/version.rb"
|
33
|
+
And the output should contain "force spec/lib/metasploit_version_install_conflict_spec.rb"
|
34
|
+
|
35
|
+
Scenario: --force will force update version.rb
|
36
|
+
When I successfully run `metasploit-version install --force --no-bundle-install`
|
37
|
+
Then the output should contain "force Rakefile"
|
38
|
+
And the output should contain "force lib/metasploit_version_install_conflict/version.rb"
|
39
|
+
And the output should contain "force spec/lib/metasploit_version_install_conflict_spec.rb"
|
40
|
+
|
41
|
+
Scenario: --skip will not update version.rb
|
42
|
+
When I successfully run `metasploit-version install --no-bundle-install --skip`
|
43
|
+
Then the output should contain "skip Rakefile"
|
44
|
+
And the output should contain "skip lib/metasploit_version_install_conflict/version.rb"
|
45
|
+
And the output should contain "skip spec/lib/metasploit_version_install_conflict_spec.rb"
|
@@ -0,0 +1,139 @@
|
|
1
|
+
Feature: metasploit-version install should add CONTRIBUTING.md
|
2
|
+
|
3
|
+
`metasploit-version install` should generate CONTRIBUTING.md
|
4
|
+
|
5
|
+
Scenario:
|
6
|
+
Given I successfully run `bundle gem contributed`
|
7
|
+
And I cd to "contributed"
|
8
|
+
And my git identity is configured
|
9
|
+
And I successfully run `git commit --message "bundle gem contributed"`
|
10
|
+
And I unset the environment variable "TRAVIS_BRANCH"
|
11
|
+
And I set the environment variables to:
|
12
|
+
| variable | value |
|
13
|
+
| TRAVIS_PULL_REQUEST | false |
|
14
|
+
When I successfully run `metasploit-version install --force --no-bundle-install`
|
15
|
+
Then the file "CONTRIBUTING.md" should contain:
|
16
|
+
"""
|
17
|
+
# Contributing
|
18
|
+
|
19
|
+
## Forking
|
20
|
+
|
21
|
+
[Fork this repository](https://github.com/rapid7/contributed/fork)
|
22
|
+
|
23
|
+
## Branching
|
24
|
+
|
25
|
+
Branch names follow the format `TYPE/ISSUE/SUMMARY`. You can create it with `git checkout -b TYPE/ISSUE/SUMMARY`.
|
26
|
+
|
27
|
+
### `TYPE`
|
28
|
+
|
29
|
+
`TYPE` can be `bug`, `chore`, or `feature`.
|
30
|
+
|
31
|
+
### `ISSUE`
|
32
|
+
|
33
|
+
`ISSUE` is either a [Github issue](https://github.com/rapid7/contributed/issues) or an issue from some other
|
34
|
+
issue tracking software.
|
35
|
+
|
36
|
+
### `SUMMARY`
|
37
|
+
|
38
|
+
`SUMMARY` is is short summary of the purpose of the branch composed of lower case words separated by '-' so that it is a valid `PRERELEASE` for the Gem version.
|
39
|
+
|
40
|
+
## Changes
|
41
|
+
|
42
|
+
### `PRERELEASE`
|
43
|
+
|
44
|
+
1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/contributed/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
|
45
|
+
```
|
46
|
+
# The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version number.
|
47
|
+
PRERELEASE = '<SUMMARY>'
|
48
|
+
```
|
49
|
+
2. `rake spec`
|
50
|
+
3. Verify the specs pass, which indicates that `PRERELEASE` was updated correctly.
|
51
|
+
4. Commit the change `git commit -a`
|
52
|
+
|
53
|
+
### Your changes
|
54
|
+
|
55
|
+
Make your changes or however many commits you like, committing each with `git commit`.
|
56
|
+
|
57
|
+
### Pre-Pull Request Testing
|
58
|
+
|
59
|
+
1. Run specs one last time before opening the Pull Request: `rake spec`
|
60
|
+
2. Verify there was no failures.
|
61
|
+
|
62
|
+
### Push
|
63
|
+
|
64
|
+
Push your branch to your fork on gitub: `git push TYPE/ISSUE/SUMMARY`
|
65
|
+
|
66
|
+
### Pull Request
|
67
|
+
|
68
|
+
* [Create new Pull Request](https://github.com/rapid7/contributed/compare/)
|
69
|
+
* Add a Verification Steps to the description comment
|
70
|
+
|
71
|
+
```
|
72
|
+
# Verification Steps
|
73
|
+
|
74
|
+
- [ ] `bundle install`
|
75
|
+
|
76
|
+
## `rake spec`
|
77
|
+
- [ ] `rake spec`
|
78
|
+
- [ ] VERIFY no failures
|
79
|
+
```
|
80
|
+
|
81
|
+
You should also include at least one scenario to manually check the changes outside of specs.
|
82
|
+
|
83
|
+
* Add a Post-merge Steps comment
|
84
|
+
|
85
|
+
The 'Post-merge Steps' are a reminder to the reviewer of the Pull Request of how to update the [`PRERELEASE`](lib/contributed/version.rb) so that [version_spec.rb](spec/lib/contributed/version.rb_spec.rb) passes on the target branch after the merge.
|
86
|
+
|
87
|
+
DESTINATION is the name of the destination branch into which the merge is being made. SOURCE_SUMMARY is the SUMMARY from TYPE/ISSUE/SUMMARY branch name for the SOURCE branch that is being made.
|
88
|
+
|
89
|
+
When merging to `master`:
|
90
|
+
|
91
|
+
```
|
92
|
+
# Post-merge Steps
|
93
|
+
|
94
|
+
Perform these steps prior to pushing to master or the build will be broke on master.
|
95
|
+
|
96
|
+
## Version
|
97
|
+
- [ ] Edit `lib/contributed/version.rb`
|
98
|
+
- [ ] Remove `PRERELEASE` and its comment as `PRERELEASE` is not defined on master.
|
99
|
+
|
100
|
+
## Gem build
|
101
|
+
- [ ] gem build *.gemspec
|
102
|
+
- [ ] VERIFY the gem has no '.pre' version suffix.
|
103
|
+
|
104
|
+
## RSpec
|
105
|
+
- [ ] `rake spec`
|
106
|
+
- [ ] VERIFY version examples pass without failures
|
107
|
+
|
108
|
+
## Commit & Push
|
109
|
+
- [ ] `git commit -a`
|
110
|
+
- [ ] `git push origin master`
|
111
|
+
```
|
112
|
+
|
113
|
+
When merging to DESTINATION other than `master`:
|
114
|
+
|
115
|
+
```
|
116
|
+
# Post-merge Steps
|
117
|
+
|
118
|
+
Perform these steps prior to pushing to DESTINATION or the build will be broke on DESTINATION.
|
119
|
+
|
120
|
+
## Version
|
121
|
+
- [ ] Edit `lib/contributed/version.rb`
|
122
|
+
- [ ] Change `PRERELEASE` from `SOURCE_SUMMARY` to `DESTINATION_SUMMARY` to match the branch (DESTINATION) summary (DESTINATION_SUMMARY)
|
123
|
+
|
124
|
+
## Gem build
|
125
|
+
- [ ] gem build contributed.gemspec
|
126
|
+
- [ ] VERIFY the prerelease suffix has change on the gem.
|
127
|
+
|
128
|
+
## RSpec
|
129
|
+
- [ ] `rake spec`
|
130
|
+
- [ ] VERIFY version examples pass without failures
|
131
|
+
|
132
|
+
## Commit & Push
|
133
|
+
- [ ] `git commit -a`
|
134
|
+
- [ ] `git push origin DESTINATION`
|
135
|
+
```
|
136
|
+
|
137
|
+
To update the [CHANGELOG.md](CHANGELOG.md) with the merged changes or release the merged code see
|
138
|
+
[RELEASING.md](RELEASING.md)
|
139
|
+
"""
|