eventhub-command 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eh/commands/generate_processor.rb +16 -13
- data/lib/eh/settings.rb +4 -0
- data/lib/eh/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7769b08c03ee849b3de62533861b3ffb1a18181
|
4
|
+
data.tar.gz: b22385d58cb84daff12fb9f9419bf885c458763a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7026d968e9d50f61b1fe0cdb14a6829ad4d6c494565ffd8c30ed5164d84ca52baf256e1eb2504455ef22bb4086e2d616c79c7c8a2584159a107f832628bd213
|
7
|
+
data.tar.gz: 4f8b613ec706f709b2bda96a2785e83b598e24bf6c8096f32af383f5723e1f9b31ea6ef0b092e19f1a2107e30466c344ce891996a80d8707ad8f575169f8c2da
|
@@ -1,6 +1,5 @@
|
|
1
1
|
desc 'Generates a template for a processor'
|
2
|
-
arg_name 'module_name'
|
3
|
-
arg_name 'processor_name'
|
2
|
+
arg_name 'module_name processor_name'
|
4
3
|
|
5
4
|
command :generate_processor do |c|
|
6
5
|
c.action do |global_options, options, args|
|
@@ -21,13 +20,17 @@ command :generate_processor do |c|
|
|
21
20
|
destination_dir = Eh::Settings.current.processes_src_dir
|
22
21
|
destination_dir = File.join(destination_dir, "#{underscored_processor_module_name}.#{underscored_processor_class_name}")
|
23
22
|
|
24
|
-
|
25
|
-
|
23
|
+
if Dir.exists? destination_dir
|
24
|
+
puts "#{destination_dir} already exists!"
|
25
|
+
exit -1
|
26
|
+
end
|
27
|
+
|
28
|
+
template_tmp_dir = Eh::Settings.current.template_tmp_dir
|
29
|
+
checkout_git_repo(template_tmp_dir)
|
26
30
|
|
27
|
-
FileUtils.cp_r
|
31
|
+
FileUtils.cp_r template_tmp_dir, destination_dir
|
28
32
|
FileUtils.rm_rf File.join(destination_dir, ".git")
|
29
33
|
FileUtils.rm File.join(destination_dir, 'README.md')
|
30
|
-
FileUtils.mv File.join(destination_dir, 'README.template'), File.join(destination_dir, 'README.md')
|
31
34
|
|
32
35
|
puts "Generating processor #{processor_module_name}::#{processor_class_name} in #{destination_dir}"
|
33
36
|
Dir.glob(destination_dir + "/**/*.erb") do |file|
|
@@ -40,16 +43,16 @@ command :generate_processor do |c|
|
|
40
43
|
FileUtils.mv file, File.join(File.dirname(file), File.basename(file, ".erb"))
|
41
44
|
end
|
42
45
|
|
43
|
-
replacements =
|
44
|
-
"underscored_processor_module_name"
|
45
|
-
"underscored_processor_class_name"
|
46
|
-
"processor_module_name"
|
47
|
-
"processor_class_name"
|
48
|
-
|
46
|
+
replacements = [
|
47
|
+
["underscored_processor_module_name", underscored_processor_module_name],
|
48
|
+
["underscored_processor_class_name", underscored_processor_class_name],
|
49
|
+
["processor_module_name", processor_module_name],
|
50
|
+
["processor_class_name", processor_class_name]
|
51
|
+
]
|
49
52
|
|
50
53
|
rename_files_with_replacements(destination_dir, replacements)
|
51
54
|
|
52
|
-
FileUtils.rm_rf
|
55
|
+
FileUtils.rm_rf template_tmp_dir
|
53
56
|
|
54
57
|
puts "Done."
|
55
58
|
end
|
data/lib/eh/settings.rb
CHANGED
data/lib/eh/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventhub-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pascal Betz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|