xproc 0.1.0 → 0.1.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 +13 -0
- data/lib/xproc.rb +8 -1
- data/lib/xproc/global.rb +3 -0
- data/lib/xproc/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78a04c90326ef97dd1245c14a05fe7080cd64f3b
|
4
|
+
data.tar.gz: 10fd4814cccf9448e60a7cb9feeeae1ab9f798b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 398d85b97567501197a82ab4363ed1e36a07ddd2c9e9532a18b4151f103ea45c332550bb7b72bf3467515dcf15b31ef16a1fb5e3867b1493fb8f0b7bbdb27fa8
|
7
|
+
data.tar.gz: cfbc4a1cfd8ac7f1c16aaa694f43535d14ebbb6953b5421f77955b4afb505b6f18190d7d0962bd27a31b86970485dc8f3ebb39b99d6f40eccbf78a4d8bbb2827
|
data/README.md
CHANGED
@@ -17,12 +17,25 @@ Since it's a refinement, you have to explicitly include it wherever you want to
|
|
17
17
|
use it. Use it like this:
|
18
18
|
|
19
19
|
``` ruby
|
20
|
+
require "xproc"
|
21
|
+
|
20
22
|
using XProc
|
21
23
|
|
22
24
|
["foo", "bar", "quox"].map(&x.gsub("oo", "aa")).select(&x.length <= 3)
|
23
25
|
# => ["faa", "bar"]
|
24
26
|
```
|
25
27
|
|
28
|
+
It is also possible to pull in XProc into the global namespace:
|
29
|
+
|
30
|
+
``` ruby
|
31
|
+
require "xproc/global"
|
32
|
+
|
33
|
+
["foo", "bar", "quox"].map(&x.gsub("oo", "aa")).select(&x.length <= 3)
|
34
|
+
# => ["faa", "bar"]
|
35
|
+
```
|
36
|
+
|
37
|
+
If your Ruby version does not support refinements you will have to do that.
|
38
|
+
|
26
39
|
You can also use positional arguments like this:
|
27
40
|
|
28
41
|
``` ruby
|
data/lib/xproc.rb
CHANGED
@@ -39,7 +39,7 @@ module XProc
|
|
39
39
|
undef :!
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
module CoreExt
|
43
43
|
def x
|
44
44
|
::XProc::Proc.new(0)
|
45
45
|
end
|
@@ -60,4 +60,11 @@ module XProc
|
|
60
60
|
::XProc::Proc.new(3)
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
begin
|
65
|
+
refine Object do
|
66
|
+
include ::XProc::CoreExt
|
67
|
+
end
|
68
|
+
rescue NoMethodError => e
|
69
|
+
end
|
63
70
|
end
|
data/lib/xproc/global.rb
ADDED
data/lib/xproc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xproc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas and Kim Burgestrand
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- bin/console
|
56
56
|
- bin/setup
|
57
57
|
- lib/xproc.rb
|
58
|
+
- lib/xproc/global.rb
|
58
59
|
- lib/xproc/version.rb
|
59
60
|
- xproc.gemspec
|
60
61
|
homepage: https://github.com/jnicklas/xproc
|