metasploit-yard 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea5c31ba9a7ed3e254a753359bef4fef4f6190a9
4
- data.tar.gz: d384baa3a3eec34d4bbb0a95a21f003cbd6dd339
3
+ metadata.gz: a02787f924641dd181f86a16472332cd8dddaaa2
4
+ data.tar.gz: 69292652fe5eecd3062f4771ccab050843e2959f
5
5
  SHA512:
6
- metadata.gz: 2914d0f497e6de11c8f50dfc3b0c45620d69eaba635e15b2664f8b88c2010b4eb399d04f4544d4b1ce6bec8dbc5abe9cd77c6ba8fb4b9c8070599e15bfdb5732
7
- data.tar.gz: c25e494a404d9b393a14b727c602ce0e53ea6eec6e9a0f447f7c484d1476ce90cc42f2291f38e44847582e8a797ba41320fa48c10d813601ef7fdf5ef0004ab5
6
+ metadata.gz: 2d36aecd177cf29c9b853d7d87c26159232897ac4a20a6d88d73804538e0e16f928fe6615dcaa04ab77e65a1a915d42d3aaa0129a99b5567a3024993eb0a39f4
7
+ data.tar.gz: e487634a0c6d619e41c1f1c8cd97b1c4592adf9c530bf6dd6a37f90745acfe101d4c323adc5479b4d50442db200e4d48f6a661f8cbb731c7f010e16529cc9ce0
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ t��<JXRӞ�u�c��#�%�� 52����.1?�GI������y ���1��դ����w���+��n�Fi�b�`����檒��Ƃqp��.Nd� |�f���`�C�z��� U T �4�S�g��)��P���:)? ��hg�# � ����D܅up��_
2
+ �C
3
+ �z]�T�'�f�}W^ѥ�w�.� �I��%�A<�46�v�/@���%�H-�C�b���9n=�]��?-���� �rv,�����l/u/����u
data/.travis.yml CHANGED
@@ -1,19 +1,8 @@
1
- env:
2
- global:
3
- - secure: "IxVtzpee/XU/Qkw9g88uXX9GtQkzeUNVx05LYpfBuZWjQZWggrTp4k91HyquBNZkg30I5l7iHLbuhMB2c2SyNPN1OfkkhWZjeerJzRtaGDn7RXTAfdKUCtDceZPnl9Kv4Wbk6I2pVsXpROOP0VaPjLgod7aJqHfnw4AvP8yZbDg="
4
- matrix:
5
- - RAKE_TASK=cucumber
6
- - RAKE_TASK=spec
1
+ group: stable
2
+ sudo: false
7
3
  language: ruby
8
- matrix:
9
- # documentation coverage is not influenced by ruby implementation, so only run once
10
- include:
11
- - rvm: 2.1
12
- env: RAKE_TASK=yard:stats
13
4
  rvm:
14
- - '2.1'
15
- # jruby fails rake cucumber (see MSP-11240)
16
- # - 'jruby-19mode'
17
- script: "bundle exec rake $RAKE_TASK"
18
- addons:
19
- postgresql: '9.3'
5
+ - 2.2
6
+ before_install:
7
+ - gem update bundler
8
+ script: bundle exec rake spec cucumber yard
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in metasploit-yard.gemspec
4
4
  gemspec
5
+
6
+ gem "codeclimate-test-reporter", group: :test, require: nil
@@ -3,11 +3,13 @@ Feature: yard.rake
3
3
  In order to generate documentation for metasploit projects, but not end up with multiple actions for the `yard` rake tasks
4
4
  As a developer calling `rake yard`
5
5
  I want `yard.rake` loaded from `metasploit-yard`
6
-
6
+
7
+ @travis-ci-wip
7
8
  Scenario: Without Rails
8
9
  Given I create a clean gemset "without_rails_use_metasploit_yard"
9
10
  And I use gemset "without_rails_use_metasploit_yard"
10
- And I successfully run `bundle gem without_rails_use_metasploit_yard`
11
+ And I successfully run `gem install bundler`
12
+ And I successfully run `bundle gem without_rails_use_metasploit_yard --test=rspec`
11
13
  And I cd to "without_rails_use_metasploit_yard"
12
14
  And I overwrite "without_rails_use_metasploit_yard.gemspec" with:
13
15
  """
@@ -31,6 +33,7 @@ Feature: yard.rake
31
33
 
32
34
  spec.add_development_dependency 'bundler'
33
35
  spec.add_development_dependency 'rake'
36
+ spec.add_development_dependency 'rspec', '~> 3.0'
34
37
  spec.add_development_dependency 'metasploit-yard'
35
38
  end
36
39
  """
@@ -1,43 +1,16 @@
1
1
  module Metasploit
2
2
  module Yard
3
- # Holds components of {VERSION} as defined by {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0}.
4
- module Version
5
- # The major version number.
6
- MAJOR = 1
7
- # The minor version number, scoped to the {MAJOR} version number.
8
- MINOR = 0
9
- # The patch number, scoped to the {MINOR} version number.
10
- PATCH = 3
11
-
12
- # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the PRERELEASE in the
13
- # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
14
- #
15
- # @return [String] '{MAJOR}.{MINOR}.{PATCH}' on master. '{MAJOR}.{MINOR}.{PATCH}-PRERELEASE' on any branch
16
- # other than master.
17
- def self.full
18
- version = "#{MAJOR}.#{MINOR}.#{PATCH}"
19
-
20
- if defined? PRERELEASE
21
- version = "#{version}-#{PRERELEASE}"
22
- end
23
-
24
- version
25
- end
26
-
27
- # The full gem version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the PRERELEASE in the
28
- # {http://guides.rubygems.org/specification-reference/#version RubyGems versioning} format.
29
- #
30
- # @return [String] '{MAJOR}.{MINOR}.{PATCH}' on master. '{MAJOR}.{MINOR}.{PATCH}.PRERELEASE' on any branch
31
- # other than master.
32
- def self.gem
33
- full.gsub('-', '.pre.')
34
- end
3
+ # VERSION is managed by GemRelease
4
+ VERSION = '1.1.0'
5
+
6
+ # @return [String]
7
+ #
8
+ # returns the VERSION
9
+ #
10
+
11
+ def self.version
12
+ VERSION
35
13
  end
36
-
37
- # @see Version.gem
38
- GEM_VERSION = Version.gem
39
-
40
- # @see Version.full
41
- VERSION = Version.full
14
+
42
15
  end
43
16
  end
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
23
23
  # assert_valid_keys
24
24
  spec.add_development_dependency 'activesupport'
25
25
  spec.add_development_dependency 'aruba'
26
- spec.add_development_dependency 'bundler', '~> 1.5'
27
- spec.add_development_dependency 'codeclimate-test-reporter'
26
+ spec.add_development_dependency 'bundler'
27
+ # spec.add_development_dependency 'codeclimate-test-reporter'
28
28
  spec.add_development_dependency 'coveralls'
29
29
  spec.add_development_dependency 'cucumber'
30
30
  spec.add_development_dependency 'rspec', '~> 3.0'
@@ -8,7 +8,7 @@ RSpec.describe Metasploit::Yard do
8
8
  }
9
9
 
10
10
  it 'is Metasploit::Yard::Version.full' do
11
- expect(version).to eq(Metasploit::Yard::Version.full)
11
+ expect(version).to eq(Metasploit::Yard::version)
12
12
  end
13
13
  end
14
14
  end
data/spec/spec_helper.rb CHANGED
@@ -1,22 +1,19 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
 
3
3
  # require before 'metasploit/version' so coverage is shown for files required by 'metasploit/version'
4
- require 'codeclimate-test-reporter'
5
- require 'coveralls'
4
+ # require 'codeclimate-test-reporter'
5
+ # require 'coveralls'
6
6
  require 'simplecov'
7
7
 
8
- if ENV['TRAVIS'] == 'true'
9
- formatters = []
10
-
11
- # don't use `CodeClimate::TestReporter.start` as it will overwrite some .simplecov settings
12
- if CodeClimate::TestReporter.run?
13
- formatters << CodeClimate::TestReporter::Formatter
14
- end
15
-
8
+ # if ENV['TRAVIS'] == 'true'
9
+ # # don't generate local report as it is inaccessible on travis-ci, which is why coveralls is being used.
10
+ # SimpleCov.formatter = Coveralls::SimpleCov::Formatter
11
+ # else
16
12
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
17
- *formatters
13
+ # either generate the local report
14
+ SimpleCov::Formatter::HTMLFormatter
18
15
  ]
19
- end
16
+ # end
20
17
 
21
18
  require 'metasploit/yard'
22
19
 
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ i!f��?oWF
metadata CHANGED
@@ -1,14 +1,91 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Imhoff
8
8
  autorequire:
9
9
  b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Mi5n
79
+ bG9iYWxzaWduLmNvbS9nc2NvZGVzaWduZzIwHQYDVR0OBBYEFE536JwFx9SpaEi3
80
+ w8pcq2GRFA5BMB8GA1UdIwQYMBaAFAhu2Lacir/tPtfDdF3MgB+oL1B6MA0GCSqG
81
+ SIb3DQEBBQUAA4IBAQAGpGXHtFLjTTivV+xQPwtZhfPuJ7f+VGTMSAAYWmfzyHXM
82
+ YMFYUWJzSFcuVR2YfxtbS45P7U5Qopd7jBQ0Ygk5h2a+B5nE4+UlhHj665d0zpYM
83
+ 1eWndMaO6WBOYnqtNyi8Dqqc1foKZDNHEDggYhGso7OIBunup+N4sPL9PwQ3eYe6
84
+ mUu8z0E4GXYViaMPOFkqaYnoYgf2L+7L5zKYT4h/NE/P7kj7EbduHgy/v/aAIrNl
85
+ 2SpuQH+SWteq3NXkAmFEEqvLJQ4sbptZt8OP8ghL3pVAvZNFmww/YVszSkShSzcg
86
+ QdihYCSEL2drS2cFd50jBeq71sxUtxbv82DUa2b+
87
+ -----END CERTIFICATE-----
88
+ date: 2016-03-04 00:00:00.000000000 Z
12
89
  dependencies:
