read_source 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/read_source/read_source.rb +1 -0
- data/lib/read_source/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c8201f06d97a0a87489cd27c6bd19659b29e13b
|
4
|
+
data.tar.gz: 97ae56a003253399e404933bb7ef369534600cf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6735afb77b530073e5bb3409dad53aae1ba35cb912385e40fd5dbbea4eb2576e2fb8acefd8cf636d734db1e2854b90a98e48c4a6b36851aa4bd052689cb2a1
|
7
|
+
data.tar.gz: dafa783756676f45fd689eabc1b989c6b43df3db3925924295d354289133a56af849f5316a87d6681ad1ce469e4181742eaa205b8f488f603bd1e603d3c94f7e
|
data/README.md
CHANGED
@@ -28,8 +28,10 @@ Or install it yourself as:
|
|
28
28
|
This gem adds instance methods to the Method and UnboundMethod objects.
|
29
29
|
|
30
30
|
* `Method#vim`
|
31
|
+
* `Method#attr?`
|
31
32
|
* `Method#read_source`
|
32
33
|
* `UnboundMethod#vim`
|
34
|
+
* `UnboundMethod#attr?`
|
33
35
|
* `UnboundMethod#read_source`
|
34
36
|
|
35
37
|
Currently this assumes VIM is in your executable path. Future versions of this gem will be more
|
@@ -44,11 +46,17 @@ puts Pathname.instance_method(:root?).read_source
|
|
44
46
|
# !!(chop_basename(@path) == nil && /#{SEPARATOR_PAT}/o =~ @path)
|
45
47
|
#end
|
46
48
|
|
49
|
+
Pathname.instance_method(:root?).attr?
|
50
|
+
# => nil
|
51
|
+
|
47
52
|
require 'prime'
|
48
53
|
puts Integer.method(:each_prime).read_source
|
49
54
|
#def Integer.each_prime(ubound, &block) # :yields: prime
|
50
55
|
# Prime.each(ubound, &block)
|
51
56
|
#end
|
57
|
+
|
58
|
+
Gem::BasicSpecification.instance_method(:base_dir=).attr?
|
59
|
+
# => :attr_writer
|
52
60
|
```
|
53
61
|
|
54
62
|
You can type `vim` instead of the `read_source` method on either the `Method` or `UnboundMethod` objects
|
@@ -6,6 +6,7 @@ module ReadSource
|
|
6
6
|
source = readlines[line_num-1]
|
7
7
|
indent = /\A[[:space:]]*/.match(source).to_s.length
|
8
8
|
source = source[indent..-1]
|
9
|
+
return source if source =~ /(attr[\w]*)/
|
9
10
|
readlines[line_num..-1].each do |line|
|
10
11
|
source += line[indent..-1]
|
11
12
|
if indent == /\A[[:space:]]*/.match(line).to_s.length
|
data/lib/read_source/version.rb
CHANGED