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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56d2ed8cb89440a27dd776970440c0153bb60c9e
4
- data.tar.gz: f6ccd5310563574e8513999c8abf0f7eef348eac
3
+ metadata.gz: 5005375da7beb72176a90dba5d2aedc542a8a8ed
4
+ data.tar.gz: 6a5f48ac0db0335659ead995c58b37e692d93536
5
5
  SHA512:
6
- metadata.gz: 43e545434d18c077488549e05d3e0bc2b7e26c6838f27fb4e630d70c7fe281ed0c4b61f697be70891535d8a6993bdaf5069a4212e6b1b81e438c650b91abd9be
7
- data.tar.gz: 79ad0cf1b7f4c0d90f4d36764104ced35e2f7a947198f8da3b4c7b4b55b7643491f9f63858c7510915bf77f4c1a9ace6d3c1789e74b8638791996a68248e9dbb
6
+ metadata.gz: 5cd7553bcac3e91f53f17d45c63ca55b8557118b9d6d81e1c0bd16c9eb81bfd29edf13717da7afc3b7d63f60e0136eb32f15b16a019123b8b49e4749914d446e
7
+ data.tar.gz: 6ef87daee98ff5591d114d09e047ab964fae90efa9621164a9eb468adf7618f991947d6ba313c9422aa1625deea1fc0a676a835c8abf4c56f9d9c4378e2a6c72
@@ -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
@@ -88,4 +88,4 @@ ENV['PAGER']='less'
88
88
 
89
89
  ## Copyright
90
90
 
91
- Copyright (c) 2015-2016 Piotr Murach. See LICENSE for further details.
91
+ Copyright (c) 2015-2017 Piotr Murach. See LICENSE for further details.
@@ -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`.split.first,
90
+ `git config --get-all core.pager`,
91
91
  'less', 'more', 'cat', 'pager']
92
92
  end
93
93
  private_class_method :executables
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Pager
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end # Pager
7
7
  end # TTY
@@ -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.5.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: 2016-12-19 00:00:00.000000000 Z
11
+ date: 2017-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-screen