13
90
  - !ruby/object:Gem::Dependency
14
91
  name: activesupport
@@ -40,20 +117,6 @@ dependencies:
40
117
  version: '0'
41
118
  - !ruby/object:Gem::Dependency
42
119
  name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.5'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.5'
55
- - !ruby/object:Gem::Dependency
56
- name: codeclimate-test-reporter
57
120
  requirement: !ruby/object:Gem::Requirement
58
121
  requirements:
59
122
  - - ">="
@@ -202,7 +265,6 @@ files:
202
265
  - metasploit-yard.gemspec
203
266
  - spec/metasploit/yard/aruba/rvm_env/export_spec.rb
204
267
  - spec/metasploit/yard/aruba/rvm_env/prepend_spec.rb
205
- - spec/metasploit/yard/version_spec.rb
206
268
  - spec/metasploit/yard_spec.rb
207
269
  - spec/spec_helper.rb
208
270
  homepage: https://github.com/rapid7/
@@ -225,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
287
  version: '0'
226
288
  requirements: []
227
289
  rubyforge_project:
228
- rubygems_version: 2.4.3
290
+ rubygems_version: 2.4.8
229
291
  signing_key:
230
292
  specification_version: 4
231
293
  summary: yard rake tasks
@@ -236,7 +298,6 @@ test_files:
236
298
  - features/support/env.rb
237
299
  - spec/metasploit/yard/aruba/rvm_env/export_spec.rb
238
300
  - spec/metasploit/yard/aruba/rvm_env/prepend_spec.rb
239
- - spec/metasploit/yard/version_spec.rb
240
301
  - spec/metasploit/yard_spec.rb
241
302
  - spec/spec_helper.rb
242
303
  has_rdoc:
metadata.gz.sig ADDED
Binary file
@@ -1,143 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Metasploit::Yard::Version do
4
- context 'CONSTANTS' do
5
- context 'MAJOR' do
6
- subject(:major) do
7
- described_class::MAJOR
8
- end
9
-
10
- it { is_expected.to be_a Integer }
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.nil? || branch.empty?
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 = %r{\A(?:refs/remotes/)?(?<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
- expected_prerelease = match[:prerelease]
59
-
60
- expect(defined? described_class::PRERELEASE).not_to be_nil,
61
- "PRERELEASE should be defined as #{expected_prerelease.inspect}"
62
- expect(prerelease).to eq(expected_prerelease)
63
- end
64
- else
65
- tag_regex = /\Av(?<major>\d+).(?<minor>\d+).(?<patch>\d+)(\.pre\.(?<prerelease>.*))?\z/
66
- # travis-ci sets TRAVIS_BRANCH to the tag name for tag builds
67
- match = branch.match(tag_regex)
68
-
69
- if match
70
- tag_prerelease = match[:prerelease]
71
-
72
- if tag_prerelease
73
- it 'matches the tag prerelease converted from a gem version to a VERSION' do
74
- expect(prerelease).to eq(tag_prerelease.gsub('.pre.', '-'))
75
- end
76
- else
77
- it 'does not have a PRERELEASE' do
78
- expect(defined? described_class::PRERELEASE).to be_nil
79
- end
80
- end
81
- else
82
- it 'has a abbreviated reference that can be parsed for prerelease' do
83
- fail "Do not know how to parse #{branch.inspect} for PRERELEASE"
84
- end
85
- end
86
- end
87
- end
88
- end
89
- end
90
- end
91
-
92
- context 'full' do
93
- subject(:full) do
94
- described_class.full
95
- end
96
-
97
- #
98
- # lets
99
- #
100
-
101
- let(:major) do
102
- 1
103
- end
104
-
105
- let(:minor) do
106
- 2
107
- end
108
-
109
- let(:patch) do
110
- 3
111
- end
112
-
113
- before(:each) do
114
- stub_const("#{described_class}::MAJOR", major)
115
- stub_const("#{described_class}::MINOR", minor)
116
- stub_const("#{described_class}::PATCH", patch)
117
- end
118
-
119
- context 'with PRERELEASE' do
120
- let(:prerelease) do
121
- 'prerelease'
122
- end
123
-
124
- before(:each) do
125
- stub_const("#{described_class}::PRERELEASE", prerelease)
126
- end
127
-
128
- it 'is <major>.<minor>.<patch>-<prerelease>' do
129
- expect(full).to eq("#{major}.#{minor}.#{patch}-#{prerelease}")
130
- end
131
- end
132
-
133
- context 'without PRERELEASE' do
134
- before(:each) do
135
- hide_const("#{described_class}::PRERELEASE")
136
- end
137
-
138
- it 'is <major>.<minor>.<patch>' do
139
- expect(full).to eq("#{major}.#{minor}.#{patch}")
140
- end
141
- end
142
- end
143
- end