lit-cli 0.6.4 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config.rb +1 -1
- data/lib/lit_cli.rb +21 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7edc257dc260a2ad0eccff8e71eff6217b0e89fde2acd7ea127500cefc58afb
|
4
|
+
data.tar.gz: 9f0726175f5f79794f96694e18bae016a819bffe66fed34226ad4ffa694adc1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 323f05467ab8cfa3c23d51fae4a738be4382e7a8d5bad44d9d9a2efc0376d6c139ee970792b35a9749226b913e308556209592d2ffb87318c14a6e6ae272d5b0
|
7
|
+
data.tar.gz: facde086d4de3198fbfef692367d4cb31be51e26445ea6527d4f31c6084872e3283d8d43c2c43569b33ac879c7ff764ab2c3281a593474eb6ba46d0829744991
|
data/lib/config.rb
CHANGED
@@ -72,7 +72,7 @@ module LitCLI
|
|
72
72
|
def cli_configure()
|
73
73
|
|
74
74
|
# Enable lit via the command line.
|
75
|
-
@enabled = true if ENV['LIT_ENABLED']
|
75
|
+
@enabled = true if ENV['LIT_ENABLED'].to_i >= (Time.now.to_i() - 1)
|
76
76
|
return unless @enabled
|
77
77
|
|
78
78
|
# Convert flag string to hash.
|
data/lib/lit_cli.rb
CHANGED
@@ -24,33 +24,46 @@ module LitCLI
|
|
24
24
|
alias 🔥 lit
|
25
25
|
|
26
26
|
def self.render(message, status, type, context)
|
27
|
-
|
27
|
+
output = "🔥"
|
28
28
|
|
29
29
|
# Time.
|
30
30
|
time = LitCLI.format(Time.now().strftime("%k:%M"), color: :cyan)
|
31
|
-
|
31
|
+
output << " #{time}"
|
32
32
|
|
33
33
|
# Status.
|
34
34
|
config = @@config.statuses[status]
|
35
|
-
|
35
|
+
output << LitCLI.format(" #{config[:icon]} #{status.to_s}", config)
|
36
36
|
|
37
37
|
# Type.
|
38
38
|
if !@@config.types.nil? && @@config.types.has_key?(type)
|
39
39
|
config = @@config.types[type]
|
40
40
|
if config.has_key? :icon
|
41
|
-
|
41
|
+
output << LitCLI.format(" #{config[:icon]} #{type.to_s}", config)
|
42
42
|
else
|
43
|
-
|
43
|
+
output << LitCLI.format(" #{type.to_s}", config)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
# Context.
|
48
|
-
|
48
|
+
output << LitCLI.format(" #{context}", styles: [:bold, :dim])
|
49
49
|
|
50
50
|
# Message.
|
51
|
-
|
51
|
+
while message.start_with?('^')
|
52
|
+
message.delete_prefix!('^').strip!
|
53
|
+
unless @@config.status || @@config.type
|
54
|
+
output = "\n" + output
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
while message.start_with?('>')
|
59
|
+
message.delete_prefix!('>').strip!
|
60
|
+
unless @@config.status || @@config.type
|
61
|
+
output = ' ' + output
|
62
|
+
end
|
63
|
+
end
|
52
64
|
|
53
|
-
|
65
|
+
output << " #{message}"
|
66
|
+
puts output
|
54
67
|
end
|
55
68
|
|
56
69
|
def self.step()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lit-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maedi Prichard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pastel
|