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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 723924c26a1053a03b080ae349ced0cbcd4c1ffc
4
- data.tar.gz: 38f4fb088d2255f5936d4d635e6dfd4abd3a0e58
3
+ metadata.gz: 9c8201f06d97a0a87489cd27c6bd19659b29e13b
4
+ data.tar.gz: 97ae56a003253399e404933bb7ef369534600cf4
5
5
  SHA512:
6
- metadata.gz: d1434b7ada693229c71e3dd7e8488a48a1caddb740e77dd87683523f51f13e8c371bb01c3fa5aea54341e3911e415709db9c87f5957c5b2d0ea3e470d67268b6
7
- data.tar.gz: e79ee527bc5b2685dfbdd8e5717cb2b688198212afa400e445f41d7b927b618699423404e0a70c13aca8561668010ef5d4bc4a20ec4813cd760f5d52879658ea
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
@@ -1,3 +1,3 @@
1
1
  module ReadSource
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: read_source
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark