hansi 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +1 -1
- data/lib/hansi/mode_detector.rb +1 -1
- data/lib/hansi/string_renderer.rb +1 -1
- data/lib/hansi/version.rb +1 -1
- data/spec/hansi/mode_detector_spec.rb +4 -4
- data/spec/hansi/string_renderer_spec.rb +1 -1
- data/spec/hansi_spec.rb +2 -2
- data/spec/support/coverage.rb +2 -2
- data/spec/support/render_matcher.rb +2 -2
- metadata +6 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eecc63dd6a8dd44eef2e3adff12781fd4251be36c7b3e1bf0829bde39dc70d98
|
4
|
+
data.tar.gz: a02be178af0cc07b69f91a71b50308a5612aabfc9177d5aacfcf65f9230d7b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85fabd99a040ab95a5ceda0900265af4f28cf6e34170e0fdfea239576b9c9e0093448d620fedc678a9b598693098d61ec470749801fd3e1557ce110e2aea60cc
|
7
|
+
data.tar.gz: '097c68e3cf912f5e7869e34aec70f7235b2334fcffadc544b65a5c7cb20c05f680590b62e7710ea9f21a512e18b140858894bbf2cc6f2a76c299b189094ef234'
|
data/.travis.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
rvm: [2.0.0, 2.1.5]
|
1
|
+
rvm: [2.0.0, 2.1.5, 3.1.1]
|
2
2
|
script: bundle exec rspec
|
data/lib/hansi/mode_detector.rb
CHANGED
@@ -28,7 +28,7 @@ module Hansi
|
|
28
28
|
]
|
29
29
|
|
30
30
|
attr_reader :env, :supported, :io
|
31
|
-
def initialize(env
|
31
|
+
def initialize(env, shell_out: nil, io: nil, supported: [0, 8, 16, 88, 256, Hansi::TRUE_COLOR])
|
32
32
|
shell_out = true if shell_out.nil? and env == ENV
|
33
33
|
io = $stdout if io.nil? and env == ENV
|
34
34
|
@env, @shell_out, @supported , @io = env, shell_out, supported, io
|
data/lib/hansi/version.rb
CHANGED
@@ -14,22 +14,22 @@ describe Hansi::ModeDetector do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
example do
|
17
|
-
detector = Hansi::ModeDetector.new('TERM' => 'xterm')
|
17
|
+
detector = Hansi::ModeDetector.new({'TERM' => 'xterm'})
|
18
18
|
expect(detector.mode).to be == 16
|
19
19
|
end
|
20
20
|
|
21
21
|
example do
|
22
|
-
detector = Hansi::ModeDetector.new('TERM' => 'footerm-256color')
|
22
|
+
detector = Hansi::ModeDetector.new({'TERM' => 'footerm-256color'})
|
23
23
|
expect(detector.mode).to be == 256
|
24
24
|
end
|
25
25
|
|
26
26
|
example do
|
27
|
-
detector = Hansi::ModeDetector.new('TERM' => 'footerm+24bit')
|
27
|
+
detector = Hansi::ModeDetector.new({'TERM' => 'footerm+24bit'})
|
28
28
|
expect(detector.mode).to be == Hansi::TRUE_COLOR
|
29
29
|
end
|
30
30
|
|
31
31
|
example do
|
32
|
-
detector = Hansi::ModeDetector.new('TERM' => 'footerm+3byte')
|
32
|
+
detector = Hansi::ModeDetector.new({'TERM' => 'footerm+3byte'})
|
33
33
|
expect(detector.mode).to be == Hansi::TRUE_COLOR
|
34
34
|
end
|
35
35
|
end
|
@@ -15,7 +15,7 @@ describe Hansi::StringRenderer do
|
|
15
15
|
|
16
16
|
describe :escape do
|
17
17
|
context "special character" do
|
18
|
-
subject(:renderer) { Hansi::StringRenderer.new("*" => :bold) }
|
18
|
+
subject(:renderer) { Hansi::StringRenderer.new({"*" => :bold}) }
|
19
19
|
it { should escape("foo *bar*").as("foo \\*bar\\*") }
|
20
20
|
end
|
21
21
|
|
data/spec/hansi_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
describe Hansi do
|
2
2
|
describe :mode_for do
|
3
|
-
specify { Hansi.mode_for({})
|
4
|
-
specify { Hansi.mode_for('TERM' => 'footerm-256color') .should be == 256 }
|
3
|
+
specify { Hansi.mode_for({}) .should be == 0 }
|
4
|
+
specify { Hansi.mode_for({'TERM' => 'footerm-256color'}) .should be == 256 }
|
5
5
|
end
|
6
6
|
|
7
7
|
describe :color_names do
|
data/spec/support/coverage.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'simplecov'
|
2
2
|
require 'coveralls'
|
3
3
|
|
4
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
5
5
|
SimpleCov::Formatter::HTMLFormatter,
|
6
6
|
Coveralls::SimpleCov::Formatter
|
7
|
-
]
|
7
|
+
])
|
8
8
|
|
9
9
|
SimpleCov.start do
|
10
10
|
project_name 'hansi'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hansi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tool
|
@@ -112,7 +112,7 @@ homepage: https://github.com/rkh/hansi
|
|
112
112
|
licenses:
|
113
113
|
- MIT
|
114
114
|
metadata: {}
|
115
|
-
post_install_message:
|
115
|
+
post_install_message:
|
116
116
|
rdoc_options: []
|
117
117
|
require_paths:
|
118
118
|
- lib
|
@@ -127,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
|
131
|
-
|
132
|
-
signing_key:
|
130
|
+
rubygems_version: 3.3.7
|
131
|
+
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: Hipster ANSI color library
|
135
134
|
test_files:
|
@@ -148,4 +147,3 @@ test_files:
|
|
148
147
|
- spec/support/escape_matcher.rb
|
149
148
|
- spec/support/parse_matcher.rb
|
150
149
|
- spec/support/render_matcher.rb
|
151
|
-
has_rdoc:
|