hansi 0.1.1 → 0.2.0
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 +4 -4
- data/lib/hansi/mode_detector.rb +5 -4
- data/lib/hansi/theme.rb +1 -1
- data/lib/hansi/version.rb +1 -1
- data/spec/hansi/color_spec.rb +1 -1
- data/spec/hansi/theme_spec.rb +8 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e5bd3afa496d114756e45864aecb904d1d5137d
|
4
|
+
data.tar.gz: d6443b78a92ca5bfdad880b1a611bf96f399f63e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2929ffe924bd5c1a1dd7e2c0bc7e0fb0557c396eccac7814afb6805dc258814f5509c7a059ba079ef29c4d2dc1021e84e3244746aa27c89d55331e2254b27ce1
|
7
|
+
data.tar.gz: 29510590850dc6f444bcff2a33acc001467c53459199306a100ea2271c4a6cfc8607c20d17d6876ce821b109818c73c402f148cdbda0dbe61f00dd9d1a369e24
|
data/lib/hansi/mode_detector.rb
CHANGED
@@ -65,7 +65,7 @@ module Hansi
|
|
65
65
|
else TERMS.keys.detect { |key| TERMS[key].include? term }
|
66
66
|
end
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def from_xterm
|
70
70
|
terminal_command ? 256 : 16
|
71
71
|
end
|
@@ -119,9 +119,10 @@ module Hansi
|
|
119
119
|
|
120
120
|
def iterm_version
|
121
121
|
@iterm_version ||= env['TERM_PROGRAM_VERSION']
|
122
|
-
@iterm_version ||= if shell_out? and iterm_path = commands.detect { |c| c["
|
123
|
-
|
124
|
-
|
122
|
+
@iterm_version ||= if shell_out? and iterm_path = commands.detect { |c| c["Contents/MacOS/iTerm"] }
|
123
|
+
iterm_path = iterm_path[/^(.*) [^ ]+$/, 1] while iterm_path and not File.exist?(iterm_path)
|
124
|
+
info_path = File.expand_path('../../Info.plist', iterm_path)
|
125
|
+
`defaults read #{Shellwords.escape(info_path)} CFBundleVersion`.chomp if File.exist?(info_path) and system 'which defaults >/dev/null'
|
125
126
|
end
|
126
127
|
rescue Errno::ENOENT
|
127
128
|
end
|
data/lib/hansi/theme.rb
CHANGED
data/lib/hansi/version.rb
CHANGED
data/spec/hansi/color_spec.rb
CHANGED
@@ -40,7 +40,7 @@ describe Hansi::Color do
|
|
40
40
|
specify { color.to_ansi(mode: Hansi::TRUE_COLOR) .should be == "\e[38;2;255;0;0m" }
|
41
41
|
|
42
42
|
specify "unknown mode" do
|
43
|
-
expect { color.to_ansi(mode: 99) }.to raise_error
|
43
|
+
expect { color.to_ansi(mode: 99) }.to raise_error(ArgumentError)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/spec/hansi/theme_spec.rb
CHANGED
@@ -17,6 +17,13 @@ describe Hansi::Theme do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
describe :merge do
|
21
|
+
specify do
|
22
|
+
new_theme = theme.merge(foo: :baz)
|
23
|
+
expect(new_theme.rules).to include(foo: :baz)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
20
27
|
describe :hash do
|
21
28
|
specify { Hansi::Theme[:default].hash.should be == Hansi::Theme[{}].hash }
|
22
29
|
end
|
@@ -33,4 +40,4 @@ describe Hansi::Theme do
|
|
33
40
|
specify { theme.to_css .should be == ".foo, .bar {\n color: #ff0000;\n}\n" }
|
34
41
|
specify { theme.to_css { |name| "##{name}" } .should be == "#foo, #bar {\n color: #ff0000;\n}\n" }
|
35
42
|
end
|
36
|
-
end
|
43
|
+
end
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tool
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.4.
|
131
|
+
rubygems_version: 2.4.4
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Hipster ANSI color library
|