apple_core 1.1.0 → 1.2.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/apple_core/action_controller/resource_naming.rb +23 -8
- data/lib/apple_core/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f78954a2f3780ab80a53db0893ef7b7c20047c28d3144d8b12bba76233bde14
|
4
|
+
data.tar.gz: 62ed470b4b4f54de9319edb1fc16601c144252a215124e19388904d5a3931ab0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8b0db52a2b40174eeb7b6a8a00f7b01b3952a2da6b4a419f19202afa0f11ea961ec810b8dca2b26f4702211c7c25cf229e517a0ac60a3ded1e1d3bbc736986c
|
7
|
+
data.tar.gz: 8f3a7c790197e7f05acef286df00cae70299e48f064d9c21142c889a793989ed346cf990d5891dc3251d47ed38821f31b24c8b16cd55cc2d1d9fc5877fd8f816
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -44,18 +44,18 @@ module ResourceNaming
|
|
44
44
|
base.extend(self)
|
45
45
|
end
|
46
46
|
|
47
|
-
def plural_underscored_base_resource_name
|
48
|
-
@plural_underscored_base_resource_name ||= plural_resource_base_class_name
|
49
|
-
.underscore
|
50
|
-
.downcase
|
51
|
-
end
|
52
|
-
|
53
47
|
def singular_underscored_base_resource_name
|
54
48
|
@singular_underscored_base_resource_name ||= singular_resource_base_class_name
|
55
49
|
.underscore
|
56
50
|
.downcase
|
57
51
|
end
|
58
52
|
|
53
|
+
def plural_underscored_base_resource_name
|
54
|
+
@plural_underscored_base_resource_name ||= plural_resource_base_class_name
|
55
|
+
.underscore
|
56
|
+
.downcase
|
57
|
+
end
|
58
|
+
|
59
59
|
def singular_resource_base_class_name
|
60
60
|
@singular_resource_base_class_name ||= plural_resource_base_class_name
|
61
61
|
.singularize
|
@@ -66,12 +66,27 @@ module ResourceNaming
|
|
66
66
|
.pluralize
|
67
67
|
end
|
68
68
|
|
69
|
+
def singular_resource_class_name
|
70
|
+
@singular_resource_class_name ||= [
|
71
|
+
name_components['root_module'],
|
72
|
+
resource_name,
|
73
|
+
]
|
74
|
+
.compact
|
75
|
+
.join('::')
|
76
|
+
end
|
77
|
+
|
78
|
+
def plural_resource_class_name
|
79
|
+
@plural_resource_class_name ||= singular_resource_class_name
|
80
|
+
.pluralize
|
81
|
+
end
|
82
|
+
|
69
83
|
def name_components
|
70
|
-
name.match(CONTROLLER_RESOURCE_NAME_PATTERN).named_captures
|
84
|
+
@name_components ||= name.match(CONTROLLER_RESOURCE_NAME_PATTERN).named_captures
|
71
85
|
end
|
72
86
|
|
73
87
|
def resource_name
|
74
|
-
|
88
|
+
@resource_name ||= name_components['resource_name']
|
89
|
+
.singularize
|
75
90
|
end
|
76
91
|
end
|
77
92
|
end
|
data/lib/apple_core/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|