rdm 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rdm/gen/init.rb +2 -2
- data/lib/rdm/handlers/template_handler.rb +6 -2
- data/lib/rdm/templates/init/Gemfile +3 -18
- data/lib/rdm/templates/template_detector.rb +8 -0
- data/lib/rdm/version.rb +1 -1
- 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: 82589b924f2da2db5b5723f0045581e056507551
|
4
|
+
data.tar.gz: 848c530582c986771c68b092e3b0da98e07860fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f174c7f97f81affedf612904b309639208c36f3000a62713faecb0513fd034b8a8da50337c786be950d44cc7769488300648a1ac2089baf78cc1001354115323
|
7
|
+
data.tar.gz: bcbd6d6d56c0ede7862f465c38bfa016ba2d24b65391285ef41047039c09a7013c0fceafc88fd9ff478914b757a5b4a35b7866d4357a2bccf74af997f3c2dabb
|
data/Gemfile.lock
CHANGED
data/lib/rdm/gen/init.rb
CHANGED
@@ -33,8 +33,8 @@ module Rdm
|
|
33
33
|
|
34
34
|
FileUtils.mkdir_p(local_templates_path)
|
35
35
|
FileUtils.cp_r(
|
36
|
-
@template_detector.
|
37
|
-
|
36
|
+
@template_detector.gem_template_folder('package'),
|
37
|
+
@template_detector.project_template_folder('package')
|
38
38
|
)
|
39
39
|
Rdm::Handlers::TemplateHandler.generate(
|
40
40
|
template_name: TEMPLATE_NAME,
|
@@ -86,8 +86,12 @@ module Rdm
|
|
86
86
|
|
87
87
|
template_files_list.map do |file|
|
88
88
|
rendered_abs_path = Rdm::Templates::TemplateRenderer.handle(get_destination_path(file), @locals)
|
89
|
-
|
90
|
-
|
89
|
+
|
90
|
+
if File.exists?(rendered_abs_path)
|
91
|
+
stdout.puts "Warning! #{file} already exists. Skipping file creation..."
|
92
|
+
next
|
93
|
+
end
|
94
|
+
|
91
95
|
rendered_file_content = File.extname(file) == '.erb' ?
|
92
96
|
File.read(file) :
|
93
97
|
Rdm::Templates::TemplateRenderer.handle(File.read(file), @locals)
|
@@ -1,25 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rdm',
|
3
|
+
gem 'rdm', require: false
|
4
4
|
|
5
|
-
# gem '
|
6
|
-
# gem 'smart_ioc', '0.1.18', require: false
|
7
|
-
# gem 'configuration', '1.3.4', require: false
|
8
|
-
# gem 'contracts-lite', '0.15.0', require: false
|
9
|
-
# gem 'sequel', '4.41.0', require: false
|
10
|
-
# gem 'pg', '0.19.0', require: false
|
11
|
-
# gem 'i18n', '0.7.0', require: false
|
12
|
-
# gem 'hashcast', '0.4.0 ', require: false
|
13
|
-
# gem 'pure_validator', '0.3.0 ', require: false
|
14
|
-
# gem 'oj', '2.18.0', require: false
|
15
|
-
|
16
|
-
### Web / Rails
|
17
|
-
# gem 'rails', '5.0.0.1', require: false
|
18
|
-
# gem 'rack-app', '5.6.0', require: false
|
5
|
+
# gem 'smart_ioc', require: false
|
19
6
|
|
20
7
|
group :test do
|
21
8
|
gem 'rspec', '3.5.0', require: false
|
22
|
-
|
23
|
-
# gem 'zeus', '0.15.10', require: false
|
24
|
-
# gem 'rake', '12.0.0', require: false
|
9
|
+
gem 'byebug', '9.0.6', require: false
|
25
10
|
end
|
@@ -18,6 +18,14 @@ module Rdm
|
|
18
18
|
template_path
|
19
19
|
end
|
20
20
|
|
21
|
+
def gem_template_folder(template_name)
|
22
|
+
File.join(DEFAULT_TEMPLATES_DIRECTORY, template_name.to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
def project_template_folder(template_name)
|
26
|
+
File.join(@all_templates_directory, template_name.to_s)
|
27
|
+
end
|
28
|
+
|
21
29
|
def template_file_path(template_name, relative_path)
|
22
30
|
file_path = [detect_template_folder(template_name), DEFAULT_TEMPLATES_DIRECTORY]
|
23
31
|
.map {|folder| File.join(folder, relative_path)}
|
data/lib/rdm/version.rb
CHANGED