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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 434ab7c5b11f8d94276e194138704d60e63d6b0d
4
- data.tar.gz: 1f2f980bb3a7ef58102e1601fb8b5e43516e4b02
3
+ metadata.gz: 78a04c90326ef97dd1245c14a05fe7080cd64f3b
4
+ data.tar.gz: 10fd4814cccf9448e60a7cb9feeeae1ab9f798b3
5
5
  SHA512:
6
- metadata.gz: 176324f14e2c870a66688c5fb022089b1a40115494533ad68c0138d5399b012b5ecdf32da7ff5e3a36cc3b9e57e6dd0ab9f30b959c731aba9df63e781b3ab960
7
- data.tar.gz: 7cf5002daf9f35d170862507f3bd827018d2edffaad3ec23d42374c270c40c0c8d5d62a061d685005128ab6bc75a315da92ab86d279c9ed7e56abdc9a996994f
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
@@ -39,7 +39,7 @@ module XProc
39
39
  undef :!
40
40
  end
41
41
 
42
- refine Object do
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
@@ -0,0 +1,3 @@
1
+ require "xproc"
2
+
3
+ Object.send(:include, XProc::CoreExt)
@@ -1,3 +1,3 @@
1
1
  module XProc
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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