proc_extensions 0.1.0 → 0.1.2
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/.travis.yml +1 -1
- data/README.md +17 -1
- data/lib/proc_extensions/proc_source.rb +1 -0
- data/lib/proc_extensions/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1d08b432029ecd32d639aeb12f69d4c86913d64
|
4
|
+
data.tar.gz: 049b0d3f0810adb03e1f9efd89556650496b7091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d36bc11bd7a296072c3686aec1f28669bd85d0e74c8019a89b8cd3f158fc3483e6b01ef79b9d5e0caba342809e7a838996dcfe98d0a84d9f2acc295fef3cd5c
|
7
|
+
data.tar.gz: fa298f13ac6d57f9f03fb65d89b99de0c9400c6d3878d2e596c69bf054e518634ac65de8eba173da43f7cddd7c0cbd74ebb7a3b62716c58c40ffcc04c89f1c9f
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -31,11 +31,27 @@ ps1 == ps2 # => false
|
|
31
31
|
ps1.match ps2 # => true
|
32
32
|
```
|
33
33
|
|
34
|
+
You can create a `ProcSource` with no proc or with a `nil` proc and it will simply provide an empty string for `source`
|
35
|
+
`raw_source`, `to_s` and `inspect`. And two `ProcSource` objects created like this will be considered equal.
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
ps1 = ProcSource.new
|
39
|
+
ps2 = ProcSource.new nil
|
40
|
+
|
41
|
+
ps1.source # => ""
|
42
|
+
ps1.raw_source # => ""
|
43
|
+
ps1.to_s # => ""
|
44
|
+
ps1.inspect # => ""
|
45
|
+
|
46
|
+
ps1 == ps2 # => true
|
47
|
+
ps1.match ps2 # => true
|
48
|
+
```
|
49
|
+
|
34
50
|
# Proc Extensions
|
35
51
|
|
36
52
|
Extensions to Proc support source extraction and comparison.
|
37
53
|
|
38
|
-
|
54
|
+
Optionally methods can be added to the `Proc` class:
|
39
55
|
* `inspect`: returns source code if it can be extracted
|
40
56
|
* `source`, `raw_source`: returns source code
|
41
57
|
* `==`: determines if two procs have exactly the same source code
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proc_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Declan Whelan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sourcify
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.4.
|
212
|
+
rubygems_version: 2.4.5.1
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: Extensions to the Proc class to support source extraction and comparison.
|