lit-cli 0.6.1 → 0.6.2

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/lit_cli.rb +4 -0
  3. data/lib/lit_pry.rb +13 -7
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39a417c815a30ecdf0e99aaa9aa47d22b4def3f2d891f6da1911414a7187a86b
4
- data.tar.gz: 5bb7af898274544027202aedb33d9428401044867ad0693ae6314b1c361c9418
3
+ metadata.gz: 865eec42e3e343a9432bc24ee852290159545a83c0d80c835555d3a7de965355
4
+ data.tar.gz: ca99ccd747ac4091e93d1e703183ea63f122ed46b6883bd24588ad0c6ccdf809
5
5
  SHA512:
6
- metadata.gz: 1b45c6ae31e1db4cf3ac3fd338e8a11df273618cd8aa8b7d870d3764c9ae86b472b5823504fec11956c33fcc7fe0ca044db544e6c872f167a9db7bbfeaf881b5
7
- data.tar.gz: 47a8560f08cbd269877dcd1a6bd14b718a684b190991b80b439602fe766b15f84bc1c44826aafed8416277e2fb425f66d35d447f32676cacdc8d9ef4fa31a8a0
6
+ metadata.gz: 64c4afe108dfadbdf6690963a1fb891ecf9dcf4bfd28402087cbeeafc37796e00d9564ce9d436139a1832af211330a61f428d15d5bb07add496347584245191e
7
+ data.tar.gz: dee1223cefa077ce2b38cf060169ad1bb882b9fec8aac7a42e76834a77fc2a8b6c53d30a62b6695750388742bca48633b59d4656fac1c3dbe563e1e1e2e46d41
data/lib/lit_cli.rb CHANGED
@@ -12,8 +12,12 @@ module LitCLI
12
12
  if @@config.enabled
13
13
  return if LitCLI.filter_status? status
14
14
  return if LitCLI.filter_type? type
15
+
15
16
  LitCLI.render(message, status, type, context)
17
+
16
18
  LitCLI.step()
19
+ yield if block_given?
20
+
17
21
  LitCLI.delay()
18
22
  end
19
23
  end
data/lib/lit_pry.rb CHANGED
@@ -60,25 +60,31 @@ if ENV['LIT_FLAGS'] && ENV['LIT_FLAGS'].include?('step')
60
60
  unless @@lit_processed_paths.include? file_path
61
61
  @@lit_processed_paths.add file_path
62
62
 
63
+ binding = "{ binding.pry if LitCLI.is_prying?; @@is_prying = false }"
63
64
  new_lines = ''
65
+ line_count = 0
66
+ new_lines_count = 0
67
+
64
68
  File.foreach(file_path) do |line|
69
+ line_count = line_count + 1
65
70
 
66
71
  # Pass current directory into the next file's requires.
67
72
  if line.strip.start_with? 'require_relative '
68
73
  line = line.strip + ", '#{absolute_path.join('/')}'\n"
69
74
  new_lines << line
70
75
  else
71
- new_lines << line
72
- end
73
-
74
- # Add pry binding beneath each lit message.
75
- if line.strip.start_with? 'lit "'
76
- new_lines << "binding.pry if LitCLI.is_prying?\n"
77
- new_lines << "@@is_prying = false\n"
76
+ # Add pry binding beneath each lit message.
77
+ if line.strip.start_with? 'lit '
78
+ lit_args = line.strip.delete_prefix('lit ').delete_suffix("\n")
79
+ new_lines << "lit(#{lit_args}) #{binding} \n"
80
+ else
81
+ new_lines << line
82
+ end
78
83
  end
79
84
  end
80
85
 
81
86
  eval(new_lines, get_binding(__dir__ = absolute_path), file_path)
87
+
82
88
  return true
83
89
  # Path has already been required.
84
90
  else
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.1
4
+ version: 0.6.2
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-08 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel