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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b86ea072b8641826aaa1c6ae805f908dfd5e5020
4
- data.tar.gz: 14d4524321d24ab95b17cea3d0644c4bdaca7f4d
3
+ metadata.gz: 2b9f9d004d2fd219aea8cc2067f2271cb43c7cbb
4
+ data.tar.gz: 1bcc087face734df020fe7561776deabbe67a45a
5
5
  SHA512:
6
- metadata.gz: 00d216f4079806989219261e8bfea826a0edafe373a3f8a5fa4296473eece58ab37b83b90304152a86a74d29f75c13290e3d09b680f4334334751fb3e457149c
7
- data.tar.gz: de6abb927459d4c379a9b146e77f0cb5c5d6d03ef41a2c4e59e7480a264ec7f72fd47f298bea9572593ce7afacbe8670c92187060e9da7201cf8baf3ca6f5632
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 = -> (*args) { RFunk::Function.new(self, function_definition, &block).execute(*args) }
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,6 +1,6 @@
1
1
  module RFunk
2
2
  class AttributeVariable
3
- ATTRIBUTES_VARIABLE_NAME = '@attributes'
3
+ ATTRIBUTES_VARIABLE_NAME = '@attributes'.freeze
4
4
 
5
5
  def add(options)
6
6
  instance = options.fetch(:instance)
@@ -1,7 +1,7 @@
1
1
  module RFunk
2
2
  class ErrorChecking
3
3
  def raise_condition_error(type, value)
4
- fail type, 'The condition was not met!' unless value
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
- fail RFunk::NotFoundError, message
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
- fail RFunk::ImmutableError, message if keys.any?
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
- fail TypeError, "Expected a type of '#{type}' for #{message} '#{name}'"
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
- true
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
@@ -3,7 +3,7 @@ module RFunk
3
3
  def initialize(lambda)
4
4
  @lambda = lambda
5
5
  @created = false
6
- @atomic = Concurrent::Atomic.new
6
+ @atomic = Concurrent::AtomicReference.new
7
7
  end
8
8
 
9
9
  def value
@@ -14,6 +14,10 @@ module RFunk
14
14
  self
15
15
  end
16
16
 
17
+ def respond_to_missing?(method_name, include_private = false)
18
+ super
19
+ end
20
+
17
21
  def coerce(other)
18
22
  [other, 0]
19
23
  end
@@ -5,7 +5,7 @@ module RFunk
5
5
  def each(&block)
6
6
  return enum_for(:enum) if block.nil?
7
7
 
8
- enum.each { |v| block.call(v) }
8
+ enum.each { |v| yield v }
9
9
  end
10
10
  end
11
11
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RFunk
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'.freeze
3
3
  end
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.1.0
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: 2015-10-31 00:00:00.000000000 Z
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.0
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.0
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.9.1
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.9.1
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.9.1
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.9.1
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: 2.0.0
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: 2.0.0
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: 10.4.2
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: 10.4.2
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: 3.3.0
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: 3.3.0
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: 3.7.1
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: 3.7.1
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.34.2
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.34.2
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.4.5.1
176
+ rubygems_version: 2.5.2
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Functional Programming in Ruby