opt_parse_validator 0.0.4 → 0.0.5

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: 5678c2f297029c0a3d0ec3ea1ac3d2f157094a15
4
- data.tar.gz: 12b48dfd8629f1a1acf285091482f26fd13f844c
3
+ metadata.gz: e4e1a583bd0dd3f0277825ac7f87a82c3bd7d937
4
+ data.tar.gz: d8af127e4a81cdc8995d55581b80f0958a87021b
5
5
  SHA512:
6
- metadata.gz: 241377f9af06dcb567346de9dc6279b77bb1d8784c32cdd79dfb3a12ee2e679f95c8e816a7818d9d1f0b1e13f1828fcb5fee18554cda956a8040860904e96925
7
- data.tar.gz: df11769ba241b98bb4e704de10a57cf85a7e253a7388d889241d2027f48659849395a256063aab59423f59be91294a81dc9808ccd51af539d1b1c1df14bc514a
6
+ metadata.gz: 3673cb2bb2ed1bd2209e7c57d8fddc79ab5d67b70563453049061400c307a1e90421abcf2583dc15697b75611601835291e2b8894dad66b2857466c6f4a29fcb
7
+ data.tar.gz: 695a17c09b549f96df4bd9cd7e16a993a690e6fc2072d9441d128892a473f71d4148c01a18bc4f4e918024f47ba969feec1e82c05ab7b7855025a1df17cc20dd
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  coverage
2
+ pkg
2
3
  Gemfile.lock
3
4
  *.gem
data/.rubocop.yml CHANGED
@@ -2,3 +2,5 @@ LineLength:
2
2
  Enabled: false
3
3
  MethodLength:
4
4
  Max: 20
5
+ Metrics/AbcSize:
6
+ Enabled: false
data/.travis.yml CHANGED
@@ -4,6 +4,10 @@ rvm:
4
4
  - 2.1.0
5
5
  - 2.1.1
6
6
  - 2.1.2
7
+ - 2.1.3
8
+ - 2.1.4
9
+ - 2.1.5
10
+ - 2.2.0
7
11
  - ruby-head
8
12
  matrix:
9
13
  allow_failures:
data/Gemfile CHANGED
@@ -2,5 +2,5 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :test do
5
- gem 'coveralls', require: false
5
+ gem 'coveralls', '~> 0.7', require: false
6
6
  end
data/LICENSE CHANGED
@@ -1,14 +1,19 @@
1
- Copyright (C) 2014 - WPScanTeam
1
+ Copyright (C) 2014-2015 - WPScanTeam
2
2
 
3
- This program is free software: you can redistribute it and/or modify
4
- it under the terms of the GNU General Public License as published by
5
- the Free Software Foundation, either version 3 of the License, or
6
- (at your option) any later version.
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
7
9
 
8
- This program is distributed in the hope that it will be useful,
9
- but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- GNU General Public License for more details.
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
12
 
13
- You should have received a copy of the GNU General Public License
14
- along with this program. If not, see <http://www.gnu.org/licenses/>.
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -65,7 +65,7 @@ module OptParseValidator
65
65
  option.each do |option_attr|
66
66
  if option_attr =~ /^--/
67
67
  return option_attr.gsub(/ .*$/, '')
68
- .gsub(/\[[^\]]+\]/, '')
68
+ .gsub(/\[[^\]]+\]/, '')
69
69
  end
70
70
  end
71
71
  nil
@@ -1,4 +1,4 @@
1
1
  # Gem Version
2
2
  module OptParseValidator
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.summary = 'Testing Gem'
15
15
  s.description = 'Testing Gem ...'
16
16
  s.homepage = 'https://github.com/wpscanteam/OptParseValidator'
17
- s.license = 'GPL-3.0'
17
+ s.license = 'MIT'
18
18
 
19
19
  s.files = `git ls-files -z`.split("\x0")
