bamboo_legals 0.0.9 → 0.1.7
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/bin/{add_bamboo_legals → bamboo_legals} +0 -0
- data/lib/bamboo_legals.rb +9 -5
- data/lib/generators/controller.rb +4 -4
- data/lib/generators/model.rb +3 -3
- data/lib/generators/views.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f45062d5167196b9746da62b9c71853060c1b5b0
|
|
4
|
+
data.tar.gz: 35a9c9987e70b2218bace3e1b369c2542ff69959
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 209d928c19ddf29008745aeff0522e49d891d6d9e4e9a5b0072da71c6dbc174a32d9fd0446d1921ca6123a95ddd10233861fb9e571f154527435aa7c451a5d56
|
|
7
|
+
data.tar.gz: 3155c283e97d304e5185177c04b51580456f7cf86fc6260f4c1873c92896027d2fad014b9a1ee1d5d1e654c74e5440ae02a8522f349046c6acb419e521008ad3
|
|
File without changes
|
data/lib/bamboo_legals.rb
CHANGED
|
@@ -20,13 +20,17 @@ def run_generator(get_type)
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
if type
|
|
23
|
+
|
|
24
|
+
# get path to /home/mislav/.rvm/gems/ruby-2.3.1/gems/bamboo_legals-0.1.1/lib/templates
|
|
25
|
+
temp_path = "#{File.dirname(__FILE__)}/templates"
|
|
26
|
+
|
|
23
27
|
overwrite_migration
|
|
24
|
-
overwrite_model(type)
|
|
28
|
+
overwrite_model(type, temp_path)
|
|
25
29
|
|
|
26
|
-
create_admin_controller(type)
|
|
27
|
-
create_controller(type)
|
|
28
|
-
create_admin_views(type)
|
|
29
|
-
create_views(type)
|
|
30
|
+
create_admin_controller(type, temp_path)
|
|
31
|
+
create_controller(type, temp_path)
|
|
32
|
+
create_admin_views(type, temp_path)
|
|
33
|
+
create_views(type, temp_path)
|
|
30
34
|
|
|
31
35
|
overwrite_routes
|
|
32
36
|
print_manual(type)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
def create_admin_controller(type)
|
|
1
|
+
def create_admin_controller(type, temp_path)
|
|
2
2
|
# find the legal controller
|
|
3
3
|
controller_path = "app/controllers/admin/legals_controller.rb"
|
|
4
|
-
template_controller_path = "
|
|
4
|
+
template_controller_path = "#{temp_path}/#{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)
|
|
@@ -9,10 +9,10 @@ def create_admin_controller(type)
|
|
|
9
9
|
puts "++ Created -> #{controller_path}"
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def create_controller(type)
|
|
12
|
+
def create_controller(type, temp_path)
|
|
13
13
|
# find the legal controller
|
|
14
14
|
controller_path = "app/controllers/legals_controller.rb"
|
|
15
|
-
template_controller_path = "
|
|
15
|
+
template_controller_path = "#{temp_path}/#{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
|
-
def overwrite_model(type)
|
|
1
|
+
def overwrite_model(type, temp_path)
|
|
2
2
|
# find the legal model
|
|
3
3
|
model_path = "app/models/legal.rb"
|
|
4
|
-
template_model_path = "
|
|
4
|
+
template_model_path = "#{temp_path}/#{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 = "
|
|
13
|
+
template_model_translation_path = "#{temp_path}/#{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
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
def create_admin_views(type)
|
|
1
|
+
def create_admin_views(type, temp_path)
|
|
2
2
|
admin_view_dir_path = 'app/views/admin/legals/'
|
|
3
3
|
|
|
4
4
|
# create directory for legal views in admin
|
|
5
5
|
Dir.mkdir admin_view_dir_path
|
|
6
6
|
|
|
7
7
|
# find all template views
|
|
8
|
-
template_views_path = "
|
|
8
|
+
template_views_path = "#{temp_path}/#{type}/admin_views/"
|
|
9
9
|
Dir.entries(template_views_path).each do |template|
|
|
10
10
|
next if template == "." or template == ".."
|
|
11
11
|
|
|
@@ -17,14 +17,14 @@ def create_admin_views(type)
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def create_views(type)
|
|
20
|
+
def create_views(type, temp_path)
|
|
21
21
|
view_dir_path = 'app/views/legals/'
|
|
22
22
|
|
|
23
23
|
# create directory for legal views
|
|
24
24
|
Dir.mkdir view_dir_path
|
|
25
25
|
|
|
26
26
|
# find all template views
|
|
27
|
-
template_views_path = "
|
|
27
|
+
template_views_path = "#{temp_path}/#{type}/views/"
|
|
28
28
|
Dir.entries(template_views_path).each do |template|
|
|
29
29
|
next if template == "." or template == ".."
|
|
30
30
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bamboo_legals
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mislav Kvesić
|
|
@@ -13,11 +13,11 @@ dependencies: []
|
|
|
13
13
|
description: It should generate monolingual and multilingual legals for big_bamboom
|
|
14
14
|
email: kvesic.mislav@gmail.com
|
|
15
15
|
executables:
|
|
16
|
-
-
|
|
16
|
+
- bamboo_legals
|
|
17
17
|
extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
|
-
- bin/
|
|
20
|
+
- bin/bamboo_legals
|
|
21
21
|
- lib/bamboo_legals.rb
|
|
22
22
|
- lib/generators/controller.rb
|
|
23
23
|
- lib/generators/manual.rb
|