bamboo_legals 0.1.0 → 0.1.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/lib/generators/controller.rb +2 -2
- data/lib/generators/model.rb +2 -2
- data/lib/generators/views.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45b78cfdc8962581456cb3f8cd0c968c1a3a6de9
|
|
4
|
+
data.tar.gz: b91ba7cf4de06143b2e5c8769385bfc60c11f07d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14d481c6476ac19d2f93cbe8f4ff49c6452f3e7060b04d41d21c72b59054850e03d1ec3e7419593d6b1d8d4ab117fd88916a97476e776f0c3bb478d92ddc6734
|
|
7
|
+
data.tar.gz: '096decdc1f6f6cb06c091f80f7fcf4679963dab96b4d28e5ef1fd62b02929bbf9b255e0c58fa961f7daf32130c113387bba54991a4584556cda5d6d7027aec00'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
def create_admin_controller(type)
|
|
2
2
|
# find the legal controller
|
|
3
3
|
controller_path = "app/controllers/admin/legals_controller.rb"
|
|
4
|
-
template_controller_path = "bamboo_legals/
|
|
4
|
+
template_controller_path = "bamboo_legals/lib/templates/#{type}/admin_legals_controller.txt"
|
|
5
5
|
|
|
6
6
|
new_controller_text = File.open(template_controller_path).read
|
|
7
7
|
File.write(controller_path, new_controller_text)
|
|
@@ -12,7 +12,7 @@ end
|
|
|
12
12
|
def create_controller(type)
|
|
13
13
|
# find the legal controller
|
|
14
14
|
controller_path = "app/controllers/legals_controller.rb"
|
|
15
|
-
template_controller_path = "bamboo_legals/
|
|
15
|
+
template_controller_path = "bamboo_legals/lib/templates/#{type}/legals_controller.txt"
|
|
16
16
|
|
|
17
17
|
new_controller_text = File.open(template_controller_path).read
|
|
18
18
|
File.write(controller_path, new_controller_text)
|
data/lib/generators/model.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
def overwrite_model(type)
|
|
2
2
|
# find the legal model
|
|
3
3
|
model_path = "app/models/legal.rb"
|
|
4
|
-
template_model_path = "bamboo_legals/
|
|
4
|
+
template_model_path = "bamboo_legals/lib/templates/#{type}/legal.txt"
|
|
5
5
|
|
|
6
6
|
new_model_text = File.open(template_model_path).read
|
|
7
7
|
File.write(model_path, new_model_text)
|
|
@@ -10,7 +10,7 @@ def overwrite_model(type)
|
|
|
10
10
|
|
|
11
11
|
if type == "multilingual"
|
|
12
12
|
model_translation_path = "app/models/legal_translation.rb"
|
|
13
|
-
template_model_translation_path = "bamboo_legals/
|
|
13
|
+
template_model_translation_path = "bamboo_legals/lib/templates/#{type}/legal_translation.txt"
|
|
14
14
|
|
|
15
15
|
new_model_translation_text = File.open(template_model_translation_path).read
|
|
16
16
|
File.write(model_translation_path, new_model_translation_text)
|
data/lib/generators/views.rb
CHANGED
|
@@ -5,7 +5,7 @@ def create_admin_views(type)
|
|
|
5
5
|
Dir.mkdir admin_view_dir_path
|
|
6
6
|
|
|
7
7
|
# find all template views
|
|
8
|
-
template_views_path = "bamboo_legals/
|
|
8
|
+
template_views_path = "bamboo_legals/lib/templates/#{type}/admin_views/"
|
|
9
9
|
Dir.entries(template_views_path).each do |template|
|
|
10
10
|
next if template == "." or template == ".."
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@ def create_views(type)
|
|
|
24
24
|
Dir.mkdir view_dir_path
|
|
25
25
|
|
|
26
26
|
# find all template views
|
|
27
|
-
template_views_path = "bamboo_legals/
|
|
27
|
+
template_views_path = "bamboo_legals/lib/templates/#{type}/views/"
|
|
28
28
|
Dir.entries(template_views_path).each do |template|
|
|
29
29
|
next if template == "." or template == ".."
|
|
30
30
|
|