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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 853bfb8f0075aff67eea592c9564811fc2689c2142584d4546df10f988b38a16
4
- data.tar.gz: cdb17a584830bbe1544570ae9f698c84e4bcf189ea072241cfd2d2147c6a277a
3
+ metadata.gz: b72ee3d0d7a3873a42aecbbecf8f29d26624ebb02aeeb69ef128bc7c8c8c0f7f
4
+ data.tar.gz: 81610c976556ff34818792488f0665bb81858ca92e329a9847b5e0b9ec131f16
5
5
  SHA512:
6
- metadata.gz: 55146feb187759e83ee4b003993bb8b6c9fb641fc6eac51ccbb7c4c47fa1fb3581ff256ddabdced9d8eb5626f3da930021b810c3fae519f8940ce21affed5330
7
- data.tar.gz: 6e2f8904b618ef656c8d5f2954c519638af18694d26c31d5e8b676f022de4d167f379ad7d9459e8061bbe02038018f423f9f1550bcc0805affdfed4ca24a2c43
6
+ metadata.gz: bf502c8b522fa33b3a423f8aac3e913f4320890200a32fe812f5b8b3acc0dbe295fc630f3655ee59e1954210c6581af014f2a70f4b094fb6d3d69a3dd1990671
7
+ data.tar.gz: c7f3748c1227083455ac5c2a14e5fe852b460fbd2f1918e6a854f5644220f0bbad763054566e1f36c9e144c0bf26292c76819ed2f7c9d234a4ce7c4c8c76c52b
@@ -77,7 +77,7 @@ FOOTER
77
77
  opts = {
78
78
  :animate => false,
79
79
  :duration => 12,
80
- :os => rand(256),
80
+ :os => rand * 8192,
81
81
  :speed => 20,
82
82
  :spread => 8.0,
83
83
  :freq => 0.3
@@ -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 ||= Paint.mode
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
@@ -1,3 +1,3 @@
1
1
  module Lolcat
2
- VERSION = "99.9.99"
2
+ VERSION = "100.0.0"
3
3
  end
@@ -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.0.0"
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: 99.9.99
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-07-18 00:00:00.000000000 Z
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.0.0
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.0.0
40
+ version: 2.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: optimist
43
43
  requirement: !ruby/object:Gem::Requirement