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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6425ae8efabe82c55af5166c2b30efd45d33fdfe
4
- data.tar.gz: af2862c212a6fef8291c56d583e528a5f6efa3b1
3
+ metadata.gz: 82589b924f2da2db5b5723f0045581e056507551
4
+ data.tar.gz: 848c530582c986771c68b092e3b0da98e07860fa
5
5
  SHA512:
6
- metadata.gz: 869cf8bf87cf873270cde89a5d75177d08cc4b152f14ba3dea49551259cab5a6a44d772ee98b9e20464d34f87d4a0adfa3ac0ba176b83e3587da0d74b497714b
7
- data.tar.gz: 9ac1d41f5cfc2269a23905cce444921d8d527afb0bf235302a3a19750db18b47d7d938a62b9899d0c2b6d56e0deb8256be67492834bda5cbc5ab3c77552708a1
6
+ metadata.gz: f174c7f97f81affedf612904b309639208c36f3000a62713faecb0513fd034b8a8da50337c786be950d44cc7769488300648a1ac2089baf78cc1001354115323
7
+ data.tar.gz: bcbd6d6d56c0ede7862f465c38bfa016ba2d24b65391285ef41047039c09a7013c0fceafc88fd9ff478914b757a5b4a35b7866d4357a2bccf74af997f3c2dabb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdm (0.3.1)
4
+ rdm (0.3.2)
5
5
  activesupport
6
6
  commander (~> 4.4)
7
7
 
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.detect_template_folder('package'),
37
- local_templates_path
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
- raise Rdm::Errors::TemplateFileExists.new(rendered_abs_path) if File.exists?(rendered_abs_path)
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', '0.1.12', require: false
3
+ gem 'rdm', require: false
4
4
 
5
- # gem 'activesupport', '5.0.0.1', require: false
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
- # gem 'byebug', '9.0.6', require: false
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
@@ -1,3 +1,3 @@
1
1
  module Rdm
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droid Labs