tty-screen 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0796330d2cffb4c8486e6648f98cbb37a56b0d89
4
- data.tar.gz: d1f15d6630f40dcda049190a07c431d6b750f161
3
+ metadata.gz: c9a45914d671f43b6dd8b242ac1d57003a6e6a86
4
+ data.tar.gz: 380d10c2230bf53b0e94da52e3f323cb45489623
5
5
  SHA512:
6
- metadata.gz: bca4c5c2e18579c49788196cf445b63bcb1b3ba4269e7e551f931181ff03e3a90a55f8c3a6ac959d4bb90914b69d61c878b309a4eabe51d30af3d6268d3c59d7
7
- data.tar.gz: ca7fd84dd32d005f9bdadb9d8fc69a7d0cacb42b57e4155aa3f6292ff89c582ac0de9bf0e029813000613823d1c2ed0df4a0044c29689495285e736c37336ba9
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 both on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.
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 = options.fetch(:output) { $stderr }
21
- @color = Color.new(output: @output)
22
- @size = Size.new(output: @output)
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
@@ -7,7 +7,8 @@ module TTY
7
7
  #
8
8
  # @api public
9
9
  def initialize(options = {})
10
- @output = options.fetch(:output) { $stderr }
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 $VERBOSE
42
+ warn 'no native curses support' if @verbose
42
43
  false
43
44
  end
44
45
 
@@ -7,7 +7,8 @@ module TTY
7
7
  #
8
8
  # @api public
9
9
  def initialize(options = {})
10
- @output = options.fetch(:output) { $stderr }
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 $VERBOSE
61
+ warn 'no native io/console support' if @verbose
61
62
  false
62
63
  end
63
64
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Screen
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.1"
6
6
  end # Screen
7
7
  end # TTY
@@ -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 both 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 both on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.}
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.0
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-09-12 00:00:00.000000000 Z
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 both on Linux, OS
28
- X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.
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 both on Linux, OS X
81
- and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.
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