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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0e5bd3afa496d114756e45864aecb904d1d5137d
4
- data.tar.gz: d6443b78a92ca5bfdad880b1a611bf96f399f63e
2
+ SHA256:
3
+ metadata.gz: eecc63dd6a8dd44eef2e3adff12781fd4251be36c7b3e1bf0829bde39dc70d98
4
+ data.tar.gz: a02be178af0cc07b69f91a71b50308a5612aabfc9177d5aacfcf65f9230d7b8d
5
5
  SHA512:
6
- metadata.gz: 2929ffe924bd5c1a1dd7e2c0bc7e0fb0557c396eccac7814afb6805dc258814f5509c7a059ba079ef29c4d2dc1021e84e3244746aa27c89d55331e2254b27ce1
7
- data.tar.gz: 29510590850dc6f444bcff2a33acc001467c53459199306a100ea2271c4a6cfc8607c20d17d6876ce821b109818c73c402f148cdbda0dbe61f00dd9d1a369e24
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
@@ -28,7 +28,7 @@ module Hansi
28
28
  ]
29
29
 
30
30
  attr_reader :env, :supported, :io
31
- def initialize(env , shell_out: nil, io: nil, supported: [0, 8, 16, 88, 256, Hansi::TRUE_COLOR])
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
@@ -35,7 +35,7 @@ module Hansi
35
35
  scanner = StringScanner.new(input)
36
36
  insert = true
37
37
  stack = []
38
- output = ""
38
+ output = String.new
39
39
 
40
40
  until scanner.eos?
41
41
  if scanner.scan(@simple)
data/lib/hansi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hansi
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -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({}) .should be == 0 }
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
@@ -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'
@@ -1,7 +1,7 @@
1
- RSpec::Matchers.define :render do |*args|
1
+ RSpec::Matchers.define :render do |*args, **options|
2
2
  match do |renderer|
3
3
  begin
4
- @rendered = renderer.render(*args)
4
+ @rendered = renderer.render(*args, **options)
5
5
  rescue Exception => e
6
6
  @exception = e
7
7
  false
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.0
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: 2016-03-01 00:00:00.000000000 Z
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
- rubyforge_project:
131
- rubygems_version: 2.4.4
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: