eventhub-command 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/eh.gemspec +1 -0
- data/lib/eh/commands/package_rails.rb +19 -51
- data/lib/eh/version.rb +1 -1
- data/lib/eh-commands.rb +0 -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: c655ba82a212de7d4426653f474b26cbb8bf0ba6
|
4
|
+
data.tar.gz: 773b466a410b1d24cfb5388cb806f1b3d0bd1e54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef2193c63220dcb364abd9000484a32b5589082df108aa880b00231f72ae2b3b74de16bebc7ccbbef78ca127590b250c15e26906be3ae378e5fe18eb409c5d4c
|
7
|
+
data.tar.gz: 101915c4200d2fd6ae93d7f5a514b27442eaa209833990359f567840bc472d95f236c040e0681b01287784629d22265bb94c0e4305b307df0f2ea9cf289e71c5
|
data/eh.gemspec
CHANGED
@@ -10,35 +10,41 @@ command :package_rails do |c|
|
|
10
10
|
destination_dir = options['d']
|
11
11
|
|
12
12
|
puts "Will package rails console from #{source_dir} to #{destination_dir}"
|
13
|
-
|
13
|
+
|
14
14
|
console = Dir["#{source_dir}"]
|
15
15
|
|
16
|
-
FileUtils.mkdir_p(destination_dir)
|
16
|
+
FileUtils.mkdir_p(destination_dir)
|
17
17
|
|
18
18
|
options = {"directories-recursively"=>true}
|
19
|
-
|
19
|
+
|
20
20
|
zipfile_name = File.join(destination_dir, "console.zip")
|
21
21
|
directory = source_dir
|
22
22
|
|
23
23
|
# remove zip before we create a new one
|
24
|
-
FileUtils.rm zipfile_name, :force => true
|
24
|
+
FileUtils.rm zipfile_name, :force => true
|
25
|
+
|
26
|
+
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
25
27
|
|
26
|
-
Zip::File.open(zipfile_name,Zip::File::CREATE) do |zipfile|
|
27
|
-
|
28
28
|
#zipfile.add(processor_name, directory)
|
29
|
-
[directory].each
|
29
|
+
[directory].each do |file_to_be_zipped|
|
30
30
|
if File.directory?(file_to_be_zipped)
|
31
31
|
# should skip directories
|
32
32
|
next if options["directories-skip"]
|
33
|
-
# should recursively add directory
|
33
|
+
# should recursively add directory
|
34
34
|
if options["directories-recursively"]
|
35
35
|
directory = file_to_be_zipped
|
36
36
|
puts "zipper: archiving directory: #{directory}"
|
37
|
-
directory_chosen_pathname = options["directories-recursively-splat"] ? directory : File.dirname(directory)
|
37
|
+
directory_chosen_pathname = options["directories-recursively-splat"] ? directory : File.dirname(directory)
|
38
38
|
directory_pathname = Pathname.new(directory_chosen_pathname)
|
39
39
|
files = Dir[File.join(directory, '**', '**')]
|
40
|
-
|
41
|
-
files.
|
40
|
+
|
41
|
+
files.delete_if do |filename|
|
42
|
+
["#{source_dir}/log", "#{source_dir}/logs", "#{source_dir}/exceptions", "#{source_dir}/tmp"].any? do |prefix|
|
43
|
+
filename.start_with?(prefix)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
files.each do |file|
|
42
48
|
file_pathname = Pathname.new(file)
|
43
49
|
file_relative_pathname = file_pathname.relative_path_from(directory_pathname)
|
44
50
|
zipfile.add(file_relative_pathname,file)
|
@@ -51,47 +57,9 @@ command :package_rails do |c|
|
|
51
57
|
puts "zipper: archiving #{file_to_be_zipped} as #{filename} into #{zipfile}"
|
52
58
|
|
53
59
|
zipfile.add(filename,file_to_be_zipped)
|
54
|
-
|
60
|
+
end
|
55
61
|
end
|
56
62
|
|
57
|
-
|
58
|
-
#console = Dir["#{source_dir}/*"].map do |dir|
|
59
|
-
# File.basename(dir)
|
60
|
-
#end
|
61
|
-
|
62
|
-
#included_processor_names = processor_names
|
63
|
-
|
64
|
-
# only include processors specified by -p option, if option is given
|
65
|
-
#if options['p']
|
66
|
-
# included_processor_names = included_processor_names.select do |processor_name|
|
67
|
-
# options['p'].include?(processor_name)
|
68
|
-
# end
|
69
|
-
#end
|
70
|
-
#
|
71
|
-
## exclude processors specified by -x option, if option is given
|
72
|
-
#if options['x']
|
73
|
-
# # check if any processor has been excluded from packaging
|
74
|
-
# included_processor_names = included_processor_names.select do |processor_name|
|
75
|
-
# !options['x'].include?(processor_name)
|
76
|
-
# end
|
77
|
-
#end
|
78
|
-
|
79
|
-
# make sure we have at least one processor
|
80
|
-
#if included_processor_names.empty?
|
81
|
-
# raise "There are no processor names. Either your -s directory is empty or you specified a strange combination of -x and -p"
|
82
|
-
#end
|
83
|
-
|
84
|
-
|
85
|
-
# make sure destination directory exists
|
86
|
-
#FileUtils.mkdir_p(destination_dir)
|
87
|
-
#
|
88
|
-
## Zip all processors
|
89
|
-
#included_processor_names.each do |processor_name|
|
90
|
-
#
|
91
|
-
#directory = File.join(source_dir, processor_name) # last slash could be omitted
|
92
|
-
#zipfile_name = File.join(destination_dir, "#{processor_name}.zip")
|
93
|
-
#
|
94
|
-
|
95
|
-
puts "Done packaging #{console.size} processors"
|
63
|
+
puts "Done packaging rails"
|
96
64
|
end
|
97
65
|
end
|
data/lib/eh/version.rb
CHANGED
data/lib/eh-commands.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.20
|
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-
|
12
|
+
date: 2014-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|