20
20
  s.executables = s.files.grep(/^bin\//) { |f| File.basename(f) }
@@ -23,10 +23,10 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_dependency 'addressable', '~> 2.3'
25
25
 
26
- s.add_development_dependency 'rake'
26
+ s.add_development_dependency 'rake', '~> 10.4'
27
27
  s.add_development_dependency 'rspec', '~> 3.1'
28
- s.add_development_dependency 'rspec-its'
28
+ s.add_development_dependency 'rspec-its', '~> 1.1'
29
29
  s.add_development_dependency 'bundler', '~> 1.6'
30
- s.add_development_dependency 'rubocop', '~> 0.26'
30
+ s.add_development_dependency 'rubocop', '~> 0.27'
31
31
  s.add_development_dependency 'simplecov', '~> 0.9'
32
32
  end
@@ -1,14 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptParser do
4
-
5
4
  subject(:parser) { described_class.new }
6
5
  let(:fixtures) { File.join(FIXTURES, 'options_file') }
7
6
  let(:default_file) { File.join(fixtures, 'default.json') }
8
7
  let(:override_file) { File.join(fixtures, 'override.yml') }
9
8
 
10
9
  describe '#load_options_files' do
11
-
12
10
  context 'when error' do
13
11
  before { parser.options_files << config_file }
14
12
 
@@ -165,5 +165,4 @@ describe OptParseValidator::OptBase do
165
165
  end
166
166
  end
167
167
  end
168
-
169
168
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptBoolean do
4
-
5
4
  subject(:opt) { described_class.new(['-b', '--bool BOOL']) }
6
5
 
7
6
  describe '#validate' do
@@ -32,5 +31,4 @@ describe OptParseValidator::OptBoolean do
32
31
  end
33
32
  end
34
33
  end
35
-
36
34
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptCredentials do
4
-
5
4
  subject(:opt) { described_class.new(['-l', '--login USERNAME:PASSWORD']) }
6
5
 
7
6
  describe '#validate' do
@@ -19,5 +18,4 @@ describe OptParseValidator::OptCredentials do
19
18
  end
20
19
  end
21
20
  end
22
-
23
21
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptDirectoryPath do
4
-
5
4
  subject(:opt) { described_class.new(['-d', '--dir DIR'], attrs) }
6
5
  let(:attrs) { {} }
7
6
  let(:dir) { File.join(FIXTURES, 'options_file') }
@@ -21,5 +20,4 @@ describe OptParseValidator::OptDirectoryPath do
21
20
  end
22
21
  end
23
22
  end
24
-
25
23
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptFilePath do
4
-
5
4
  subject(:opt) { described_class.new(['-f', '--file FILE_PATH'], attrs) }
6
5
  let(:attrs) { {} }
7
6
  let(:rwx_file) { File.join(FIXTURES, 'rwx.txt') }
@@ -89,5 +88,4 @@ describe OptParseValidator::OptFilePath do
89
88
  end
90
89
  end
91
90
  end
92
-
93
91
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptInteger do
4
-
5
4
  subject(:opt) { described_class.new(['-i', '--int INT']) }
6
5
 
7
6
  describe '#validate' do
@@ -15,5 +14,4 @@ describe OptParseValidator::OptInteger do
15
14
  expect(opt.validate('12')).to eq 12
16
15
  end
17
16
  end
18
-
19
17
  end
@@ -1,7 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptPath do
4
-
5
4
  # Everything is handled in OptFilePath & OptDirectoryPath
6
-
7
5
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptPositiveInteger do
4
-
5
4
  subject(:opt) { described_class.new(['-i', '--int INT']) }
6
5
 
7
6
  describe '#validate' do
@@ -15,5 +14,4 @@ describe OptParseValidator::OptPositiveInteger do
15
14
  expect(opt.validate('20')).to eq 20
16
15
  end
17
16
  end
18
-
19
17
  end
@@ -1,12 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptProxy do
4
-
5
4
  subject(:opt) { described_class.new(['--proxy PROXY'], attrs) }
6
5
  let(:attrs) { { protocols: %w(http https socks socks5 socks4) } }
7
6
 
8
7
  describe '#validate' do
9
8
  # Handled by OptURI
10
9
  end
11
-
12
10
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptURI do
4
-
5
4
  subject(:opt) { described_class.new(['-u', '--uri URI'], attrs) }
6
5
  let(:attrs) { {} }
7
6
 
@@ -71,5 +70,4 @@ describe OptParseValidator::OptURI do
71
70
  end
72
71
  end
73
72
  end
74
-
75
73
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptURL do
4
-
5
4
  subject(:opt) { described_class.new(['-u', '--url URL']) }
6
5
 
7
6
  describe '#validate' do
@@ -24,5 +23,4 @@ describe OptParseValidator::OptURL do
24
23
  expect(opt.validate(url)).to eq url
25
24
  end
26
25
  end
27
-
28
26
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OptParseValidator::OptParser do
4
-
5
4
  subject(:parser) { described_class.new }
6
5
  let(:verbose_opt) { OptParseValidator::OptBase.new(%w(-v --verbose)) }
7
6
  let(:url_opt) { OptParseValidator::OptURL.new(['-u', '--url URL'], required: true) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opt_parse_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam - Erwan le Rousseau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.4'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rspec-its
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.26'
89
+ version: '0.27'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.26'
96
+ version: '0.27'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +167,7 @@ files:
167
167
  - spec/spec_helper.rb
168
168
  homepage: https://github.com/wpscanteam/OptParseValidator
169
169
  licenses:
170
- - GPL-3.0
170
+ - MIT
171
171
  metadata: {}
172
172
  post_install_message:
173
173
  rdoc_options: []
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.2.2
188
+ rubygems_version: 2.4.5
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Testing Gem