prism_ext 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +5 -2
- data/Gemfile.lock +45 -3
- data/Guardfile +19 -0
- data/lib/prism_ext/version.rb +1 -1
- data/lib/prism_ext.rb +14 -12
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df9da0b75b3d011611ad94a92d532045d97df11a5d5fd00e6e753b4e35a4a5b
|
4
|
+
data.tar.gz: e9c72ce6abea12442381bdec345170c0ea7fea3796b547ae47bd6cae193f3e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab250d2c6f24ab15d30f56e28252ed3263c24f47f4cca9f15ba1759fda589053e5e21d6c61f88c6d484d9bb7c1703b1e25808b1cdf17b5222455dbc406183641
|
7
|
+
data.tar.gz: 9aa4fd52106103ef276308793f1980fa2bc7426443b0cec77ad378d64411c610c7c73ae3e06ed365b73653df9a5a024b4f30f582eb0c0f8c5c7f2b2947b0d1e5
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,52 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
prism_ext (0.3.
|
4
|
+
prism_ext (0.3.7)
|
5
5
|
prism
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
coderay (1.1.3)
|
10
11
|
diff-lcs (1.5.0)
|
12
|
+
ffi (1.17.0)
|
13
|
+
ffi (1.17.0-x86_64-darwin)
|
14
|
+
formatador (1.1.0)
|
15
|
+
guard (2.18.1)
|
16
|
+
formatador (>= 0.2.4)
|
17
|
+
listen (>= 2.7, < 4.0)
|
18
|
+
lumberjack (>= 1.0.12, < 2.0)
|
19
|
+
nenv (~> 0.1)
|
20
|
+
notiffany (~> 0.0)
|
21
|
+
pry (>= 0.13.0)
|
22
|
+
shellany (~> 0.0)
|
23
|
+
thor (>= 0.18.1)
|
24
|
+
guard-bundler (3.0.1)
|
25
|
+
bundler (>= 2.1, < 3)
|
26
|
+
guard (~> 2.2)
|
27
|
+
guard-compat (~> 1.1)
|
28
|
+
guard-compat (1.2.1)
|
29
|
+
guard-rspec (4.7.3)
|
30
|
+
guard (~> 2.1)
|
31
|
+
guard-compat (~> 1.1)
|
32
|
+
rspec (>= 2.99.0, < 4.0)
|
33
|
+
listen (3.9.0)
|
34
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
35
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
36
|
+
lumberjack (1.2.10)
|
37
|
+
method_source (1.1.0)
|
38
|
+
nenv (0.3.0)
|
39
|
+
notiffany (0.1.3)
|
40
|
+
nenv (~> 0.1)
|
41
|
+
shellany (~> 0.0)
|
11
42
|
prism (0.30.0)
|
43
|
+
pry (0.14.2)
|
44
|
+
coderay (~> 1.1)
|
45
|
+
method_source (~> 1.0)
|
12
46
|
rake (13.1.0)
|
47
|
+
rb-fsevent (0.11.2)
|
48
|
+
rb-inotify (0.11.1)
|
49
|
+
ffi (~> 1.0)
|
13
50
|
rspec (3.12.0)
|
14
51
|
rspec-core (~> 3.12.0)
|
15
52
|
rspec-expectations (~> 3.12.0)
|
@@ -23,15 +60,20 @@ GEM
|
|
23
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
24
61
|
rspec-support (~> 3.12.0)
|
25
62
|
rspec-support (3.12.1)
|
63
|
+
shellany (0.0.1)
|
64
|
+
thor (1.3.1)
|
26
65
|
|
27
66
|
PLATFORMS
|
28
67
|
ruby
|
29
68
|
x86_64-darwin-23
|
30
69
|
|
31
70
|
DEPENDENCIES
|
71
|
+
guard
|
72
|
+
guard-bundler
|
73
|
+
guard-rspec
|
32
74
|
prism_ext!
|
33
|
-
rake
|
34
|
-
rspec
|
75
|
+
rake
|
76
|
+
rspec
|
35
77
|
|
36
78
|
BUNDLED WITH
|
37
79
|
2.5.3
|
data/Guardfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
4
|
+
watch(%r{^spec/.+_spec\.rb$})
|
5
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
6
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
7
|
+
end
|
8
|
+
|
9
|
+
guard :bundler do
|
10
|
+
require 'guard/bundler'
|
11
|
+
require 'guard/bundler/verify'
|
12
|
+
helper = Guard::Bundler::Verify.new
|
13
|
+
|
14
|
+
files = ['Gemfile']
|
15
|
+
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
16
|
+
|
17
|
+
# Assume files are symlinked from somewhere
|
18
|
+
files.each { |file| watch(helper.real_path(file)) }
|
19
|
+
end
|
data/lib/prism_ext/version.rb
CHANGED
data/lib/prism_ext.rb
CHANGED
@@ -84,22 +84,24 @@ module Prism
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def to_source
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
87
|
+
case self
|
88
|
+
when InterpolatedStringNode, StringNode
|
89
|
+
if opening.start_with?('<<')
|
90
|
+
range = opening_loc.start_character_offset...closing_loc.end_character_offset
|
91
|
+
end
|
92
|
+
when CallNode
|
93
|
+
if arguments.is_a?(ArgumentsNode) && arguments.arguments.any?(&:interpolated_string?)
|
94
|
+
last_interpolated_string_argument = arguments.arguments.select(&:interpolated_string?).last
|
95
|
+
range = location.start_character_offset...last_interpolated_string_argument.closing_loc.end_character_offset
|
96
|
+
elsif block.is_a?(BlockArgumentNode)
|
97
|
+
range = location.start_character_offset...closing_loc.end_character_offset
|
98
|
+
end
|
95
99
|
end
|
96
|
-
location.send(:source).source[range]
|
100
|
+
range ? location.send(:source).source[range] : slice
|
97
101
|
end
|
98
102
|
|
99
103
|
def interpolated_string?
|
100
|
-
|
101
|
-
opening_loc && closing_loc &&
|
102
|
-
(opening == "<<~#{closing.strip}" || opening == "<<-#{closing.strip}")
|
104
|
+
(is_a?(InterpolatedStringNode) || is_a?(StringNode)) && opening.start_with?('<<')
|
103
105
|
end
|
104
106
|
end
|
105
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prism_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prism
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- CHANGELOG.md
|
36
36
|
- Gemfile
|
37
37
|
- Gemfile.lock
|
38
|
+
- Guardfile
|
38
39
|
- README.md
|
39
40
|
- Rakefile
|
40
41
|
- lib/prism_ext.rb
|