metasploit-concern 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDE0ZDAxOTA3YjBlNGUwNzk0MTZhMGZkZjhjMjg1MTY0YTE2NjU5YQ==
4
+ OGI4NmEzOGFiOTFlM2JhNDllYTcxNWJiZTRjMzkyYmNhMWMxOGYyOQ==
5
5
  data.tar.gz: !binary |-
6
- OWNiOWExZWJkYWZlYzU2ZWZkMTc2OTZkN2VkYjM4N2FmZjU1NDNhNA==
6
+ OTM0NTJiZTVjMGMwZTIwZWYyNmQzNGEwMTQ5MTIyOTAyMGQ4ZjAwOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDVhZDc1YTY5OTYwNTY3M2QyZGZmMDY1OGFhN2MzMDZiNDc3YjhkY2UwNmQw
10
- NjllZmFjOGE0YjNjZDU0ZDdhZTg2NTM1OTQzNGMxN2UyNGI5M2ZiMzc5ZTQx
11
- MDc1ZmQ5YmU4YTZlM2M4OThlZDVjOTZmOWExMjI5NDhjMDNjZmY=
9
+ ZDU4NTJlYmQ3YjEyYmJjNWYyYzFjNDA1ZmZiZWM0MmNjM2VhMzJkNmY1ODdm
10
+ MjkxZmEzY2M0YmRlOTljZDc3NmRlZWZhMTRhNzA5YjRkNTYwYjAxMDA4M2I0
11
+ MDdmZDA0MjQ2Mzc5MTQ1NTU1NDQ1MGE3OWVmNDAxOWE3OGExZDA=
12
12
  data.tar.gz: !binary |-
13
- YzRmNGZhZTc5YTI3NGMwNTIyMDUxNGIyZWFmZGUyZWZkZjcxODk5NDIwN2Q4
14
- NDU2YzllZGUxMmVkMGI3Y2M1NDlhN2JkMDZlNWYxYTAzM2E3Yjc1NDA5Yjcy
15
- MjNmZDQyM2Y5NGEyOTJhMDVjMmYxNmFiOTFmMDRiMzg3M2ZiOTg=
13
+ YjJmYWJjZmMzN2EzMGEwZjVkMjVlODhmOGM0ZWUwOWZjNjY4MjBiYWY5YmE4
14
+ NjQ2YzJkM2VkMmUwZGFhOTBhMDU3MGIwMzQ1ZjlhNjRhNWZlMzI1YTI3OWU0
15
+ MmY5NzYxOGU5MDYyMjQ2MmExNDIwYjFjNmQzMjNmNzFmOGY5NTA=
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,157 @@
1
+ # Contributing
2
+
3
+ ## Forking
4
+
5
+ [Fork this repository](https://github.com/rapid7/metasploit-concern/fork)
6
+
7
+ ## Branching
8
+
9
+ Branch names follow the format `TYPE/ISSUE/SUMMARY`. You can create it with `git checkout -b TYPE/ISSUE/SUMMARY`.
10
+
11
+ ### `TYPE`
12
+
13
+ `TYPE` can be `bug`, `chore`, or `feature`.
14
+
15
+ ### `ISSUE`
16
+
17
+ `ISSUE` is either a [Github issue](https://github.com/rapid7/metasploit-concern/issues) or an issue from some other
18
+ issue tracking software.
19
+
20
+ ### `SUMMARY`
21
+
22
+ `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.
23
+
24
+ ## Changes
25
+
26
+ ### `PRERELEASE`
27
+
28
+ 1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/concern/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
29
+ ```
30
+ # The prerelease version, scoped to the {PATCH} version number.
31
+ PRERELEASE = '<SUMMARY>'
32
+ ```
33
+ 2. `rake spec`
34
+ 3. Verify the specs pass, which indicates that `PRERELEASE` was updated correctly.
35
+ 4. Commit the change `git commit -a`
36
+
37
+ ### Your changes
38
+
39
+ Make your changes or however many commits you like, commiting each with `git commit`.
40
+
41
+ ### Pre-Pull Request Testing
42
+
43
+ 1. Run specs one last time before opening the Pull Request: `rake spec`
44
+ 2. Verify there was no failures.
45
+
46
+ ### Push
47
+
48
+ Push your branch to your fork on gitub: `git push push TYPE/ISSUE/SUMMARY`
49
+
50
+ ### Pull Request
51
+
52
+ * [Create new Pull Request](https://github.com/rapid7/metasploit-concern/compare/)
53
+ * Add a Verification Steps comment
54
+
55
+ ```
56
+ # Verification Steps
57
+
58
+ - [ ] `bundle install`
59
+
60
+ ## `rake spec`
61
+ - [ ] `rake spec`
62
+ - [ ] VERIFY no failures
63
+ ```
64
+ You should also include at least one scenario to manually check the changes outside of specs.
65
+
66
+ * Add a Post-merge Steps comment
67
+
68
+ The 'Post-merge Steps' are a reminder to the reviewer of the Pull Request of how to update the [`PRERELEASE`](lib/metasploit/concern/version.rb) so that [version_spec.rb](spec/lib/metasploit/concern/version_spec.rb) passes on the target branch after the merge.
69
+
70
+ 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.
71
+
72
+ When merging to `master`:
73
+
74
+ ```
75
+ # Post-merge Steps
76
+
77
+ Perform these steps prior to pushing to master or the build will be broke on master.
78
+
79
+ ## Version
80
+ - [ ] Edit `lib/metasploit/concern/version.rb`
81
+ - [ ] Remove `PRERELEASE` and its comment as `PRERELEASE` is not defined on master.
82
+
83
+ ## Gem build
84
+ - [ ] gem build *.gemspec
85
+ - [ ] VERIFY the gem has no '.pre' version suffix.
86
+
87
+ ## RSpec
88
+ - [ ] `rake spec`
89
+ - [ ] VERIFY version examples pass without failures
90
+
91
+ ## Commit & Push
92
+ - [ ] `git commit -a`
93
+ - [ ] `git push origin master`
94
+ ```
95
+
96
+ When merging to DESTINATION other than `master`:
97
+
98
+ ```
99
+ # Post-merge Steps
100
+
101
+ Perform these steps prior to pushing to DESTINATION or the build will be broke on DESTINATION.
102
+
103
+ ## Version
104
+ - [ ] Edit `lib/metasploit/concern/version.rb`
105
+ - [ ] Change `PRERELEASE` from `SOURCE_SUMMARY` to `DESTINATION_SUMMARY` to match the branch (DESTINATION) summary (DESTINATION_SUMMARY)
106
+
107
+ ## Gem build
108
+ - [ ] gem build *.gemspec
109
+ - [ ] VERIFY the prerelease suffix has change on the gem.
110
+
111
+ ## RSpec
112
+ - [ ] `rake spec`
113
+ - [ ] VERIFY version examples pass without failures
114
+
115
+ ## Commit & Push
116
+ - [ ] `git commit -a`
117
+ - [ ] `git push origin DESTINATION`
118
+ ```
119
+
120
+ * Add a 'Release Steps' comment
121
+
122
+ The 'Release Steps' are a reminder to the reviewer of the Pull Request of how to release the gem.
123
+
124
+ ```
125
+ # Release
126
+
127
+ Complete these steps on DESTINATION
128
+
129
+ ## `VERSION`
130
+
131
+ ### Compatible changes
132
+
133
+ If your change are compatible with the previous branch's API, then increment [`PATCH`](lib/metasploit/concern/version.rb).
134
+
135
+ ### Incompatible changes
136
+
137
+ If your changes are incompatible with the previous branch's API, then increment [`MINOR`](lib/metasploit/concern/version.rb) and reset [`PATCH`](lib/metasploit/concern/version.rb) to `0`.
138
+
139
+ - [ ] Following the rules for [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html), update [`MINOR`](lib/metasploit/concern/version.rb) and [`PATCH`](lib/metasploit/concern/version.rb) and commit the changes.
140
+
141
+ ## MRI Ruby
142
+ - [ ] `rvm use ruby-1.9.3@metasploit-concern`
143
+ - [ ] `rm Gemfile.lock`
144
+ - [ ] `bundle install`
145
+ - [ ] `rake release`
146
+ ```
147
+
148
+ ### Downstream dependencies
149
+
150
+ When releasing new versions, the following projects may need to be updated:
151
+
152
+ * [metasploit_data_models](https://github.com/rapid7/metasploit_data_models)
153
+ * [metasploit-credential](https://github.com/rapid7/metasploit-credential)
154
+ * [metasploit-framework](https://github.com/rapid7/metasploit-framework)
155
+ * [metasploit-pro-ui](https://github.com/rapid7/pro/tree/master/ui)
156
+ * [metasploit-pro-engine](https://github.com/rapid7/pro/tree/master/engine)
157
+ * [firewall_egress](https://github.com/rapid7/pro/tree/master/metamodules/firewall_egress)
data/README.md CHANGED
@@ -1,14 +1,10 @@
1
1
  # Metasploit::Concern [![Build Status](https://travis-ci.org/rapid7/metasploit-concern.png)](https://travis-ci.org/rapid7/metasploit-concern)[![Code Climate](https://codeclimate.com/github/rapid7/metasploit-concern.png)](https://codeclimate.com/github/rapid7/metasploit-concern)[![Coverage Status](https://coveralls.io/repos/rapid7/metasploit-concern/badge.png)](https://coveralls.io/r/rapid7/metasploit-concern)[![Dependency Status](https://gemnasium.com/rapid7/metasploit-concern.png)](https://gemnasium.com/rapid7/metasploit-concern)[![Gem Version](https://badge.fury.io/rb/metasploit-concern.png)](http://badge.fury.io/rb/metasploit-concern)
2
2
 
3
- `Metasploit::Concern` allows you to define concerns in `app/concerns` that will automatically be included in matching
4
- classes. It can be used to automate adding new associations to `ActiveRecord::Base` models from gems and
5
- `Rails::Engine`s.
3
+ `Metasploit::Concern` allows you to define concerns in `app/concerns` that will automatically be included in matching classes. It can be used to automate adding new associations to `ActiveRecord::Base` models from gems and `Rails::Engine`s.
6
4
 
7
5
  ## Versioning
8
6
 
9
- `Metasploit::Concern` is versioned using [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html). Each branch
10
- should set `Metasploit::Concern::Version::PRERELEASE` to the branch name, while master should have no `PRERELEASE`
11
- and the `PRERELEASE` section of `Metasploit::Concern::VERSION` does not exist.
7
+ `Metasploit::Concern` is versioned using [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html). Each branch should set `Metasploit::Concern::Version::PRERELEASE` to the branch SUMMARY, while master should have no `PRERELEASE` and the `PRERELEASE` section of `Metasploit::Concern::VERSION` does not exist.
12
8
 
13
9
  ## Installation
14
10
 
@@ -26,12 +22,9 @@ Or install it yourself as:
26
22
 
27
23
  ## Supporting concerns
28
24
 
29
- `Metasploit::Concern` support is a cooperative effort that involves the classes from the gem being setup
30
- to allow downstream dependents to inject concerns.
25
+ `Metasploit::Concern` support is a cooperative effort that involves the classes from the gem being setup to allow downstream dependents to inject concerns.
31
26
 
32
- In order for `Metasploit::Concern` to load concerns for `app/concerns`, the class on which `Module#include` will be
33
- called must support `ActiveSupport` load hooks with a specific name format. You can run the appropriate load hooks
34
- at the bottom of the class body:
27
+ In order for `Metasploit::Concern` to load concerns for `app/concerns`, the class on which `Module#include` will be called must support `ActiveSupport` load hooks with a specific name format. You can run the appropriate load hooks at the bottom of the class body:
35
28
 
36
29
  class GemNamespace::GemClass < ActiveRecord::Base
37
30
  # class body
@@ -49,8 +42,7 @@ Include the shared examples from `Metasploit::Concern` in your `spec_helper.rb`:
49
42
  end
50
43
 
51
44
 
52
- To verify that your classes call `Metasploit::Concern.run` correctly, you can use the `'Metasploit::Concern.run'` shared
53
- example:
45
+ To verify that your classes call `Metasploit::Concern.run` correctly, you can use the `'Metasploit::Concern.run'` shared example:
54
46
 
55
47
  # spec/app/models/gem_namespace/gem_class_spec.rb
56
48
  describe GemNamespace::GemClass do
@@ -59,8 +51,7 @@ example:
59
51
 
60
52
  ## Using concerns
61
53
 
62
- Concerns are added in downstream dependents of gems that support concerns. These dependents can be a `Rails::Engines`
63
- or full `Rails::Application`.
54
+ Concerns are added in downstream dependents of gems that support concerns. These dependents can be a `Rails::Engines` or full `Rails::Application`.
64
55
 
65
56
  ### app/concerns
66
57
 
@@ -86,8 +77,7 @@ Add this line to your engine's class body:
86
77
 
87
78
  ### Concerns
88
79
 
89
- Define concerns for class under `app/concerns` by creating files under directories named after the namespaced class
90
- names:
80
+ Define concerns for class under `app/concerns` by creating files under directories named after the namespaced class names:
91
81
 
92
82
  $ mkdir -p app/concerns/gem_namespace/gem_class
93
83
  $ edit app/concerns/gem_namespace/gem_class/my_concern.rb
@@ -98,8 +88,7 @@ Inside each concern, make sure the `module` name matches file name:
98
88
  ...
99
89
  end
100
90
 
101
- Each concern is included using `Module#include` which means that the `included` method on each concern will be called.
102
- Using `ActiveSupport::Concern` allow you to add new associations and or validations to `ActiveRecord::Base` subclass:
91
+ Each concern is included using `Module#include` which means that the `included` method on each concern will be called. Using `ActiveSupport::Concern` allow you to add new associations and or validations to `ActiveRecord::Base` subclass:
103
92
 
104
93
  module GemNamespace::GemClass::MyConcern
105
94
  extend ActiveSupport::Concern
@@ -122,12 +111,14 @@ Using `ActiveSupport::Concern` allow you to add new associations and or validati
122
111
 
123
112
  ### initializers
124
113
 
125
- `Metasploit::Concern::Engine` defines the `'metasploit_concern.load_concerns'` initializer, which sets up
126
- `ActiveSupport.on_load` callbacks. If you depend on a feature from a concern in your initializers, it is best to have
127
- the initializer declare that it needs to be run after `'metasploit_concern.load_concerns`:
114
+ `Metasploit::Concern::Engine` defines the `'metasploit_concern.load_concerns'` initializer, which sets up `ActiveSupport.on_load` callbacks. If you depend on a feature from a concern in your initializers, it is best to have the initializer declare that it needs to be run after `'metasploit_concern.load_concerns`:
128
115
 
129
116
  initializer 'application_or_engine_namespace.depends_on_concerns', after: 'metasploit_concern.load_concerns' do
130
117
  if GemNamespace::GemClass.primary.widgets.empty?
131
118
  logger.info('No Widgets on the primary GemClass!')
132
119
  end
133
120
  end
121
+
122
+ ## Contributing
123
+
124
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
@@ -7,7 +7,7 @@ module Metasploit
7
7
  # The minor version number, scoped to the {MAJOR} version number.
8
8
  MINOR = 1
9
9
  # The patch number, scoped to the {MINOR} version number.
10
- PATCH = 0
10
+ PATCH = 1
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.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-concern
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Imhoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-05 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -39,14 +39,15 @@ executables: []
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
+ - CONTRIBUTING.md
43
+ - LICENSE
44
+ - README.md
45
+ - Rakefile
42
46
  - app/models/metasploit/concern/loader.rb
47
+ - lib/metasploit/concern.rb
43
48
  - lib/metasploit/concern/engine.rb
44
49
  - lib/metasploit/concern/version.rb
45
- - lib/metasploit/concern.rb
46
50
  - lib/tasks/yard.rake
47
- - LICENSE
48
- - Rakefile
49
- - README.md
50
51
  - spec/support/shared/examples/metasploit/concern/run.rb
51
52
  homepage: https://github.com/rapid7/metasploit-concern
52
53
  licenses:
@@ -68,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
69
  version: '0'
69
70
  requirements: []
70
71
  rubyforge_project:
71
- rubygems_version: 2.1.11
72
+ rubygems_version: 2.2.2
72
73
  signing_key:
73
74
  specification_version: 4
74
75
  summary: Automatically include Modules from app/concerns