lolcat 99.9.99 → 100.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lolcat/cat.rb +1 -1
- data/lib/lolcat/lol.rb +7 -3
- data/lib/lolcat/version.rb +1 -1
- data/lolcat.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b72ee3d0d7a3873a42aecbbecf8f29d26624ebb02aeeb69ef128bc7c8c8c0f7f
|
4
|
+
data.tar.gz: 81610c976556ff34818792488f0665bb81858ca92e329a9847b5e0b9ec131f16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf502c8b522fa33b3a423f8aac3e913f4320890200a32fe812f5b8b3acc0dbe295fc630f3655ee59e1954210c6581af014f2a70f4b094fb6d3d69a3dd1990671
|
7
|
+
data.tar.gz: c7f3748c1227083455ac5c2a14e5fe852b460fbd2f1918e6a854f5644220f0bbad763054566e1f36c9e144c0bf26292c76819ed2f7c9d234a4ce7c4c8c76c52b
|
data/lib/lolcat/cat.rb
CHANGED
data/lib/lolcat/lol.rb
CHANGED
@@ -30,8 +30,8 @@ module Lol
|
|
30
30
|
ANSI_ESCAPE = /((?:\e(?:[ -\/]+.|[\]PX^_][^\a\e]*|\[[0-?]*.|.))*)(.?)/m
|
31
31
|
INCOMPLETE_ESCAPE = /\e(?:[ -\/]*|[\]PX^_][^\a\e]*|\[[0-?]*)$/
|
32
32
|
|
33
|
-
@paint_detected_mode = Paint.detect_mode
|
34
33
|
@os = 0
|
34
|
+
@paint_init = false
|
35
35
|
|
36
36
|
def self.rainbow(freq, i)
|
37
37
|
red = Math.sin(freq*i + 0) * 127 + 128
|
@@ -41,6 +41,7 @@ module Lol
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.cat(fd, opts={})
|
44
|
+
@os = opts[:os]
|
44
45
|
print "\e[?25l" if opts[:animate]
|
45
46
|
while true do
|
46
47
|
buf = ''
|
@@ -77,7 +78,7 @@ module Lol
|
|
77
78
|
|
78
79
|
def self.println_plain(str, defaults={}, opts={}, chomped)
|
79
80
|
opts.merge!(defaults)
|
80
|
-
set_mode(opts[:truecolor])
|
81
|
+
set_mode(opts[:truecolor]) unless @paint_init
|
81
82
|
filtered = str.scan(ANSI_ESCAPE)
|
82
83
|
filtered.each_with_index do |c, i|
|
83
84
|
color = rainbow(opts[:freq], @os+i/opts[:spread])
|
@@ -112,7 +113,10 @@ module Lol
|
|
112
113
|
end
|
113
114
|
|
114
115
|
def self.set_mode(truecolor)
|
115
|
-
@paint_mode_detected
|
116
|
+
# @paint_mode_detected = Paint.mode
|
117
|
+
@paint_mode_detected = %w[truecolor 24bit].include?(ENV['COLORTERM']) ? 0xffffff : 256
|
116
118
|
Paint.mode = truecolor ? 0xffffff : @paint_mode_detected
|
119
|
+
STDERR.puts "DEBUG: Paint.mode = #{Paint.mode} (detected: #{@paint_mode_detected})" if ENV['LOLCAT_DEBUG']
|
120
|
+
@paint_init = true
|
117
121
|
end
|
118
122
|
end
|
data/lib/lolcat/version.rb
CHANGED
data/lolcat.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{Okay, no unicorns. But rainbows!!}
|
13
13
|
|
14
14
|
s.add_development_dependency "rake"
|
15
|
-
s.add_dependency "paint", "~> 2.
|
15
|
+
s.add_dependency "paint", "~> 2.1.0"
|
16
16
|
s.add_dependency "optimist", "~> 3.0.0"
|
17
17
|
s.add_dependency "manpages", "~> 0.6.1"
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 100.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: optimist
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|