lit-cli 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lit_pry.rb +17 -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: c0bb5bf94135acf7647df72b3431dc89663ee6bca855cfb3c75f298d8a79099d
|
4
|
+
data.tar.gz: a1c226eec222a72c0be6f38ee4940f5a3f70809557805bcc0992ebff50e11e89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 335100d58b9ee3c5f6fa599725c91c0911237b1e6ba64fadd4d62b59569478e897eee752f4f9abf70365ae102fa99f9a4d849099c8b99521e6207ec9ad00ae2a
|
7
|
+
data.tar.gz: 97b8638b199affa210e563aa529f8178a45fe0f5023c844460a78e6f742a3b20dbcb502cf64922001b40fa974a009118bce2d7040fba7d3cf88cc0190dc7281d
|
data/lib/lit_pry.rb
CHANGED
@@ -60,7 +60,6 @@ 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 }"
|
64
63
|
new_lines = ''
|
65
64
|
line_count = 0
|
66
65
|
new_lines_count = 0
|
@@ -72,14 +71,11 @@ if ENV['LIT_FLAGS'] && ENV['LIT_FLAGS'].include?('step')
|
|
72
71
|
if line.strip.start_with? 'require_relative '
|
73
72
|
line = line.strip + ", '#{absolute_path.join('/')}'\n"
|
74
73
|
new_lines << line
|
74
|
+
# Add pry binding on each lit method.
|
75
|
+
elsif lit_line = Kernel.add_lit_binding(line)
|
76
|
+
new_lines << lit_line
|
75
77
|
else
|
76
|
-
|
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
|
+
new_lines << line
|
83
79
|
end
|
84
80
|
end
|
85
81
|
|
@@ -98,5 +94,18 @@ if ENV['LIT_FLAGS'] && ENV['LIT_FLAGS'].include?('step')
|
|
98
94
|
# Setting file_path in eval() negates this fix but will keep just in case.
|
99
95
|
return binding unless LitCLI.is_prying?
|
100
96
|
end
|
97
|
+
|
98
|
+
def self.add_lit_binding(line)
|
99
|
+
block = "{ binding.pry if LitCLI.is_prying?; @@is_prying = false }"
|
100
|
+
|
101
|
+
['lit ', 'lit(', '🔥 ', '🔥(', '🔥'].each do |needle|
|
102
|
+
if line.strip.start_with? needle
|
103
|
+
args = line.strip.delete_prefix(needle).delete_suffix(")").chomp
|
104
|
+
return "lit(#{args}) #{block} \n"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
false
|
109
|
+
end
|
101
110
|
end
|
102
111
|
end
|
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
|
+
version: 0.6.3
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pastel
|