tty-screen 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/tty/screen.rb +4 -3
- data/lib/tty/screen/color.rb +3 -2
- data/lib/tty/screen/size.rb +3 -2
- data/lib/tty/screen/version.rb +1 -1
- data/spec/unit/new_spec.rb +4 -4
- data/tty-screen.gemspec +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a45914d671f43b6dd8b242ac1d57003a6e6a86
|
4
|
+
data.tar.gz: 380d10c2230bf53b0e94da52e3f323cb45489623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0294b1abe4226e5bba7c5cf0c492f3f7ec3b17d621c97354cdfd3fa9b27c432816de89061e383c75ca96531f147b78bef38e9961a72755043c542e726f21608d
|
7
|
+
data.tar.gz: 2bc57d997c42befb89bcdde07fa4ac391ee0d953de5bfdfd37520743dc5d14aff945a30ec72fac7f3811a3343e813bb21ceb75657c9c2d75889bae72879d430f
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
[coverage]: https://coveralls.io/r/peter-murach/tty-screen
|
12
12
|
[inchpages]: http://inch-ci.org/github/peter-murach/tty-screen
|
13
13
|
|
14
|
-
> Terminal screen size and color detection which works
|
14
|
+
> Terminal screen size and color detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.
|
15
15
|
|
16
16
|
**TTY::Screen** provides independent screen size and color detection component for [TTY](https://github.com/peter-murach/tty) toolkit.
|
17
17
|
|
data/lib/tty/screen.rb
CHANGED
@@ -17,9 +17,10 @@ module TTY
|
|
17
17
|
#
|
18
18
|
# @api public
|
19
19
|
def initialize(options = {})
|
20
|
-
@output
|
21
|
-
@
|
22
|
-
@
|
20
|
+
@output = options.fetch(:output) { $stderr }
|
21
|
+
@verbose = options.fetch(:verbose) { false }
|
22
|
+
@color = Color.new(output: @output, verbose: @verbose)
|
23
|
+
@size = Size.new(output: @output, verbose: @verbose)
|
23
24
|
end
|
24
25
|
|
25
26
|
# @api public
|
data/lib/tty/screen/color.rb
CHANGED
@@ -7,7 +7,8 @@ module TTY
|
|
7
7
|
#
|
8
8
|
# @api public
|
9
9
|
def initialize(options = {})
|
10
|
-
@output
|
10
|
+
@output = options.fetch(:output) { $stderr }
|
11
|
+
@verbose = options.fetch(:verbose) { false }
|
11
12
|
end
|
12
13
|
|
13
14
|
# Detect if terminal supports color
|
@@ -38,7 +39,7 @@ module TTY
|
|
38
39
|
curses_class.close_screen
|
39
40
|
end
|
40
41
|
rescue LoadError
|
41
|
-
warn 'no native curses support' if
|
42
|
+
warn 'no native curses support' if @verbose
|
42
43
|
false
|
43
44
|
end
|
44
45
|
|
data/lib/tty/screen/size.rb
CHANGED
@@ -7,7 +7,8 @@ module TTY
|
|
7
7
|
#
|
8
8
|
# @api public
|
9
9
|
def initialize(options = {})
|
10
|
-
@output
|
10
|
+
@output = options.fetch(:output) { $stderr }
|
11
|
+
@verbose = options.fetch(:verbose) { false }
|
11
12
|
end
|
12
13
|
|
13
14
|
# Get terminal rows and columns
|
@@ -57,7 +58,7 @@ module TTY
|
|
57
58
|
false
|
58
59
|
end
|
59
60
|
rescue LoadError
|
60
|
-
warn 'no native io/console support' if
|
61
|
+
warn 'no native io/console support' if @verbose
|
61
62
|
false
|
62
63
|
end
|
63
64
|
end
|
data/lib/tty/screen/version.rb
CHANGED
data/spec/unit/new_spec.rb
CHANGED
@@ -6,13 +6,13 @@ RSpec.describe TTY::Screen, '.new' do
|
|
6
6
|
let(:output) { StringIO.new('', 'w+') }
|
7
7
|
|
8
8
|
it "initializes size and color detection" do
|
9
|
-
allow(TTY::Screen::Color).to receive(:new).with(output: output)
|
10
|
-
allow(TTY::Screen::Size).to receive(:new).with(output: output)
|
9
|
+
allow(TTY::Screen::Color).to receive(:new).with(output: output, verbose: false)
|
10
|
+
allow(TTY::Screen::Size).to receive(:new).with(output: output, verbose: false)
|
11
11
|
|
12
12
|
TTY::Screen.new(output: output)
|
13
13
|
|
14
|
-
expect(TTY::Screen::Color).to have_received(:new).with(output: output)
|
15
|
-
expect(TTY::Screen::Size).to have_received(:new).with(output: output)
|
14
|
+
expect(TTY::Screen::Color).to have_received(:new).with(output: output, verbose: false)
|
15
|
+
expect(TTY::Screen::Size).to have_received(:new).with(output: output, verbose: false)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "delegates size call" do
|
data/tty-screen.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = TTY::Screen::VERSION
|
9
9
|
spec.authors = ["Piotr Murach"]
|
10
10
|
spec.email = [""]
|
11
|
-
spec.summary = %q{Terminal screen size and color detection which works
|
12
|
-
spec.description = %q{Terminal screen size and color detection which works
|
13
|
-
spec.homepage = ""
|
11
|
+
spec.summary = %q{Terminal screen size and color detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.}
|
12
|
+
spec.description = %q{Terminal screen size and color detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.}
|
13
|
+
spec.homepage = "http://peter-murach.github.io/tty/"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-screen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.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: 2015-
|
11
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,8 +24,8 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
|
-
description: Terminal screen size and color detection which works
|
28
|
-
|
27
|
+
description: Terminal screen size and color detection which works on Linux, OS X and
|
28
|
+
Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.
|
29
29
|
email:
|
30
30
|
- ''
|
31
31
|
executables: []
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- tasks/coverage.rake
|
55
55
|
- tasks/spec.rake
|
56
56
|
- tty-screen.gemspec
|
57
|
-
homepage:
|
57
|
+
homepage: http://peter-murach.github.io/tty/
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
60
|
metadata: {}
|
@@ -77,8 +77,8 @@ rubyforge_project:
|
|
77
77
|
rubygems_version: 2.0.3
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
|
-
summary: Terminal screen size and color detection which works
|
81
|
-
|
80
|
+
summary: Terminal screen size and color detection which works on Linux, OS X and Windows/Cygwin
|
81
|
+
platforms and supports MRI, JRuby and Rubinius interpreters.
|
82
82
|
test_files:
|
83
83
|
- spec/spec_helper.rb
|
84
84
|
- spec/unit/color_spec.rb
|