lowered-expectations 1.0.0 → 1.0.1

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: 6fde866d7ef044f992d41ceaec599d76f457ec54
4
- data.tar.gz: 92dd27194ff2e1d6e8ae93908d711c66b0eb9684
3
+ metadata.gz: 5598c5def9d9ab355cb246c5c80823c222c3209d
4
+ data.tar.gz: 9c5c91fa08a995dc767d295ae281e9dc8cbcb3ae
5
5
  SHA512:
6
- metadata.gz: 84a7d7c280607d6c26eedabd8f0d3850a91f0276f79e6a565cbd202563ce7cc5273f7b673bf5eb31ca04915ef3b1c140cc4c79351cfed595f9322cbfc346e683
7
- data.tar.gz: 3711f07d56a348f6672ec29d2b3ca95b3a0973a2d610ab9b5c4e7c1475006741bed55397138c948d0c9b426f4a570599a8459c0b4637189f908d90df3fcfecb7
6
+ metadata.gz: 05321eb404425a6ce9858a6b11e4f8b0db99abad15a5aca106c6d181a26de3d83357c82ebb6c7a63e01d8bbaa7f3047c73e16bdfa1808b99e9caa031f2922536
7
+ data.tar.gz: e29aa87ce0365b2f6312a085a3ccbb08d1741cc38a6cac94293046d920ce9879d8c970cf777332096573f049a391e665e73cc5d11af55cf172bcf0e76830e6d5
@@ -108,11 +108,6 @@ SelfAssignment:
108
108
  SignalException:
109
109
  Enabled: false
110
110
 
111
- # Offense count: 53
112
- # Cop supports --auto-correct.
113
- SingleSpaceBeforeFirstArg:
114
- Enabled: false
115
-
116
111
  SpaceAroundOperators:
117
112
  Enabled: false
118
113
 
@@ -214,6 +209,9 @@ Style/EmptyLines:
214
209
  Style/EmptyLinesAroundAccessModifier:
215
210
  Enabled: false
216
211
 
212
+ Style/FrozenStringLiteralComment:
213
+ Enabled: false
214
+
217
215
  Style/GuardClause:
218
216
  Enabled: false
219
217
 
@@ -304,10 +302,6 @@ Style/NumericLiterals:
304
302
  Metrics/ParameterLists:
305
303
  Enabled: false
306
304
 
307
- Style/TrailingComma:
308
- # EnforcedStyleForMultiline: comma
309
- Enabled: false
310
-
311
305
  Metrics/CyclomaticComplexity:
312
306
  Enabled: false
313
307
 
@@ -0,0 +1,10 @@
1
+ Unless specified otherwise, all content copyright the respective contributors.
2
+
3
+ Including, but not limited to:
4
+
5
+ Ian Chesal
6
+ Derek Tamsen
7
+
8
+ For licensing information please see LICENSE. Copyright holders contributing to
9
+ this project agree to have their contributions licensed under the terms of the
10
+ LICENSE agreement.
data/Gemfile CHANGED
@@ -1,17 +1,12 @@
1
- # Copyright 2015 Ian Chesal
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  gemspec
4
+
5
+ group :development, :test do
6
+ gem "bundler", "~> 1.7"
7
+ gem "rake", "~> 10.4"
8
+ gem "rspec", "~> 3.0"
9
+ gem "rspec-mocks", "~> 3.0"
10
+ gem "rubocop", "~> 0.36"
11
+ gem "rubygems-tasks", "~> 0.2"
12
+ end
@@ -1,5 +1,11 @@
1
1
  # lowered-expectations Release Notes
2
2
 
3
+ ## 1.0.1
4
+
5
+ * Move development dependencies out of the gemspec into the gemfile.
6
+ * Fix spec and integration tests to look for specific raised error for `.which` method.
7
+ * Resolve `NameError` raise on checking path to see if command exists.
8
+
3
9
  ## 1.0.0
4
10
 
5
11
  * Our first release
data/Rakefile CHANGED
@@ -1,38 +1,3 @@
1
1
  # Encoding: utf-8
2
- # Copyright 2015 Ian Chesal
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- require 'rubocop/rake_task'
17
- require 'rspec/core/rake_task'
18
- require 'rake/clean'
19
-
20
- RuboCop::RakeTask.new(:lint)
21
-
2
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
22
3
  task :default => [:lint, 'test:spec']
23
-
24
- task :build => [:lint, 'test:spec', 'test:integration'] do
25
- sh "gem build --verbose lowered-expectations.gemspec"
26
- end
27
-
28
- namespace :test do
29
- RSpec::Core::RakeTask.new(:spec) do |t|
30
- t.pattern = Dir['spec/**/*_spec.rb'].reject{ |f| f['/integration'] }
31
- end
32
-
33
- RSpec::Core::RakeTask.new(:integration) do |t|
34
- t.pattern = "spec/integration/**/*_spec.rb"
35
- end
36
- end
37
-
38
- CLEAN.add FileList['lowered-expectations-*.gem']
@@ -1,23 +1,12 @@
1
1
  # Encoding: utf-8
2
- # Copyright 2015 Ian Chesal
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
2
  require 'rubygems/dependency'
16
3
  require 'open3'
17
4
  require 'shellwords'
18
5
  require 'pty'
19
6
 
20
7
  class LoweredExpectations
8
+ VERSION = '1.0.1'.freeze
9
+
21
10
  class VersionPatternError < StandardError
22
11
  end
23
12
 
@@ -44,7 +33,7 @@ class LoweredExpectations
44
33
  return exe if File.executable?(exe) && !File.directory?(exe)
45
34
  end
46
35
  end
47
- raise MissingExecutableError.new("#{executable} not found in #{ENV['PATH']}")
36
+ raise MissingExecutableError.new("#{cmd} not found in #{ENV['PATH']}")
48
37
  end
49
38
 
50
39
  def self.verify_version(version, pattern)
@@ -65,7 +54,7 @@ class LoweredExpectations
65
54
  while !r.eof?
66
55
  c = r.getc
67
56
  stdout << c
68
- $stdout.write "#{c}"
57
+ $stdout.write c.to_s
69
58
  end
70
59
  Process.wait(pid)
71
60
  end
@@ -1,24 +1,14 @@
1
1
  # Encoding: utf-8
2
- # Copyright 2015 Ian Chesal
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'lowered/expectations'
15
5
 
16
6
  Gem::Specification.new do |spec|
17
7
  spec.name = "lowered-expectations"
18
- spec.version = "1.0.0"
8
+ spec.version = LoweredExpectations::VERSION
19
9
  # For deploying alpha versions via Travis CI
20
10
  spec.version = "#{spec.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
21
- spec.authors = ["Ian Chesal"]
11
+ spec.authors = ["Ian Chesal", "Derek Tamsen"]
22
12
  spec.email = ["ian.chesal@gmail.com"]
23
13
  spec.summary = 'A library for testing versions of command line tools.'
24
14
  spec.description = <<-END
@@ -36,10 +26,4 @@ END
36
26
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
37
27
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
38
28
  spec.require_paths = ["lib"]
39
-
40
- spec.add_development_dependency "bundler", "~> 1.7"
41
- spec.add_development_dependency "rake", "~> 10.4"
42
- spec.add_development_dependency "rspec", "~> 3.0"
43
- spec.add_development_dependency "rspec-mocks", "~> 3.0"
44
- spec.add_development_dependency "rubocop", "~> 0.24"
45
29
  end
@@ -19,11 +19,11 @@ RSpec.describe LoweredExpectations do
19
19
 
20
20
  describe '.which' do
21
21
  it 'returns true when the executable is on the PATH' do
22
- expect(LoweredExpectations.which tool).to be_truthy
22
+ expect(LoweredExpectations.which(tool)).to be_truthy
23
23
  end
24
24
 
25
25
  it 'raises an error when the executable is not on the PATH' do
26
- expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error
26
+ expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error(LoweredExpectations::MissingExecutableError)
27
27
  end
28
28
  end
29
29
  end
@@ -44,22 +44,22 @@ Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL lib"
44
44
 
45
45
  describe '.which' do
46
46
  it 'returns true when the executable is on the PATH' do
47
- expect(LoweredExpectations.which tool).to be_truthy
47
+ expect(LoweredExpectations.which(tool)).to be_truthy
48
48
  end
49
49
 
50
50
  it 'raises an error when the executable is not on the PATH' do
51
- expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error
51
+ expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error(LoweredExpectations::MissingExecutableError)
52
52
  end
53
53
  end
54
54
 
55
55
  describe '.verify_version' do
56
56
  it 'returns true when the version string matches the version pattern' do
57
- expect(LoweredExpectations.verify_version version, '~> 0.1').to be_truthy
58
- expect(LoweredExpectations.verify_version version, '~> 0').to be_truthy
59
- expect(LoweredExpectations.verify_version version, '> 0.1.1').to be_truthy
60
- expect(LoweredExpectations.verify_version version, '< 1').to be_truthy
61
- expect(LoweredExpectations.verify_version version, '> 0').to be_truthy
62
- expect(LoweredExpectations.verify_version version, "= #{version}").to be_truthy
57
+ expect(LoweredExpectations.verify_version(version, '~> 0.1')).to be_truthy
58
+ expect(LoweredExpectations.verify_version(version, '~> 0')).to be_truthy
59
+ expect(LoweredExpectations.verify_version(version, '> 0.1.1')).to be_truthy
60
+ expect(LoweredExpectations.verify_version(version, '< 1')).to be_truthy
61
+ expect(LoweredExpectations.verify_version(version, '> 0')).to be_truthy
62
+ expect(LoweredExpectations.verify_version(version, "= #{version}")).to be_truthy
63
63
  end
64
64
 
65
65
  it 'raise an error when the version string does not match the version pattern' do
@@ -0,0 +1,3 @@
1
+ # Encoding: utf-8
2
+ require 'rake/clean'
3
+ CLEAN.add FileList['lowered-expectations-*.gem']
@@ -0,0 +1,12 @@
1
+ # Encoding: utf-8
2
+ require 'rspec/core/rake_task'
3
+ namespace :test do
4
+ RSpec::Core::RakeTask.new(:spec) do |t|
5
+ t.pattern = Dir['spec/**/*_spec.rb'].reject{ |f| f['/integration'] }
6
+ end
7
+
8
+ RSpec::Core::RakeTask.new(:integration) do |t|
9
+ t.pattern = "spec/integration/**/*_spec.rb"
10
+ end
11
+ end
12
+
@@ -0,0 +1,3 @@
1
+ # Encoding: utf-8
2
+ require 'rubocop/rake_task'
3
+ RuboCop::RakeTask.new(:lint)
@@ -0,0 +1,3 @@
1
+ # Encoding: utf-8
2
+ require 'rubygems/tasks'
3
+ Gem::Tasks.new
metadata CHANGED
@@ -1,85 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lowered-expectations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Chesal
8
+ - Derek Tamsen
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.7'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.7'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.4'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.4'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec-mocks
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.24'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.24'
12
+ date: 2016-02-02 00:00:00.000000000 Z
13
+ dependencies: []
83
14
  description: |
84
15
  A Ruby gem that lets you test for the presence of command line tools and ensure
85
16
  that you have a version of the tool that you know how to work with.
@@ -97,6 +28,7 @@ files:
97
28
  - ".rspec"
98
29
  - ".rubocop.yml"
99
30
  - ".travis.yml"
31
+ - COPYRIGHT
100
32
  - Gemfile
101
33
  - LICENSE
102
34
  - README.md
@@ -108,6 +40,10 @@ files:
108
40
  - spec/integration/lowered/expectations_integration_spec.rb
109
41
  - spec/lowered/expectations_spec.rb
110
42
  - spec/spec_helper.rb
43
+ - tasks/clean.rake
44
+ - tasks/rspec.rake
45
+ - tasks/rubocop.rake
46
+ - tasks/rubygems.rake
111
47
  homepage: https://github.com/ianchesal/loweredexpectations
112
48
  licenses:
113
49
  - Apache 2.0
@@ -128,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
64
  version: '0'
129
65
  requirements: []
130
66
  rubyforge_project:
131
- rubygems_version: 2.4.3
67
+ rubygems_version: 2.4.5
132
68
  signing_key:
133
69
  specification_version: 4
134
70
  summary: A library for testing versions of command line tools.