method_source 0.8.1 → 0.8.2pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +0 -4
- data/lib/method_source/code_helpers.rb +20 -5
- data/lib/method_source/version.rb +1 -1
- metadata +15 -20
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWEzYjc2NGU3MmVkYzY0MTM3NGI1ZTJjODY2M2U2NzRjZGIwYmE4MA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTg4YjcwNWFkZDhjNjE4MWFlZTg4ZmI5ZTNmZDI1YWU1NmY3MDNhYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2QxNTA0MzVjMWRmMThjN2RhZjY3ZjNiOWJhMTYzMGE1ZmE1ZTYyM2FlNjlh
|
10
|
+
YTI4YTUyMDViNzJiNjUwMTVhY2Q2M2FmZDFkMTgxNzcxYjZkZjQ3ZjRjZjYx
|
11
|
+
OGU4YjQ2MGIzMmEwNTI1YTZlOGIwODMzZDg5ZWVhZmRlYTZlN2Y=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Y2ZmMjgxZDY5YTkzMTgzMzg0NDFlOGFmZmJlOTgwY2M0OWMzM2U1N2I3MGI0
|
14
|
+
N2FiZjE0ODNjMWZjMzYwODkwMmMzZTkwOWQyYTQyY2JlZGFiZmRiYTUxZWI0
|
15
|
+
ZDA4NjVkZjcyNGZmYmE2YTdkODIxMWI2ODVlNzI3ODYwOGM4NDc=
|
data/.travis.yml
CHANGED
@@ -35,7 +35,7 @@ module MethodSource
|
|
35
35
|
extract_first_expression(relevant_lines) do |code|
|
36
36
|
code.gsub(/\#\{.*?\}/, "temp")
|
37
37
|
end
|
38
|
-
rescue SyntaxError
|
38
|
+
rescue SyntaxError
|
39
39
|
raise e
|
40
40
|
end
|
41
41
|
end
|
@@ -122,18 +122,33 @@ module MethodSource
|
|
122
122
|
# An exception matcher that matches only subsets of SyntaxErrors that can be
|
123
123
|
# fixed by adding more input to the buffer.
|
124
124
|
module IncompleteExpression
|
125
|
+
GENERIC_REGEXPS = [
|
126
|
+
/unexpected (\$end|end-of-file|end-of-input|END_OF_FILE)/, # mri, jruby, ruby-2.0, ironruby
|
127
|
+
/embedded document meets end of file/, # =begin
|
128
|
+
/unterminated (quoted string|string|regexp) meets end of file/, # "quoted string" is ironruby
|
129
|
+
/can't find string ".*" anywhere before EOF/, # rbx and jruby
|
130
|
+
/missing 'end' for/, /expecting kWHEN/ # rbx
|
131
|
+
]
|
132
|
+
|
133
|
+
RBX_ONLY_REGEXPS = [
|
134
|
+
/expecting '[})\]]'(?:$|:)/, /expecting keyword_end/
|
135
|
+
]
|
136
|
+
|
125
137
|
def self.===(ex)
|
126
138
|
return false unless SyntaxError === ex
|
127
139
|
case ex.message
|
128
|
-
when
|
129
|
-
/embedded document meets end of file/, # =begin
|
130
|
-
/unterminated (quoted string|string|regexp) meets end of file/, # "quoted string" is ironruby
|
131
|
-
/missing 'end' for/, /: expecting '[})\]]'$/, /can't find string ".*" anywhere before EOF/, /: expecting keyword_end/, /expecting kWHEN/ # rbx
|
140
|
+
when *GENERIC_REGEXPS
|
132
141
|
true
|
142
|
+
when *RBX_ONLY_REGEXPS
|
143
|
+
rbx?
|
133
144
|
else
|
134
145
|
false
|
135
146
|
end
|
136
147
|
end
|
148
|
+
|
149
|
+
def self.rbx?
|
150
|
+
RbConfig::CONFIG['ruby_install_name'] == 'rbx'
|
151
|
+
end
|
137
152
|
end
|
138
153
|
end
|
139
154
|
end
|
metadata
CHANGED
@@ -1,48 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: method_source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.2pre1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- John Mair (banisterfiend)
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-07-27 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name: bacon
|
16
14
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
15
|
requirements:
|
19
16
|
- - ~>
|
20
17
|
- !ruby/object:Gem::Version
|
21
18
|
version: 1.1.0
|
22
|
-
|
23
|
-
prerelease: false
|
19
|
+
name: bacon
|
24
20
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
21
|
requirements:
|
27
22
|
- - ~>
|
28
23
|
- !ruby/object:Gem::Version
|
29
24
|
version: 1.1.0
|
25
|
+
type: :development
|
26
|
+
prerelease: false
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
|
-
name: rake
|
32
28
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
29
|
requirements:
|
35
30
|
- - ~>
|
36
31
|
- !ruby/object:Gem::Version
|
37
32
|
version: '0.9'
|
38
|
-
|
39
|
-
prerelease: false
|
33
|
+
name: rake
|
40
34
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
35
|
requirements:
|
43
36
|
- - ~>
|
44
37
|
- !ruby/object:Gem::Version
|
45
38
|
version: '0.9'
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
46
41
|
description: retrieve the sourcecode for a method
|
47
42
|
email: jrmair@gmail.com
|
48
43
|
executables: []
|
@@ -66,27 +61,27 @@ files:
|
|
66
61
|
- test/test_helper.rb
|
67
62
|
homepage: http://banisterfiend.wordpress.com
|
68
63
|
licenses: []
|
64
|
+
metadata: {}
|
69
65
|
post_install_message:
|
70
66
|
rdoc_options: []
|
71
67
|
require_paths:
|
72
68
|
- lib
|
73
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
70
|
requirements:
|
76
71
|
- - ! '>='
|
77
72
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
73
|
+
version: !binary |-
|
74
|
+
MA==
|
79
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
76
|
requirements:
|
82
|
-
- - ! '
|
77
|
+
- - ! '>'
|
83
78
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
79
|
+
version: 1.3.1
|
85
80
|
requirements: []
|
86
81
|
rubyforge_project:
|
87
|
-
rubygems_version:
|
82
|
+
rubygems_version: 2.0.6
|
88
83
|
signing_key:
|
89
|
-
specification_version:
|
84
|
+
specification_version: 4
|
90
85
|
summary: retrieve the sourcecode for a method
|
91
86
|
test_files:
|
92
87
|
- test/test.rb
|