drawers 1.0.0 → 1.0.1
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
- data/README.md +2 -0
- data/lib/drawers/active_support/dependency_extensions.rb +23 -20
- data/lib/drawers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6501ca69ca387b5fcdadca2cefc421dd6ce4218b
|
|
4
|
+
data.tar.gz: eb848da7400a579adee113d08ce014d653e8c28b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 634e42977c1b7ebb23b47a092f594e89880622b8e8112e5ef3fa35384d916b9ce990c15c71301c4b94ab047dae29495238ae1f37c13ad413d057a941ea051441
|
|
7
|
+
data.tar.gz: 93a4fe1015c817bf47d4759c8f2dfdd119d84353091de35e288d5aa4d263666ce6e0bb782da7563f56db8f577d40503b2b5ebbeca720559e4784c1361b3c53e1
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@ module Drawers
|
|
|
3
3
|
module DependencyExtensions
|
|
4
4
|
RESOURCE_SUFFIX_NAMES = %w(
|
|
5
5
|
Controller
|
|
6
|
-
|
|
6
|
+
Forms
|
|
7
7
|
Serializer
|
|
8
8
|
Operations
|
|
9
9
|
Presenters
|
|
@@ -78,14 +78,33 @@ module Drawers
|
|
|
78
78
|
#
|
|
79
79
|
# @param [String] qualified_name fully qualified class/module name to find the file location for
|
|
80
80
|
def resource_path_from_qualified_name(qualified_name)
|
|
81
|
+
path_options = path_options_for_qualified_name(qualified_name)
|
|
82
|
+
|
|
83
|
+
file_path = ''
|
|
84
|
+
path_options.uniq.each do |path_option|
|
|
85
|
+
file_path = search_for_file(path_option)
|
|
86
|
+
|
|
87
|
+
break if file_path.present?
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
return file_path if file_path
|
|
91
|
+
|
|
92
|
+
# Note that sometimes, the resource_type path may only be defined in a
|
|
93
|
+
# resource type folder
|
|
94
|
+
# So, look for the first file within the resource type folder
|
|
95
|
+
# because of ruby namespacing conventions if there is a file in the folder,
|
|
96
|
+
# it MUST define the namespace
|
|
97
|
+
path_for_first_file_in(path_options.last) || path_for_first_file_in(path_options[-2])
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def path_options_for_qualified_name(qualified_name)
|
|
81
101
|
namespace,
|
|
82
102
|
resource_name,
|
|
83
103
|
resource_type, named_resource_type,
|
|
84
104
|
class_path = ResourceParts.from_name(qualified_name)
|
|
85
105
|
|
|
86
106
|
# build all the possible places that this file could be
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
[
|
|
89
108
|
# api/v2/posts/operations/update
|
|
90
109
|
to_path(namespace, resource_name, resource_type, class_path),
|
|
91
110
|
|
|
@@ -97,23 +116,7 @@ module Drawers
|
|
|
97
116
|
|
|
98
117
|
# api/v2/posts/controller
|
|
99
118
|
to_path(namespace, resource_name, resource_type)
|
|
100
|
-
]
|
|
101
|
-
|
|
102
|
-
file_path = ''
|
|
103
|
-
path_options.each do |path_option|
|
|
104
|
-
file_path = search_for_file(path_option)
|
|
105
|
-
|
|
106
|
-
break if file_path.present?
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Note that sometimes, the resource_type path may only be defined in a
|
|
110
|
-
# resource type folder
|
|
111
|
-
# So, look for the first file within the resource type folder
|
|
112
|
-
# because of ruby namespacing conventions if there is a file in the folder,
|
|
113
|
-
# it MUST define the namespace
|
|
114
|
-
file_path = path_for_first_file_in(path_options.last) unless file_path
|
|
115
|
-
|
|
116
|
-
file_path
|
|
119
|
+
]
|
|
117
120
|
end
|
|
118
121
|
|
|
119
122
|
def path_for_first_file_in(path)
|
data/lib/drawers/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: drawers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- L. Preston Sego III
|
|
@@ -175,5 +175,5 @@ rubyforge_project:
|
|
|
175
175
|
rubygems_version: 2.5.2
|
|
176
176
|
signing_key:
|
|
177
177
|
specification_version: 4
|
|
178
|
-
summary: Drawers-1.0.
|
|
178
|
+
summary: Drawers-1.0.1
|
|
179
179
|
test_files: []
|