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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/config.rb +1 -1
  3. data/lib/lit_cli.rb +21 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f467ef2808f341c61ebfa6ae5cbe7cbe354c4e9d2068aa8de96ee0e4b69175e
4
- data.tar.gz: 36cbff3ecfa9c4585e6a1fed552bbdc35f2ef7d8ef51890439dd333049cb9008
3
+ metadata.gz: a7edc257dc260a2ad0eccff8e71eff6217b0e89fde2acd7ea127500cefc58afb
4
+ data.tar.gz: 9f0726175f5f79794f96694e18bae016a819bffe66fed34226ad4ffa694adc1a
5
5
  SHA512:
6
- metadata.gz: caa0776bab81bc74a9c166e966f4fe12eabcd291e7147b036a6893520d083a0b1e2addde2ac76d3ff965f6cca629b6b2372ee154b47861c08cacf714bdae512d
7
- data.tar.gz: 9204b7bdec4d2365fc5b17d513df0cbea56d4051a59baa8e3182b22b0e07d7c7658b45cf18ed0d12b2cf1bfab207ecc6d8176a6a4d8ab190447df979cc759ab7
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'] == Time.now.to_i.to_s
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
- text = "🔥"
27
+ output = "🔥"
28
28
 
29
29
  # Time.
30
30
  time = LitCLI.format(Time.now().strftime("%k:%M"), color: :cyan)
31
- text << " #{time}"
31
+ output << " #{time}"
32
32
 
33
33
  # Status.
34
34
  config = @@config.statuses[status]
35
- text << LitCLI.format(" #{config[:icon]} #{status.to_s}", config)
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
- text << LitCLI.format(" #{config[:icon]} #{type.to_s}", config)
41
+ output << LitCLI.format(" #{config[:icon]} #{type.to_s}", config)
42
42
  else
43
- text << LitCLI.format(" #{type.to_s}", config)
43
+ output << LitCLI.format(" #{type.to_s}", config)
44
44
  end
45
45
  end
46
46
 
47
47
  # Context.
48
- text << LitCLI.format(" #{context}", styles: [:bold, :dim])
48
+ output << LitCLI.format(" #{context}", styles: [:bold, :dim])
49
49
 
50
50
  # Message.
51
- text << " #{message}"
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
- puts text
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.6.4
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-12 00:00:00.000000000 Z
11
+ date: 2021-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel