rfunk 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rfunk/attribute/attribute_function.rb +1 -1
- data/lib/rfunk/attribute/attribute_variable.rb +1 -1
- data/lib/rfunk/attribute/error_checking.rb +4 -4
- data/lib/rfunk/attribute/function.rb +6 -5
- data/lib/rfunk/lazy.rb +1 -1
- data/lib/rfunk/maybe/none.rb +4 -0
- data/lib/rfunk/maybe/option.rb +1 -1
- data/lib/rfunk/maybe/some.rb +4 -0
- data/lib/rfunk/version.rb +1 -1
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b9f9d004d2fd219aea8cc2067f2271cb43c7cbb
|
4
|
+
data.tar.gz: 1bcc087face734df020fe7561776deabbe67a45a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35b9d7ab85c41e7a4eadd76b0b6e886cf5a289422b46173b6242568605a9c75245fd0cfaea0c2d351dfeb850b26668141a5bd7a6f9e000999ca43a34518c981
|
7
|
+
data.tar.gz: facb8be128e08e8a086c2ebb8b5965db97958288d09600fc4517d234195d26765ccba600fc633bd4705305757efa96ba6d6fa20a180e4a8da1b23620f53f0bb0
|
@@ -2,7 +2,7 @@ module RFunk
|
|
2
2
|
module AttributeFunction
|
3
3
|
def fun(definition, &block)
|
4
4
|
function_definition = function_definition(definition)
|
5
|
-
lambda = ->
|
5
|
+
lambda = ->(*args) { RFunk::Function.new(self, function_definition, &block).execute(*args) }
|
6
6
|
|
7
7
|
define_method function_definition.value(0).value, &lambda
|
8
8
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module RFunk
|
2
2
|
class ErrorChecking
|
3
3
|
def raise_condition_error(type, value)
|
4
|
-
|
4
|
+
raise type, 'The condition was not met!' unless value
|
5
5
|
end
|
6
6
|
|
7
7
|
def raise_expected_return_type(name, value, type)
|
@@ -19,13 +19,13 @@ module RFunk
|
|
19
19
|
def raise_not_found(key, attributes)
|
20
20
|
return if attributes.key?(key)
|
21
21
|
message = "Attribute with name '#{key}' does not exist. The only available attributes are '#{attributes.keys}'"
|
22
|
-
|
22
|
+
raise RFunk::NotFoundError, message
|
23
23
|
end
|
24
24
|
|
25
25
|
def raise_immutable(options, variable)
|
26
26
|
keys = options.keys.select { |k| variable.key?(k) }
|
27
27
|
message = "Could not set variables '#{keys}', because variables are immutable."
|
28
|
-
|
28
|
+
raise RFunk::ImmutableError, message if keys.any?
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
@@ -52,7 +52,7 @@ module RFunk
|
|
52
52
|
|
53
53
|
def raise_type(name, value, type, message)
|
54
54
|
return if value.is_a?(type)
|
55
|
-
|
55
|
+
raise TypeError, "Expected a type of '#{type}' for #{message} '#{name}'"
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -23,11 +23,8 @@ module RFunk
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def assert(&_)
|
26
|
-
if yield
|
27
|
-
|
28
|
-
else
|
29
|
-
fail RFunk::AssertionError
|
30
|
-
end
|
26
|
+
return true if yield
|
27
|
+
raise RFunk::AssertionError
|
31
28
|
end
|
32
29
|
|
33
30
|
def pre(&block)
|
@@ -58,6 +55,10 @@ module RFunk
|
|
58
55
|
this.send(method, *arguments, &block)
|
59
56
|
end
|
60
57
|
|
58
|
+
def respond_to_missing?(method_name, include_private = false)
|
59
|
+
this.respond_to_missing?(method_name, include_private)
|
60
|
+
end
|
61
|
+
|
61
62
|
private
|
62
63
|
|
63
64
|
attr_reader :block, :pre_block, :post_block, :body_block, :function_definition
|
data/lib/rfunk/lazy.rb
CHANGED
data/lib/rfunk/maybe/none.rb
CHANGED
data/lib/rfunk/maybe/option.rb
CHANGED
data/lib/rfunk/maybe/some.rb
CHANGED
@@ -18,6 +18,10 @@ module RFunk
|
|
18
18
|
RFunk::Option(value.send(method, *arguments, &block))
|
19
19
|
end
|
20
20
|
|
21
|
+
def respond_to_missing?(method_name, include_private = false)
|
22
|
+
value.respond_to_missing?(method_name, include_private)
|
23
|
+
end
|
24
|
+
|
21
25
|
def ==(other)
|
22
26
|
return false unless self.class == other.class
|
23
27
|
|
data/lib/rfunk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfunk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Falkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ice_nine
|
@@ -16,112 +16,112 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.11.
|
19
|
+
version: 0.11.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.11.
|
26
|
+
version: 0.11.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: concurrent-ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: concurrent-ruby-ext
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: hamster
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '3.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec-given
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rubocop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0
|
117
|
+
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0
|
124
|
+
version: '0'
|
125
125
|
description: See https://github.com/alexfalkowski/rfunk/blob/master/README.md
|
126
126
|
email:
|
127
127
|
- alexrfalkowski@gmail.com
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.5.2
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Functional Programming in Ruby
|