colsole 0.8.0 → 0.8.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
  SHA256:
3
- metadata.gz: 2fd26345db2525e6804965d0686301be91d7c27d9fe3894550a781e73e1c2f72
4
- data.tar.gz: f44de99c02442edeae3723d405be87fe29d845c130460ee16a23bf0aab254901
3
+ metadata.gz: e651768cb78375a765cc5913f545c5e133fb95ad7515bfdc95fffb14de74038e
4
+ data.tar.gz: 3406291b87c5ca7797f1f65729a37d7e371034ba39be79f831d811eb39003508
5
5
  SHA512:
6
- metadata.gz: ff6fb2074275bf9479ab0ba400bec991aa1d5972488c0c21c143ab012851733452aca15549278d770f8427c05ff5bcfad077f53c2649860ceb063934ebe0cba0
7
- data.tar.gz: 8bd0e29dc5216b94ade0bec78636122bf015bbe502061655312cf52aaecd4c3462bac97310bf4e5f35d7ad0a51ad9fe5f4093d806b36968b4597f9df3789574a
6
+ metadata.gz: 60fa6abaa7b8565c39d53d8a706af951b19968c283250aeee53768f382c1b8aead7e0fb0a1f2c6d9a3190f941606dd99e9214de176bbcfe786d0d9f85c5b1ff0
7
+ data.tar.gz: 64cc7706ef686d49b77b5eb9b2e303db7550c9466d409149075588b3aeee932415967f6040a156ef81d463129a186b51aaa7da010408e712ddd79291f11eb463
data/README.md CHANGED
@@ -20,7 +20,7 @@ Utility functions for colorful console applications.
20
20
  Add to your Gemfile:
21
21
 
22
22
  ```
23
- $ gem 'colsole', '>= 0.6.0', '< 2.0'
23
+ $ gem 'colsole', '>= 0.8.1', '< 2.0'
24
24
  ```
25
25
 
26
26
  ## Examples
@@ -154,8 +154,8 @@ Follow these steps to upgrade:
154
154
  # => Require a more flexible version
155
155
  # change this
156
156
  gem 'colsole'
157
- # to this (to avoid conflicts with other gems that require 0.x)
158
- gem 'colsole', '>= 0.6.0', '< 2.0'
157
+ # to this
158
+ gem 'colsole', '>= 0.8.1', '< 2.0'
159
159
 
160
160
  # => Remove 'say_status'
161
161
  # It will no longer be supported in 1.0.0
@@ -2,6 +2,10 @@
2
2
  # for compatibility with older versions of colsole.
3
3
  # Do not use these methods directly.
4
4
  module Colsole
5
+ def detect_terminal_size(*args)
6
+ terminal_size(*args)
7
+ end
8
+
5
9
  def old_colorize(text)
6
10
  reset = colors['txtrst']
7
11
  reset_called_last = true
@@ -1,3 +1,3 @@
1
1
  module Colsole
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
data/lib/colsole.rb CHANGED
@@ -143,8 +143,12 @@ private
143
143
  end
144
144
 
145
145
  def safe_get_tty_size(default = [80, 30])
146
- $stdout.winsize.reverse
147
- rescue Errno::ENOTTY
148
- default
146
+ return default unless IO.console
147
+
148
+ begin
149
+ IO.console.winsize.reverse
150
+ rescue Errno::ENOTTY
151
+ default
152
+ end
149
153
  end
150
154
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colsole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit