scaffold_pico 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scaffold/params.rb +29 -12
- 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: 48f0605737089876b9d08fe8d170d3f8ed56ef4c
|
4
|
+
data.tar.gz: 60c747832e40604a75f07b4cb791d4dcf3627086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08bdb16efdb857b1f63c8bb8b9a616cdfb3e0973233b04058423a469ff858ad9984d7fd27e3879d4b2722cf3774b254aff125fb8786704e51d3f468ebd66c810
|
7
|
+
data.tar.gz: e93ef4477245ea1974730aff4bc86cb0a8cd38e8816d6db9f59c7013ed34865ee79e12f0f39bb6f86c4a83a6227b226bca79bc56629e8d36ad2e3c7f410c72f5
|
data/lib/scaffold/params.rb
CHANGED
@@ -35,32 +35,49 @@ module Scaffold
|
|
35
35
|
@namespaces_array = parse_namespaces_array(@namespace) # [:admin, ...?... ]
|
36
36
|
|
37
37
|
# controller
|
38
|
+
@resource_name = @model_name.tableize.singularize # user for use in @user or filenames
|
39
|
+
@collection_name = @model_name.tableize # users for use in @users
|
40
|
+
|
38
41
|
if @namespaces_array.blank?
|
39
42
|
@controller_class_name = "#{@model_name.pluralize}Controller"
|
40
|
-
@search_modulized_resource_class_name = "Search::#{@resource_class_name}Search"
|
43
|
+
@search_modulized_resource_class_name = "Search::#{@resource_class_name.pluralize}Search"
|
44
|
+
|
45
|
+
# paths without namespace
|
46
|
+
@new_resource_path = "[:new, :#{@resource_name}]"
|
47
|
+
|
48
|
+
@resource_path = "[#{@resource_name}]"
|
49
|
+
@edit_resource_path = "[:edit, #{@resource_name}]"
|
50
|
+
|
51
|
+
@instance_resource_path = "[@#{@resource_name}]"
|
52
|
+
@instance_edit_resource_path = "[:edit, @#{@resource_name}]"
|
53
|
+
|
54
|
+
@collection_path = [@collection_name.to_sym]
|
55
|
+
|
41
56
|
else
|
42
57
|
@controller_namespaces = @namespace.camelize
|
43
58
|
@controller_class_name = "#{@controller_namespaces}::#{@model_name.pluralize}Controller"
|
44
59
|
@search_modulized_resource_class_name = "Search::#{@controller_namespaces}::#{@resource_class_name.pluralize}Search"
|
60
|
+
|
61
|
+
# paths with namespace
|
62
|
+
@path_segments = @namespaces_array.map{|segment| segment.to_sym }
|
63
|
+
@new_resource_path = "[:new, #{@path_segments.map{|item| ":#{item}"}.join(", ")}, :#{@resource_name}]"
|
64
|
+
|
65
|
+
@resource_path = "[#{@path_segments.map{|item| ":#{item}"}.join(", ")}, #{@resource_name}]"
|
66
|
+
@edit_resource_path = "[:edit, #{@path_segments.map{|item| ":#{item}"}.join(", ")}, #{@resource_name}]"
|
67
|
+
|
68
|
+
@instance_resource_path = "[#{@path_segments.map{|item| ":#{item}"}.join(", ")}, @#{@resource_name}]"
|
69
|
+
@instance_edit_resource_path = "[:edit, #{@path_segments.map{|item| ":#{item}"}.join(", ")}, @#{@resource_name}]"
|
70
|
+
|
71
|
+
@collection_path = @path_segments.dup << @collection_name.to_sym
|
72
|
+
|
45
73
|
end
|
46
74
|
@controller_file_name = "#{@resource_class_name.tableize}_controller.rb"
|
47
75
|
|
48
|
-
@resource_name = @model_name.tableize.singularize # user for use in @user or filenames
|
49
|
-
@collection_name = @model_name.tableize # users for use in @users
|
50
76
|
|
51
77
|
# view
|
52
78
|
@views_folder_name = @model_name.tableize # users
|
53
79
|
|
54
|
-
@path_segments = @namespaces_array.map{|segment| segment.to_sym }
|
55
|
-
@new_resource_path = "[:new, #{@path_segments.map{|item| ":#{item}"}.join(", ")}, :#{@resource_name}]"
|
56
|
-
|
57
|
-
@resource_path = "[#{@path_segments.map{|item| ":#{item}"}.join(", ")}, #{@resource_name}]"
|
58
|
-
@edit_resource_path = "[:edit, #{@path_segments.map{|item| ":#{item}"}.join(", ")}, #{@resource_name}]"
|
59
|
-
|
60
|
-
@instance_resource_path = "[#{@path_segments.map{|item| ":#{item}"}.join(", ")}, @#{@resource_name}]"
|
61
|
-
@instance_edit_resource_path = "[:edit, #{@path_segments.map{|item| ":#{item}"}.join(", ")}, @#{@resource_name}]"
|
62
80
|
|
63
|
-
@collection_path = @path_segments.dup << @collection_name.to_sym
|
64
81
|
|
65
82
|
@services_folder = choice[:services_folder]
|
66
83
|
debug_info if choice[:debug]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaffold_pico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gudata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|