origen_app_generators 1.0.0 → 1.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efe3f54f85b5eb4fbf72aa62d4735d1b3eb91a0d
|
4
|
+
data.tar.gz: a7ac8e0632d178b7549e39fdb1c2b7da8c9a0bd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5234f29caa0c4f6611ec22b79cfa3cca7714104b6487ae22f0fa8dc222349c992238df591856d630c1d984e5f80d7e2579d1dd59900c830720dd974be0929ae
|
7
|
+
data.tar.gz: f26c931c0aec81bdc5f8125db023736e105e37eb5f21d70352b2022aa30a58ea23f36b302d938a1f15d8f22d231e85c58764e22fce31c8303dde9286d4e53f20
|
data/config/version.rb
CHANGED
@@ -43,8 +43,9 @@ module OrigenAppGenerators
|
|
43
43
|
}
|
44
44
|
|
45
45
|
# @api private
|
46
|
-
def self.add_generators(new_generators)
|
46
|
+
def self.add_generators(new_generators, options = {})
|
47
47
|
new_generators.each do |domain, gens|
|
48
|
+
gens.each { |gen| template_dirs[gen] ||= options[:template_dir] if options[:template_dir] }
|
48
49
|
if generators[domain]
|
49
50
|
gens.each { |g| generators[domain].unshift(g) }
|
50
51
|
new_generators.delete(domain)
|
@@ -63,6 +64,11 @@ module OrigenAppGenerators
|
|
63
64
|
@generators ||= AVAILABLE
|
64
65
|
end
|
65
66
|
|
67
|
+
# @api private
|
68
|
+
def self.template_dirs
|
69
|
+
@template_dirs ||= {}
|
70
|
+
end
|
71
|
+
|
66
72
|
# @api private
|
67
73
|
def self.invoke(path)
|
68
74
|
puts
|
@@ -12,10 +12,17 @@ module OrigenAppGenerators
|
|
12
12
|
# So to keep things sane remove any inherited source paths.
|
13
13
|
self.class.source_paths.pop until self.class.source_paths.empty?
|
14
14
|
klass = self.class
|
15
|
+
|
15
16
|
until klass == OrigenAppGenerators::Base
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
names = klass.to_s.split('::')
|
18
|
+
names.shift
|
19
|
+
dir = names.map(&:underscore).join('/')
|
20
|
+
if OrigenAppGenerators.template_dirs[klass]
|
21
|
+
dir = File.expand_path("#{OrigenAppGenerators.template_dirs[klass]}/#{dir}", __FILE__)
|
22
|
+
else
|
23
|
+
dir = File.expand_path("#{Origen.root!}/templates/app_generators/#{dir}", __FILE__)
|
24
|
+
end
|
25
|
+
self.class.source_paths << dir if File.exist?(dir) && !self.class.source_paths.include?(dir)
|
19
26
|
klass = klass.superclass
|
20
27
|
end
|
21
28
|
end
|
@@ -136,7 +136,14 @@ module OrigenAppGenerators
|
|
136
136
|
puts "Enter something like 'Test Engineering', 'Design', etc."
|
137
137
|
puts
|
138
138
|
domain = get_text(single: true)
|
139
|
-
domain = domain.
|
139
|
+
domain = domain.split(' ').map do |word|
|
140
|
+
# Ensure all first letters capitalized, but make sure something like
|
141
|
+
# 'NVM' remains 'NVM' and not 'Nvm'
|
142
|
+
letters = word.split('')
|
143
|
+
letters.first.upcase!
|
144
|
+
letters.join
|
145
|
+
end.join(' ')
|
146
|
+
|
140
147
|
@domain_summary = domain
|
141
148
|
@domain_namespace = @domain_summary.gsub(' ', '')
|
142
149
|
end
|
data/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# This file is used to hook the generators defined in this plugin into the
|
2
2
|
# 'origen new' command, it must not be removed or modified
|
3
|
-
|
4
3
|
require 'origen_app_generators'
|
5
4
|
require "<%= @name %>"
|
6
|
-
|
7
|
-
OrigenAppGenerators.add_generators(<%= @namespace %>::AVAILABLE)
|
5
|
+
template_dir = File.expand_path('../../templates/app_generators', __FILE__)
|
6
|
+
OrigenAppGenerators.add_generators(<%= @namespace %>::AVAILABLE, template_dir: template_dir)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_app_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|