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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06385893c9ba6a5fcae55712fb643fc13ddbed02
4
- data.tar.gz: c060785f7a420d703cb7dbdc99ec6c0f6024b5cf
3
+ metadata.gz: c655ba82a212de7d4426653f474b26cbb8bf0ba6
4
+ data.tar.gz: 773b466a410b1d24cfb5388cb806f1b3d0bd1e54
5
5
  SHA512:
6
- metadata.gz: 65b34eb3b78cffa22884ec506f68c87a5232e60e763c3bf80dcb67b5b6d4aad59e379221b6e84ab1139dbc2e5a42f6cf8e596627fbb672112a14a008db2a0458
7
- data.tar.gz: 4354ecadc71e542b5aedd14422a88d6c205e289c549f3ffeb8916931bb43d94f0c3df55d4dcd1a5d78e1dc758119f9d8ac8bc6243597d6a959fd5b1ab0144d44
6
+ metadata.gz: ef2193c63220dcb364abd9000484a32b5589082df108aa880b00231f72ae2b3b74de16bebc7ccbbef78ca127590b250c15e26906be3ae378e5fe18eb409c5d4c
7
+ data.tar.gz: 101915c4200d2fd6ae93d7f5a514b27442eaa209833990359f567840bc472d95f236c040e0681b01287784629d22265bb94c0e4305b307df0f2ea9cf289e71c5
data/eh.gemspec CHANGED
@@ -24,4 +24,5 @@ spec = Gem::Specification.new do |s|
24
24
  s.add_runtime_dependency('gli','2.12.0')
25
25
  s.add_runtime_dependency('rubyzip', '~> 1.0')
26
26
  s.add_runtime_dependency('activesupport', '~> 4.1')
27
+
27
28
  end
@@ -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{ |file_to_be_zipped|
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
- files.delete_if {|filename| ["#{source_dir}/log", "#{source_dir}/logs", "#{source_dir}/exceptions", "#{source_dir}/tmp/pids"].include?(filename) }
41
- files.each do |file|
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
- # find all processors in the base directory
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
@@ -1,3 +1,3 @@
1
1
  module Eh
2
- VERSION = '0.0.19'
2
+ VERSION = '0.0.20'
3
3
  end
data/lib/eh-commands.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # All commands are required here
3
2
  require 'eh/commands/deploy'
4
3
  require 'eh/commands/copy_config'
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.19
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-10-30 00:00:00.000000000 Z
12
+ date: 2014-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake