tty-color 0.5.1 → 0.5.2

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
  SHA256:
3
- metadata.gz: 7c6e945ee8b1d795a7eb4e01edb5a799157f265a6d6b8019038c62df16ebb462
4
- data.tar.gz: 6dedb67dfc1f2ebb5f11ec4c61fc1e0d7daf2cbf1135a2478ff6499f073772fe
3
+ metadata.gz: 0e15fe9b9cd238ffaf8dc33f932e1435ec56ce4c6c3f1074fe3a6dc0bdaa24a5
4
+ data.tar.gz: 298d8b7d999481827b971216d9189b933c11f7b20cbb745dc3b0c49de84e382f
5
5
  SHA512:
6
- metadata.gz: 04c8c4e58190b25d27f6706374faea7980df2d90437f910c4e61ace27b707e59279a6596f9bbaeaac52d4874dd1646621374539962b4fedff896c03d339b4695
7
- data.tar.gz: c0323f675e1580d5c2cae34178f012d259c01ceb7f369e2c9c2afd5bcc67dee388bd7a6dfe1e4a417e600a456b6643575338a53182186d310364bd60bd4964d4
6
+ metadata.gz: 7d821ce739f310a20759eb1297bf3c3c4079b0fb34b1102b927222d013c3eafe5bbbf74edd08084ff983f2ddcd52192d4b0e3f7d3d3c78bb081d5facc1e84dfb
7
+ data.tar.gz: 6dbe41556440dd9dea0f5329dc5a6384cc1ae7e7b968db341f58a781741867ea8169937c849a5c0dcc97ab88df0a88f5077bae9b43dea23dfdc8ff436b8d0856
@@ -1,5 +1,14 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.5.2] - 2020-08-09
4
+
5
+ ### Changed
6
+ * Change gemspec and remove bundler as dev dependency
7
+ * Change TTY::Color::Support to define verbose as keyword argument
8
+
9
+ ### Fix
10
+ * Fix gemspec metadata links by Igor Kapkov(@igas)
11
+
3
12
  ## [v0.5.1] - 2020-01-22
4
13
 
5
14
  ### Changed
@@ -64,6 +73,7 @@
64
73
 
65
74
  * Initial implementation and release
66
75
 
76
+ [v0.5.2]: https://github.com/piotrmurach/tty-color/compare/v0.5.1...v0.5.2
67
77
  [v0.5.1]: https://github.com/piotrmurach/tty-color/compare/v0.5.0...v0.5.1
68
78
  [v0.5.0]: https://github.com/piotrmurach/tty-color/compare/v0.4.3...v0.5.0
69
79
  [v0.4.3]: https://github.com/piotrmurach/tty-color/compare/v0.4.2...v0.4.3
data/README.md CHANGED
@@ -68,16 +68,20 @@ puts color?
68
68
 
69
69
  [tty-color-cli](https://github.com/piotrmurach/tty-color-cli) is a command line tool for the **TTY::Color**.
70
70
 
71
- To check if terminal supports colors do:
71
+ To check if terminal supports colors use `-s|--support`:
72
72
 
73
73
  ```bash
74
- color -s
74
+ tty-color -s
75
+ tty-color --support
76
+ # => true
75
77
  ```
76
78
 
77
- And to check color mode:
79
+ And to check color mode use `-m|--mode` option:
78
80
 
79
81
  ```bash
80
- color -m
82
+ tty-color -m
83
+ tty-color --mode
84
+ # => 256
81
85
  ```
82
86
 
83
87
  ## Development
@@ -1 +1 @@
1
- require 'tty/color'
1
+ require "tty/color"
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'color/support'
4
- require_relative 'color/mode'
5
- require_relative 'color/version'
3
+ require_relative "color/support"
4
+ require_relative "color/mode"
5
+ require_relative "color/version"
6
6
 
7
7
  module TTY
8
8
  # Responsible for checking terminal color support
@@ -50,7 +50,7 @@ module TTY
50
50
  #
51
51
  # @api private
52
52
  def from_term
53
- case @env['TERM']
53
+ case @env["TERM"]
54
54
  when /[\-\+](\d+)color/ then $1.to_i
55
55
  when /[\-\+](\d+)bit/ then 2 ** $1.to_i
56
56
  when TERM_256 then 256
@@ -8,9 +8,9 @@ module TTY
8
8
 
9
9
  # Initialize a color support
10
10
  # @api public
11
- def initialize(env, options = {})
11
+ def initialize(env, verbose: false)
12
12
  @env = env
13
- @verbose = options.fetch(:verbose) { false }
13
+ @verbose = verbose
14
14
  end
15
15
 
16
16
  # Detect if terminal supports color
@@ -33,8 +33,8 @@ module TTY
33
33
  #
34
34
  # @api private
35
35
  def from_term
36
- case @env['TERM']
37
- when 'dumb' then false
36
+ case @env["TERM"]
37
+ when "dumb" then false
38
38
  when /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i then true
39
39
  else NoValue
40
40
  end
@@ -67,7 +67,7 @@ module TTY
67
67
  def from_curses(curses_class = nil)
68
68
  return NoValue if TTY::Color.windows?
69
69
 
70
- require 'curses'
70
+ require "curses"
71
71
 
72
72
  if defined?(Curses)
73
73
  curses_class ||= Curses
@@ -78,7 +78,7 @@ module TTY
78
78
  end
79
79
  NoValue
80
80
  rescue LoadError
81
- warn 'no native curses support' if @verbose
81
+ warn "no native curses support" if @verbose
82
82
  NoValue
83
83
  end
84
84
  end # Support
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  module Color
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.2"
6
6
  end # Color
7
7
  end # TTY
metadata CHANGED
@@ -1,57 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-color
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2020-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.5.0
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.5.0
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.1'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.1'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - ">="
46
32
  - !ruby/object:Gem::Version
47
- version: '0'
33
+ version: '3.0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - ">="
53
39
  - !ruby/object:Gem::Version
54
- version: '0'
40
+ version: '3.0'
55
41
  description: Terminal color capabilities detection
56
42
  email:
57
43
  - piotr@piotrmurach.com
@@ -60,6 +46,7 @@ extensions: []
60
46
  extra_rdoc_files:
61
47
  - README.md
62
48
  - CHANGELOG.md
49
+ - LICENSE.txt
63
50
  files:
64
51
  - CHANGELOG.md
65
52
  - LICENSE.txt
@@ -74,11 +61,11 @@ licenses:
74
61
  - MIT
75
62
  metadata:
76
63
  allowed_push_host: https://rubygems.org
77
- bug_tracker_uri: https://github.com/piotrmurach/tty-prompt/issues
78
- changelog_uri: https://github.com/piotrmurach/tty-prompt/blob/master/CHANGELOG.md
79
- documentation_uri: https://www.rubydoc.info/gems/tty-prompt
64
+ bug_tracker_uri: https://github.com/piotrmurach/tty-color/issues
65
+ changelog_uri: https://github.com/piotrmurach/tty-color/blob/master/CHANGELOG.md
66
+ documentation_uri: https://www.rubydoc.info/gems/tty-color
80
67
  homepage_uri: https://ttytoolkit.org
81
- source_code_uri: https://github.com/piotrmurach/tty-prompt
68
+ source_code_uri: https://github.com/piotrmurach/tty-color
82
69
  post_install_message:
83
70
  rdoc_options: []
84
71
  require_paths: