mygen 0.3.11 → 0.3.12

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: 9842b1cc21edb9017ed2e29724aec3993484ec41
4
- data.tar.gz: 8519c70bfa9f074d35967e45e4f4c554cf97ddca
3
+ metadata.gz: 74cf116c746aa40be9f0612f511ce667e2046940
4
+ data.tar.gz: f118b9e0b433f2914806cc9aea5fb7634d16697b
5
5
  SHA512:
6
- metadata.gz: ccf0f47387706c64c7d73a2e7afad6cdf39469e93104c16a63477f8bad68317d4baa56d0e599f51786839adae7d9d70840b440f0378fde136ff27d306fb05599
7
- data.tar.gz: e0aee79c0f0c70a3d55ab14811e1fb3eac3cdfdf5d6c30715a634c2be0aa185095a676455b8bb36108b5c0ee6eed4516998d521540cd2e31927c157cc0432ce8
6
+ metadata.gz: a925709d75bf7e043ea7f219595c8c865ba8de2d7a32366d7702d9fcaddec09dd482335636e3f149ef94c6b358dd5f5e0d71e38907e1e15d15b9f08b2a1ea77b
7
+ data.tar.gz: dd4b0372a68f3fc05bc01090e40025ea73fbe70a57b2afaf264c8b5f40693b26bc86fbde0dd3eecfb463f8b6065655150ef1b1d6b92d6b0525dc8709f86545a7
data/bin/myg CHANGED
@@ -33,6 +33,7 @@ command :generate do |c|
33
33
  c.command plugin.generator_name.to_sym do |s|
34
34
  plugin.plugin_commands(s) if plugin.respond_to?(:plugin_commands)
35
35
  s.action do |global_options, options, args|
36
+ plugin.options = options
36
37
  plugin.dry_run = global_options[:s]
37
38
  plugin.name = args[0]
38
39
  plugin.dest_dir = args[0]
@@ -40,6 +40,11 @@ module Mygen
40
40
  File.join(Mygen.root, "templates", generator_name)
41
41
  end
42
42
 
43
+ def make_template_tree_in_current_dir
44
+ fileutils.mkdir_p(dest_dir) unless File.exist?(dest_dir)
45
+ fileutils.cp_r(Dir.glob(File.join(template_source_dir, "*")), dest_dir)
46
+ end
47
+
43
48
  def make_template_tree(internal = false)
44
49
  @template_source_dir = internal_template_source_dir if internal
45
50
  fileutils.rm_rf(dest_dir) if File.exist?(dest_dir)
@@ -53,6 +58,8 @@ module Mygen
53
58
  def parse_templates(bindings)
54
59
  template_dirs(File.join(dest_dir)).each do |dir|
55
60
  dest = file_destination(dir, bindings)
61
+ parent_dir = File.expand_path("..", dest)
62
+ fileutils.mkdir_p(parent_dir) unless File.exist?(parent_dir)
56
63
  move_file_in_place(dir, dest)
57
64
  end
58
65
  # Filter files with erb
@@ -1,3 +1,3 @@
1
1
  module Mygen
2
- VERSION = "0.3.11"
2
+ VERSION = "0.3.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mygen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Rasmussen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler