tty-which 0.2.0 → 0.2.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: b8ba3f124a38b56e73d335461e3871125afb27c9
4
- data.tar.gz: 99374a1a7f27cf4250bf0c2f174a7502fc961dd0
3
+ metadata.gz: 151c7873c6f30a3dea98dce52cb8ad99263fe09b
4
+ data.tar.gz: 4d5f8aec64c53390ace2011ff4e4803330d291f0
5
5
  SHA512:
6
- metadata.gz: a1cba33feb5370384091a94eae956413e9fbab13459bda4c1cf7f91a3bec7e3248ae783f0947d46e48b3fa1b8fa04f9b0c260f442bf941407a081b45dcaebe2f
7
- data.tar.gz: 1c757f67ba1e85ecbda97e8473fbe4145c8284988cae873b66723565942984a18dd16ba86d7ad28ff24f1802f1cf91bd91ad6f737cffdb98dbeb8f2d939aa64b
6
+ metadata.gz: 63c52e82342d6457a5beeab9cbae39ab9c9cce17142145d2a7556fd5152bbfe16a4b6134be86cdc726533c81b0376f97efec2f68e8350844b805744aea29cbe3
7
+ data.tar.gz: 7dd39ec6fbbc137903fbbf45c5e4d4ada8c70a3e32210a4f27eef77c6a1992bd71b71d6a7a30006a0afb42dd43a8c5ea8ffeb4923454ef105b6ae3ea46cce759
@@ -4,20 +4,20 @@ sudo: false
4
4
  cache: bundler
5
5
  script: "bundle exec rake ci"
6
6
  rvm:
7
- - 1.9
8
- - 2.0
9
- - 2.1
10
- - 2.2
11
- - 2.3.0
7
+ - 1.9.3
8
+ - 2.0.0
9
+ - 2.1.10
10
+ - 2.2.5
11
+ - 2.3.1
12
12
  - ruby-head
13
+ - jruby-9000
14
+ - jruby-head
13
15
  - rbx-2
14
- - jruby-19mode
15
16
  matrix:
16
- include:
17
- - rvm: jruby-head
18
17
  allow_failures:
19
18
  - rvm: ruby-head
20
19
  - rvm: jruby-head
20
+ - rvm: rbx-2
21
21
  fast_finish: true
22
22
  branches:
23
23
  only: master
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.2.1] - 2015-12-26
4
+
5
+ ### Changed
6
+ * Change to stop shadowing path var in Which#search_paths
7
+
3
8
  ## [v0.2.0] - 2016-07-01
4
9
 
5
10
  ### Added
@@ -17,5 +22,6 @@
17
22
 
18
23
  * Initial implementation and release
19
24
 
25
+ [v0.2.1]: https://github.com/piotrmurach/tty-which/compare/v0.2.0...v0.2.1
20
26
  [v0.2.0]: https://github.com/piotrmurach/tty-which/compare/v0.1.0...v0.2.0
21
27
  [v0.1.0]: https://github.com/piotrmurach/tty-which/compare/v0.1.0
data/Gemfile CHANGED
@@ -11,4 +11,5 @@ group :metrics do
11
11
  gem 'coveralls', '~> 0.8.13'
12
12
  gem 'simplecov', '~> 0.11.2'
13
13
  gem 'yardstick', '~> 0.9.9'
14
+ gem 'term-ansicolor', '=1.3.2'
14
15
  end
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # TTY::Which [![Gitter](https://badges.gitter.im/Join%20Chat.svg)][gitter]
2
2
  [![Gem Version](https://badge.fury.io/rb/tty-which.svg)][gem]
3
3
  [![Build Status](https://secure.travis-ci.org/piotrmurach/tty-which.svg?branch=master)][travis]
4
+ [![Build status](https://ci.appveyor.com/api/projects/status/2rpm67huf1nh98d0?svg=true)][appveyor]
4
5
  [![Code Climate](https://codeclimate.com/github/piotrmurach/tty-which/badges/gpa.svg)][codeclimate]
5
6
  [![Coverage Status](https://coveralls.io/repos/github/piotrmurach/tty-which/badge.svg?branch=master)][coveralls]
6
7
  [![Inline docs](http://inch-ci.org/github/piotrmurach/tty-which.svg?branch=master)][inchpages]
@@ -8,6 +9,7 @@
8
9
  [gitter]: https://gitter.im/piotrmurach/tty
9
10
  [gem]: http://badge.fury.io/rb/tty-which
10
11
  [travis]: http://travis-ci.org/piotrmurach/tty-which
12
+ [appveyor]: https://ci.appveyor.com/project/piotrmurach/tty-which
11
13
  [codeclimate]: https://codeclimate.com/github/piotrmurach/tty-which
12
14
  [coveralls]: https://coveralls.io/github/piotrmurach/tty-which
13
15
  [inchpages]: http://inch-ci.org/github/piotrmurach/tty-which
@@ -52,7 +54,7 @@ TTY::Which.which('/usr/bin/ruby') # => '/usr/bin/ruby'
52
54
  The `exist?` returns `true` if the executable exists in the path and `false` otherwise:
53
55
 
54
56
  ```ruby
55
- TTY::Which.exist?('ruby') # => ruby
57
+ TTY::Which.exist?('ruby') # => true
56
58
  ```
57
59
 
58
60
  ## Contributing
@@ -0,0 +1,23 @@
1
+ ---
2
+ install:
3
+ - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
+ - ruby --version
5
+ - gem --version
6
+ - bundle install
7
+ build: off
8
+ test_script:
9
+ - bundle exec rake ci
10
+ environment:
11
+ matrix:
12
+ - ruby_version: "193"
13
+ - ruby_version: "200"
14
+ - ruby_version: "200-x64"
15
+ - ruby_version: "21"
16
+ - ruby_version: "21-x64"
17
+ - ruby_version: "22"
18
+ - ruby_version: "22-x64"
19
+ - ruby_version: "23"
20
+ - ruby_version: "23-x64"
21
+ matrix:
22
+ allow_failures:
23
+ - ruby_version: "193"
@@ -79,7 +79,7 @@ module TTY
79
79
  else
80
80
  %w(/usr/local/bin /usr/ucb /usr/bin /bin)
81
81
  end
82
- paths.select { |path| Dir.exist?(path) }
82
+ paths.select(&Dir.method(:exist?))
83
83
  end
84
84
  module_function :search_paths
85
85
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  module Which
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end # Which
7
7
  end # TTY
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  RSpec.describe TTY::Which, '#search_paths' do
4
+ let(:path_sep) { File::PATH_SEPARATOR }
5
+
4
6
  it "defauls search paths" do
5
7
  allow(ENV).to receive(:[]).with('PATH').and_return([])
6
8
  allow(Dir).to receive(:exist?).and_return(true)
@@ -10,19 +12,19 @@ RSpec.describe TTY::Which, '#search_paths' do
10
12
  end
11
13
 
12
14
  it "finds paths in path environment" do
13
- path = "/bin:/usr/bin:/usr/local/bin:/opt/local/bin"
15
+ paths = ['/bin', '/usr/bin', '/usr/local/bin', '/opt/local/bin']
16
+ path = paths.join(File::PATH_SEPARATOR)
14
17
  allow(ENV).to receive(:[]).with('PATH').and_return(path)
15
18
  allow(Dir).to receive(:exist?).and_return(true)
16
19
 
17
- expect(TTY::Which.search_paths).to eq([
18
- '/bin', '/usr/bin', '/usr/local/bin', '/opt/local/bin'])
20
+ expect(TTY::Which.search_paths).to eq(paths)
19
21
  end
20
22
 
21
23
  it "accepts paths to search as an argument" do
22
- path = "/bin:/usr/bin:/usr/local/bin:/opt/local/bin"
24
+ paths = ['/bin', '/usr/bin', '/usr/local/bin', '/opt/local/bin']
25
+ path = paths.join(File::PATH_SEPARATOR)
23
26
  allow(Dir).to receive(:exist?).and_return(true)
24
27
 
25
- expect(TTY::Which.search_paths(path)).to eq([
26
- '/bin', '/usr/bin', '/usr/local/bin', '/opt/local/bin'])
28
+ expect(TTY::Which.search_paths(path)).to eq(paths)
27
29
  end
28
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-which
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,6 +59,7 @@ files:
59
59
  - LICENSE.txt
60
60
  - README.md
61
61
  - Rakefile
62
+ - appveyor.yml
62
63
  - lib/tty-which.rb
63
64
  - lib/tty/which.rb
64
65
  - lib/tty/which/version.rb