accessor_utilities 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/accessor_utilities/accessor_math.rb +1 -0
- data/lib/accessor_utilities/object_instance.rb +1 -0
- data/lib/accessor_utilities/string_instance.rb +13 -0
- data/lib/accessor_utilities/swizzle.rb +1 -0
- data/lib/accessor_utilities/symbol_instance.rb +1 -0
- data/lib/accessor_utilities.rb +1 -12
- data/lib/namespaces.rb +1 -0
- data/lib/requires.rb +5 -0
- data/lib_ext/object.rb +8 -0
- data/lib_ext/string.rb +7 -0
- data/lib_ext/symbol.rb +7 -0
- data/spec/accessor_utilities/accessor_math_spec.rb +1 -0
- data/spec/accessor_utilities/object_instance_spec.rb +1 -0
- data/spec/accessor_utilities/string_instance_spec.rb +1 -0
- data/spec/accessor_utilities/swizzle_spec.rb +1 -0
- data/spec/accessor_utilities/symbol_instance_spec.rb +1 -0
- data/spec/accessor_utilities_spec.rb +1 -0
- metadata +6 -3
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
|
2
3
|
module ::AccessorUtilities::StringInstance
|
3
4
|
|
@@ -25,6 +26,12 @@ module ::AccessorUtilities::StringInstance
|
|
25
26
|
return ( is_variable_name? ? self.slice( 1, length ).to_sym : to_sym )
|
26
27
|
end
|
27
28
|
|
29
|
+
##############
|
30
|
+
# accessor #
|
31
|
+
##############
|
32
|
+
|
33
|
+
alias_method :accessor, :accessor_name
|
34
|
+
|
28
35
|
#########################
|
29
36
|
# write_accessor_name #
|
30
37
|
#########################
|
@@ -47,6 +54,12 @@ module ::AccessorUtilities::StringInstance
|
|
47
54
|
|
48
55
|
end
|
49
56
|
|
57
|
+
####################
|
58
|
+
# write_accessor #
|
59
|
+
####################
|
60
|
+
|
61
|
+
alias_method :write_accessor, :write_accessor_name
|
62
|
+
|
50
63
|
##################
|
51
64
|
# swizzle_name #
|
52
65
|
##################
|
data/lib/accessor_utilities.rb
CHANGED
@@ -1,18 +1,7 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
|
2
3
|
# namespaces that have to be declared ahead of time for proper load order
|
3
4
|
require_relative './namespaces'
|
4
5
|
|
5
6
|
# source file requires
|
6
7
|
require_relative './requires.rb'
|
7
|
-
|
8
|
-
class ::Object
|
9
|
-
include ::AccessorUtilities::ObjectInstance
|
10
|
-
end
|
11
|
-
|
12
|
-
class ::String
|
13
|
-
include ::AccessorUtilities::StringInstance
|
14
|
-
end
|
15
|
-
|
16
|
-
class ::Symbol
|
17
|
-
include ::AccessorUtilities::SymbolInstance
|
18
|
-
end
|
data/lib/namespaces.rb
CHANGED
data/lib/requires.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
|
2
3
|
require_relative 'accessor_utilities/object_instance.rb'
|
3
4
|
require_relative 'accessor_utilities/accessor_math.rb'
|
4
5
|
require_relative 'accessor_utilities/swizzle.rb'
|
5
6
|
require_relative 'accessor_utilities/string_instance.rb'
|
6
7
|
require_relative 'accessor_utilities/symbol_instance.rb'
|
8
|
+
|
9
|
+
require_relative '../lib_ext/object.rb'
|
10
|
+
require_relative '../lib_ext/string.rb'
|
11
|
+
require_relative '../lib_ext/symbol.rb'
|
data/lib_ext/object.rb
ADDED
data/lib_ext/string.rb
ADDED
data/lib_ext/symbol.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accessor_utilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Extends String and Symbol instances with variable/accessor methods, provides
|
15
15
|
swizzling helpers, provides accessor-related math for transforming :accessor, :reader,
|
@@ -27,6 +27,9 @@ files:
|
|
27
27
|
- lib/accessor_utilities.rb
|
28
28
|
- lib/namespaces.rb
|
29
29
|
- lib/requires.rb
|
30
|
+
- lib_ext/object.rb
|
31
|
+
- lib_ext/string.rb
|
32
|
+
- lib_ext/symbol.rb
|
30
33
|
- spec/accessor_utilities/accessor_math_spec.rb
|
31
34
|
- spec/accessor_utilities/object_instance_spec.rb
|
32
35
|
- spec/accessor_utilities/string_instance_spec.rb
|
@@ -54,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
57
|
version: '0'
|
55
58
|
requirements: []
|
56
59
|
rubyforge_project: accessor_utilities
|
57
|
-
rubygems_version: 1.8.
|
60
|
+
rubygems_version: 1.8.24
|
58
61
|
signing_key:
|
59
62
|
specification_version: 3
|
60
63
|
summary: Utility methods for accessor-related meta-programming.
|