mygen 0.3.13 → 0.3.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dd85c60393de245b5975820cf5496cb8f8990c1
4
- data.tar.gz: d5e3ee90772ddfe22f942fbea5de74f6c5c9ffad
3
+ metadata.gz: 2c78bcafb1f9211495701f07c571eaa276e708da
4
+ data.tar.gz: e4dbc04ab967348f5aa6bf7500481099729131dc
5
5
  SHA512:
6
- metadata.gz: c4b4905bd026daad4154effb65a35f5398825fbd52fccc2fcb8b2be2ed5f1ad86a4d56a36d28aec2047395684e8b02ef0c56545ca1226ff56968a81e6493fddf
7
- data.tar.gz: 441cd2b013d2e858e1f5c050ace78476fee5080396a0a8e61cd25c52c4264226c64098d8959b1cdc0deb6c2439b68ba137c469185ec60f2bf02a22761066fcdc
6
+ metadata.gz: baf1b50c0d389f2e8ce4908a7a83518966a85c3a2a28b633f76dce5fd3698b027cda85b21e623b6883b1afd44c81c7e768a1f290cf49de22f7de814644b15d19
7
+ data.tar.gz: dc822ef8141a4b8cd6c4295c950112a09c5f42b037e3968c128f093b241796845c1888722b9adc7b36b317a0a1dc041f13ebdd656def91a5db90f9fb6e0d6492
@@ -1,4 +1,5 @@
1
1
  require 'mygen/naming'
2
+
2
3
  module Mygen
3
4
  class Generator
4
5
  include Mygen::Naming
@@ -59,10 +60,10 @@ module Mygen
59
60
  template_dirs(File.join(dest_dir)).each do |dir|
60
61
  dest = file_destination(dir, bindings)
61
62
  parent_dir = File.expand_path("..", dest)
62
- fileutils.mkdir_p(parent_dir) unless File.exist?(parent_dir)
63
+ fileutils.mkdir_p(parent_dir) if parent_dirs_dont_exist?(dest)
63
64
  move_file_in_place(dir, dest)
64
65
  end
65
- # Filter files with erb
66
+ # Filter files with erb
66
67
  template_files(File.join(dest_dir)).each do |file|
67
68
  dest = file_destination(file, bindings)
68
69
  # This is where you parse the erb files and fill in the contens
@@ -73,6 +74,12 @@ module Mygen
73
74
  end
74
75
  end
75
76
 
77
+ def parent_dirs_dont_exist?(path)
78
+ parent_dir = File.expand_path("..", path)
79
+ return false if path.include?('__')
80
+ return !File.exist?(path)
81
+ end
82
+
76
83
  def parse(file, bindings)
77
84
  erb = ERB.new(File.read(file))
78
85
  result = erb.result bindings
data/lib/mygen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mygen
2
- VERSION = "0.3.13"
2
+ VERSION = "0.3.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mygen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Rasmussen