tty-pager 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/tty/pager/system.rb +2 -2
- data/lib/tty/pager/version.rb +1 -1
- data/spec/unit/system/available_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5005375da7beb72176a90dba5d2aedc542a8a8ed
|
4
|
+
data.tar.gz: 6a5f48ac0db0335659ead995c58b37e692d93536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cd7553bcac3e91f53f17d45c63ca55b8557118b9d6d81e1c0bd16c9eb81bfd29edf13717da7afc3b7d63f60e0136eb32f15b16a019123b8b49e4749914d446e
|
7
|
+
data.tar.gz: 6ef87daee98ff5591d114d09e047ab964fae90efa9621164a9eb468adf7618f991947d6ba313c9422aa1625deea1fc0a676a835c8abf4c56f9d9c4378e2a6c72
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.6.0] - 2017-03-19
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Change SystemPager to support piped git pagers by @JacobEvelyn
|
7
|
+
|
3
8
|
## [v0.5.0] - 2016-12-19
|
4
9
|
|
5
10
|
### Changed
|
@@ -23,6 +28,7 @@
|
|
23
28
|
### Changed
|
24
29
|
* Change SystemPager to correctly paginate inside a process.
|
25
30
|
|
31
|
+
[v0.6.0]: https://github.com/peter-murach/tty-prompt/compare/v0.5.0...v0.6.0
|
26
32
|
[v0.5.0]: https://github.com/peter-murach/tty-prompt/compare/v0.4.0...v0.5.0
|
27
33
|
[v0.4.0]: https://github.com/peter-murach/tty-prompt/compare/v0.3.0...v0.4.0
|
28
34
|
[v0.3.0]: https://github.com/peter-murach/tty-prompt/compare/v0.2.0...v0.3.0
|
data/README.md
CHANGED
data/lib/tty/pager/system.rb
CHANGED
@@ -22,7 +22,7 @@ module TTY
|
|
22
22
|
# @api public
|
23
23
|
def self.available(*commands)
|
24
24
|
commands = commands.empty? ? executables : commands
|
25
|
-
commands.compact.uniq.find { |cmd| command_exists?(cmd) }
|
25
|
+
commands.compact.uniq.find { |cmd| command_exists?(cmd.split.first) }
|
26
26
|
end
|
27
27
|
|
28
28
|
# Check if command is available
|
@@ -87,7 +87,7 @@ module TTY
|
|
87
87
|
# @api private
|
88
88
|
def self.executables
|
89
89
|
[ENV['GIT_PAGER'], ENV['PAGER'],
|
90
|
-
`git config --get-all core.pager
|
90
|
+
`git config --get-all core.pager`,
|
91
91
|
'less', 'more', 'cat', 'pager']
|
92
92
|
end
|
93
93
|
private_class_method :executables
|
data/lib/tty/pager/version.rb
CHANGED
@@ -27,4 +27,16 @@ RSpec.describe TTY::Pager::SystemPager, '#available' do
|
|
27
27
|
allow(pager).to receive(:available).with('less') { true }
|
28
28
|
expect(pager.available?('less')).to eq(true)
|
29
29
|
end
|
30
|
+
|
31
|
+
context "when given a multi-word executable" do
|
32
|
+
let(:execs) { ["diff-so-fancy | less --tabs=4 -RFX"] }
|
33
|
+
|
34
|
+
subject(:pager) { described_class }
|
35
|
+
|
36
|
+
it "finds the command" do
|
37
|
+
allow(pager).to receive(:executables).and_return(execs)
|
38
|
+
allow(pager).to receive(:command_exists?).with("diff-so-fancy") { true }
|
39
|
+
expect(pager.available).to eql(execs.first)
|
40
|
+
end
|
41
|
+
end
|
30
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-pager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-screen
|