keyword_curry 0.0.2 → 0.0.3
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/Changelog.md +11 -0
- data/README.md +7 -2
- data/keyword_curry.gemspec +3 -2
- data/lib/keyword_curry.rb +8 -1
- data/lib/keyword_curry/keyword_argument_currying.rb +1 -1
- data/lib/keyword_curry/version.rb +1 -1
- data/spec/lib/keyword_curry/keyword_argument_currying_spec.rb +5 -4
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 757746a5c996d46bbc5694e3e7e0f64a29bb707e
|
4
|
+
data.tar.gz: a03cffbe6b6f4cfba329fedcf8d5e9e53c557582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5443e6bf9bde2128b7b35dd04a6f698bdd852f2e2b30dfe14f8fc96c7a13afd257478ea6f1dbd0b49ea9ba371823f2de2e80f9859f2a7e037f545d66af6b7734
|
7
|
+
data.tar.gz: ec0ac6b70193e09b4424a601547553fb88e75a38e3735458daecf9addd30158c2ea3cb23aa707fb61f038714b17f119b3ef7f0be72fa9f2d9345600debd3ff76
|
data/Changelog.md
ADDED
data/README.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
# KeywordCurry
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/keyword_curry)
|
4
|
+
|
3
5
|
Augments Ruby currying to handle MRI 2.1 required keyword arguments.
|
4
6
|
|
5
7
|
Proc like objects can be curried until all their required keywords have been received
|
6
8
|
|
7
|
-
Please note
|
9
|
+
**Please note**:
|
10
|
+
* Monkey patching is optional.
|
11
|
+
* Ruby 2.1+ is required.
|
12
|
+
* Optional keyword arguments cannot be curried.
|
8
13
|
|
9
14
|
## Installation
|
10
15
|
|
@@ -31,7 +36,7 @@ The monkey patch version
|
|
31
36
|
```ruby
|
32
37
|
require "keyword_curry"
|
33
38
|
|
34
|
-
|
39
|
+
KeywordCurry,monkey_patch_proc
|
35
40
|
```
|
36
41
|
|
37
42
|
You may wish for this behaviour only on special Procs
|
data/keyword_curry.gemspec
CHANGED
@@ -9,11 +9,12 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Stephen Best"]
|
10
10
|
spec.email = ["bestie@gmail.com"]
|
11
11
|
spec.summary = %q{Augments Ruby currying to handle MRI 2.1 required keyword arguments.}
|
12
|
-
spec.description = spec.summary + %q{Proc like objects can be curried until all their required keywords have been received. Monkey patching is optional.}
|
12
|
+
spec.description = spec.summary + " " + %q{Proc like objects can be curried until all their required keywords have been received. Monkey patching is optional.}
|
13
13
|
spec.homepage = "https://github.com/bestie/keyword_curry"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
|
16
|
+
# TODO: figure out why this doesn't work
|
17
|
+
# spec.required_ruby_version = ">= 2.1.0"
|
17
18
|
|
18
19
|
spec.files = `git ls-files`.split($/)
|
19
20
|
spec.executables = []
|
data/lib/keyword_curry.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
require "keyword_curry/version"
|
2
|
+
require "keyword_curry/keyword_argument_currying"
|
3
|
+
|
4
|
+
if RUBY_VERSION < "2.1.0"
|
5
|
+
warn("WARNING: KeywordCurry can only be used with Ruby 2.1.0 and above.")
|
6
|
+
end
|
2
7
|
|
3
8
|
module KeywordCurry
|
4
|
-
|
9
|
+
def self.monkey_patch_proc
|
10
|
+
Proc.prepend(KeywordArgumentCurrying)
|
11
|
+
end
|
5
12
|
end
|
@@ -1,10 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
|
-
require
|
3
|
+
require "keyword_curry"
|
4
|
+
require "keyword_curry/keyword_argument_currying"
|
4
5
|
|
5
|
-
describe KeywordArgumentCurrying do
|
6
|
+
describe KeywordCurry::KeywordArgumentCurrying do
|
6
7
|
before(:all) {
|
7
|
-
|
8
|
+
KeywordCurry.monkey_patch_proc
|
8
9
|
}
|
9
10
|
|
10
11
|
describe "#curry" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keyword_curry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Best
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,8 +38,8 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.14'
|
41
|
-
description: Augments Ruby currying to handle MRI 2.1 required keyword arguments.
|
42
|
-
like objects can be curried until all their required keywords have been received.
|
41
|
+
description: Augments Ruby currying to handle MRI 2.1 required keyword arguments.
|
42
|
+
Proc like objects can be curried until all their required keywords have been received.
|
43
43
|
Monkey patching is optional.
|
44
44
|
email:
|
45
45
|
- bestie@gmail.com
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- ".gitignore"
|
51
51
|
- ".rspec"
|
52
52
|
- ".ruby-version"
|
53
|
+
- Changelog.md
|
53
54
|
- Gemfile
|
54
55
|
- LICENSE.txt
|
55
56
|
- README.md
|
@@ -71,9 +72,9 @@ require_paths:
|
|
71
72
|
- lib
|
72
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
74
|
requirements:
|
74
|
-
- -
|
75
|
+
- - ">="
|
75
76
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
77
|
+
version: '0'
|
77
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
79
|
requirements:
|
79
80
|
- - ">="
|