array-hooked 1.0.0 → 1.1.0
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.
@@ -3,6 +3,29 @@ module ::Array::Hooked::ArrayInterface
|
|
3
3
|
|
4
4
|
instances_identify_as!( ::Array::Hooked )
|
5
5
|
|
6
|
+
################
|
7
|
+
# initialize #
|
8
|
+
################
|
9
|
+
|
10
|
+
# Initialize with reference a configuration instance.
|
11
|
+
# @param [Object] object Object that HookedArray instance is attached to, primarily useful for
|
12
|
+
# reference from hooks.
|
13
|
+
# @param [Array<Object>] args Parameters passed through super to Array#initialize.
|
14
|
+
# @return [true,false] Whether receiver identifies as object.
|
15
|
+
def initialize( configuration_instance = nil, *args )
|
16
|
+
|
17
|
+
@configuration_instance = configuration_instance
|
18
|
+
|
19
|
+
super( *args )
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
############################
|
24
|
+
# configuration_instance #
|
25
|
+
############################
|
26
|
+
|
27
|
+
attr_accessor :configuration_instance
|
28
|
+
|
6
29
|
###################################### Subclass Hooks ##########################################
|
7
30
|
|
8
31
|
##################
|
data/lib/array/requires.rb
CHANGED
@@ -7,21 +7,8 @@ files = [
|
|
7
7
|
|
8
8
|
]
|
9
9
|
|
10
|
-
second_basepath = '../hooked_array'
|
11
|
-
|
12
|
-
second_files = [
|
13
|
-
|
14
|
-
'array_interface'
|
15
|
-
|
16
|
-
]
|
17
|
-
|
18
|
-
|
19
10
|
files.each do |this_file|
|
20
11
|
require_relative( File.join( basepath, this_file ) + '.rb' )
|
21
12
|
end
|
22
|
-
second_files.each do |this_file|
|
23
|
-
require_relative( File.join( second_basepath, this_file ) + '.rb' )
|
24
|
-
end
|
25
13
|
|
26
14
|
require_relative( basepath + '.rb' )
|
27
|
-
require_relative( second_basepath + '.rb' )
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: array-hooked
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -40,10 +40,7 @@ files:
|
|
40
40
|
- lib/array/requires.rb
|
41
41
|
- lib/array-hooked.rb
|
42
42
|
- lib/hooked/array.rb
|
43
|
-
-
|
44
|
-
- lib/hooked_array.rb
|
45
|
-
- spec/array/hooked_spec.rb
|
46
|
-
- spec/hooked_array_spec.rb
|
43
|
+
- spec/Array/Hooked_spec.rb
|
47
44
|
- README.md
|
48
45
|
- CHANGELOG.rdoc
|
49
46
|
homepage: http://rubygems.org/gems/array-hooked
|
@@ -69,6 +66,6 @@ rubyforge_project: array-hooked
|
|
69
66
|
rubygems_version: 1.8.23
|
70
67
|
signing_key:
|
71
68
|
specification_version: 3
|
72
|
-
summary: Provides ::Array::Hooked
|
69
|
+
summary: Provides ::Array::Hooked.
|
73
70
|
test_files: []
|
74
71
|
has_rdoc:
|
data/lib/hooked_array.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
module ::HookedArray::Interface
|
3
|
-
|
4
|
-
instances_identify_as!( ::HookedArray )
|
5
|
-
|
6
|
-
################
|
7
|
-
# initialize #
|
8
|
-
################
|
9
|
-
|
10
|
-
# Initialize with reference a configuration instance.
|
11
|
-
# @param [Object] object Object that HookedArray instance is attached to, primarily useful for
|
12
|
-
# reference from hooks.
|
13
|
-
# @param [Array<Object>] args Parameters passed through super to Array#initialize.
|
14
|
-
# @return [true,false] Whether receiver identifies as object.
|
15
|
-
def initialize( configuration_instance = nil, *args )
|
16
|
-
|
17
|
-
@configuration_instance = configuration_instance
|
18
|
-
|
19
|
-
super( *args )
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
############################
|
24
|
-
# configuration_instance #
|
25
|
-
############################
|
26
|
-
|
27
|
-
attr_accessor :configuration_instance
|
28
|
-
|
29
|
-
end
|
data/spec/hooked_array_spec.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative '../lib/array-hooked.rb'
|
3
|
-
|
4
|
-
describe ::HookedArray do
|
5
|
-
|
6
|
-
it 'acts just like an ::Array::Hooked but takes a configuration instance' do
|
7
|
-
configuration_instance = ::Module.new
|
8
|
-
instance = ::HookedArray.new( configuration_instance )
|
9
|
-
instance.configuration_instance.should == configuration_instance
|
10
|
-
instance.is_a?( ::Array::Hooked ).should == true
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|