eventhub-command 0.0.22 → 0.1.0

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.
@@ -1,70 +1,68 @@
1
- desc 'Packages Rails Console to zip file'
2
- command :package_rails do |c|
3
- #c.flag([:x, :exclude], :desc => "Exclude processors by name.", :type => Array, :long_desc => "You can specify multiple processors by providing a comma-separated list.")
4
- #c.flag([:p, :processors], :desc => "Specify what processors to package", :type => Array, :long_desc => "You can specify multiple processors by providing a comma-separated list.")
5
- c.flag([:d, :destination], :desc => "Destination directory to place created zip file.", :default_value => Eh::Settings.current.rails_release_dir)
6
- c.flag([:s, :source], :desc => "Source directory to read rails console from.", :default_value => Eh::Settings.current.rails_src_dir)
7
-
8
- c.action do |global_options, options, args|
9
- source_dir = options['s']
10
- destination_dir = options['d']
11
-
12
- skip_files = ["#{source_dir}/config/database.yml"]
13
-
14
- puts "Will package rails console from #{source_dir} to #{destination_dir}"
15
-
16
- console = Dir["#{source_dir}"]
17
-
18
- FileUtils.mkdir_p(destination_dir)
19
-
20
- zipfile_name = File.join(destination_dir, "console.zip")
21
- directory = source_dir
22
-
23
- # remove zip before we create a new one
24
- FileUtils.rm zipfile_name, :force => true
25
-
26
- Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
27
-
28
- #zipfile.add(processor_name, directory)
29
- [directory].each do |file_to_be_zipped|
30
- if File.directory?(file_to_be_zipped)
31
- # should skip directories
32
- next if options["directories-skip"]
33
-
34
- directory = file_to_be_zipped
35
- puts "zipper: archiving directory: #{directory}"
36
- directory_chosen_pathname = options["directories-recursively-splat"] ? directory : File.dirname(directory)
37
- directory_pathname = Pathname.new(directory_chosen_pathname)
38
- files = Dir[File.join(directory, '**', '**')]
39
-
40
- files.delete_if do |filename|
41
- ["#{source_dir}/log", "#{source_dir}/logs", "#{source_dir}/exceptions", "#{source_dir}/tmp"].any? do |prefix|
42
- filename.start_with?(prefix)
43
- end
44
- end
45
-
46
- files.each do |file|
47
- if skip_files.include? file
48
- puts "skipping #{file}"
49
- next
50
- end
51
-
52
- file_pathname = Pathname.new(file)
53
- file_relative_pathname = file_pathname.relative_path_from(directory_pathname)
54
- zipfile.add(file_relative_pathname,file)
55
- end
56
-
57
- next
58
- end
59
-
60
- filename = File.basename(file_to_be_zipped)
61
-
62
- puts "zipper: archiving #{file_to_be_zipped} as #{filename} into #{zipfile}"
63
-
64
- zipfile.add(filename,file_to_be_zipped)
65
- end
66
- end
67
-
68
- puts "Done packaging rails"
69
- end
70
- end
1
+ desc 'Packages Rails Console to zip file'
2
+ command :package_rails do |c|
3
+ c.flag([:d, :destination], :desc => "Destination directory to place created zip file.", :default_value => Eh::Settings.current.rails_release_dir)
4
+ c.flag([:s, :source], :desc => "Source directory to read rails console from.", :default_value => Eh::Settings.current.rails_src_dir)
5
+
6
+ c.action do |global_options, options, args|
7
+ source_dir = options['s']
8
+ destination_dir = options['d']
9
+
10
+ skip_files = ["#{source_dir}/config/database.yml"]
11
+
12
+ puts "Will package rails console from #{source_dir} to #{destination_dir}"
13
+
14
+ console = Dir["#{source_dir}"]
15
+
16
+ FileUtils.mkdir_p(destination_dir)
17
+
18
+ zipfile_name = File.join(destination_dir, "console.zip")
19
+ directory = source_dir
20
+
21
+ # remove zip before we create a new one
22
+ FileUtils.rm zipfile_name, :force => true
23
+
24
+ Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
25
+
26
+ #zipfile.add(processor_name, directory)
27
+ [directory].each do |file_to_be_zipped|
28
+ if File.directory?(file_to_be_zipped)
29
+ # should skip directories
30
+ next if options["directories-skip"]
31
+
32
+ directory = file_to_be_zipped
33
+ puts "zipper: archiving directory: #{directory}"
34
+ directory_chosen_pathname = options["directories-recursively-splat"] ? directory : File.dirname(directory)
35
+ directory_pathname = Pathname.new(directory_chosen_pathname)
36
+ files = Dir[File.join(directory, '**', '**')]
37
+
38
+ files.delete_if do |filename|
39
+ ["#{source_dir}/log", "#{source_dir}/logs", "#{source_dir}/exceptions", "#{source_dir}/tmp"].any? do |prefix|
40
+ filename.start_with?(prefix)
41
+ end
42
+ end
43
+
44
+ files.each do |file|
45
+ if skip_files.include? file
46
+ puts "skipping #{file}"
47
+ next
48
+ end
49
+
50
+ file_pathname = Pathname.new(file)
51
+ file_relative_pathname = file_pathname.relative_path_from(directory_pathname)
52
+ zipfile.add(file_relative_pathname,file)
53
+ end
54
+
55
+ next
56
+ end
57
+
58
+ filename = File.basename(file_to_be_zipped)
59
+
60
+ puts "zipper: archiving #{file_to_be_zipped} as #{filename} into #{zipfile}"
61
+
62
+ zipfile.add(filename,file_to_be_zipped)
63
+ end
64
+ end
65
+
66
+ puts "Done packaging rails"
67
+ end
68
+ end
data/lib/eh/settings.rb CHANGED
@@ -1,69 +1,72 @@
1
- class Eh::Settings
2
- attr_reader :data
3
- def self.load(file)
4
- data = File.read(file)
5
- json = JSON.parse(data)
6
- Eh::Settings.new(json)
7
- end
8
-
9
- def self.current=(value)
10
- Thread.current[:eh_settings] = value
11
- end
12
-
13
- def self.current
14
- Thread.current[:eh_settings]
15
- end
16
-
17
- def initialize(data)
18
- @data = data
19
- end
20
-
21
-
22
- def repository_root_dir
23
- File.expand_path(data['repository_root_dir'])
24
- end
25
-
26
- def releases_dir
27
- File.join(repository_root_dir, 'releases')
28
- end
29
-
30
- def rails_release_dir
31
- File.join(releases_dir, 'rails')
32
- end
33
-
34
- def ruby_release_dir
35
- File.join(releases_dir, 'ruby')
36
- end
37
-
38
- def processors_src_dir
39
- File.join(repository_root_dir, 'src', 'ruby')
40
- end
41
-
42
- def deployment_dir
43
- File.join(repository_root_dir, 'src', 'deployment')
44
- end
45
-
46
- def rails_src_dir
47
- File.join(repository_root_dir, 'src', 'rails', 'console')
48
- end
49
-
50
- def source_config_dir
51
- File.join(repository_root_dir, 'config')
52
- end
53
-
54
- def processor_template_repository_url
55
- 'https://github.com/thomis/eventhub-processor-template.git'
56
- end
57
-
58
- def package_tmp_dir
59
- './tmp'
60
- end
61
-
62
- def template_tmp_dir
63
- '/tmp/eventhub-processor-template/'
64
- end
65
-
66
- def deployment_management_files
67
- [ File.join(deployment_dir, 'management', 'launcher.rb') ]
68
- end
69
- end
1
+ class Eh::Settings
2
+ attr_reader :data
3
+ def self.load(file)
4
+ data = File.read(file)
5
+ json = JSON.parse(data)
6
+ Eh::Settings.new(json)
7
+ end
8
+
9
+ def self.current=(value)
10
+ Thread.current[:eh_settings] = value
11
+ end
12
+
13
+ def self.current
14
+ Thread.current[:eh_settings]
15
+ end
16
+
17
+ def initialize(data)
18
+ @data = data
19
+ end
20
+
21
+ def repository_root_dir
22
+ File.expand_path(data['repository_root_dir'])
23
+ end
24
+
25
+ def releases_dir
26
+ File.join(repository_root_dir, 'releases')
27
+ end
28
+
29
+ def rails_release_dir
30
+ File.join(releases_dir, 'rails')
31
+ end
32
+
33
+ def ruby_release_dir
34
+ File.join(releases_dir, 'ruby')
35
+ end
36
+
37
+ def processors_src_dir
38
+ File.join(repository_root_dir, 'src', 'ruby')
39
+ end
40
+
41
+ def deployment_dir
42
+ File.join(repository_root_dir, 'src', 'deployment')
43
+ end
44
+
45
+ def rails_src_dir
46
+ File.join(repository_root_dir, 'src', 'rails', 'console')
47
+ end
48
+
49
+ def source_config_dir
50
+ File.join(repository_root_dir, 'config')
51
+ end
52
+
53
+ def processor_template_repository_url
54
+ 'https://github.com/thomis/eventhub-processor-template.git'
55
+ end
56
+
57
+ def package_tmp_dir
58
+ './tmp'
59
+ end
60
+
61
+ def template_tmp_dir
62
+ '/tmp/eventhub-processor-template/'
63
+ end
64
+
65
+ def deployment_management_files
66
+ [ File.join(deployment_dir, 'management', 'launcher.rb') ]
67
+ end
68
+
69
+ def stages_dir
70
+ File.expand_path("~/.eh-stages")
71
+ end
72
+ end
data/lib/eh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
- module Eh
2
- VERSION = '0.0.22'
3
- end
1
+ module Eh
2
+ VERSION = '0.1.0'
3
+ end
data/test/default_test.rb CHANGED
@@ -1,14 +1,14 @@
1
- require 'test_helper'
2
-
3
- class DefaultTest < Test::Unit::TestCase
4
-
5
- def setup
6
- end
7
-
8
- def teardown
9
- end
10
-
11
- def test_the_truth
12
- assert true
13
- end
14
- end
1
+ require 'test_helper'
2
+
3
+ class DefaultTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def teardown
9
+ end
10
+
11
+ def test_the_truth
12
+ assert true
13
+ end
14
+ end
data/test/test_helper.rb CHANGED
@@ -1,9 +1,9 @@
1
- require 'test/unit'
2
-
3
- # Add test libraries you want to use here, e.g. mocha
4
-
5
- class Test::Unit::TestCase
6
-
7
- # Add global extensions to the test case class here
8
-
9
- end
1
+ require 'test/unit'
2
+
3
+ # Add test libraries you want to use here, e.g. mocha
4
+
5
+ class Test::Unit::TestCase
6
+
7
+ # Add global extensions to the test case class here
8
+
9
+ end
data/todo.txt CHANGED
@@ -1,9 +1,9 @@
1
- -- -------------------------------------
2
- -- to do
3
- -- -------------------------------------
4
-
5
- - eh relase -r or --repository plate_store or http path -u user -p password
6
- - folder filter, default and customize
7
- - extension filter, default and custmize
8
- - it could take config settings from a local .ehconfig file
1
+ -- -------------------------------------
2
+ -- to do
3
+ -- -------------------------------------
4
+
5
+ - eh relase -r or --repository plate_store or http path -u user -p password
6
+ - folder filter, default and customize
7
+ - extension filter, default and custmize
8
+ - it could take config settings from a local .ehconfig file
9
9
  - would be nice to have a release all feature
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.22
4
+ version: 0.1.0
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-11-25 00:00:00.000000000 Z
12
+ date: 2014-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -95,6 +95,34 @@ dependencies:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '4.1'
98
+ - !ruby/object:Gem::Dependency
99
+ name: net-ssh
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: colorize
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
98
126
  description: Event Hub Command Line Tool which supports you with various Event Hub
99
127
  related administrative development features.
100
128
  email:
@@ -117,10 +145,16 @@ files:
117
145
  - features/eh.feature
118
146
  - features/step_definitions/eh_steps.rb
119
147
  - features/support/env.rb
148
+ - lib/deployer.rb
149
+ - lib/deployer/executor.rb
150
+ - lib/deployer/net_ssh_extension.rb
151
+ - lib/deployer/stage.rb
120
152
  - lib/eh-commands.rb
121
153
  - lib/eh.rb
122
154
  - lib/eh/commands/copy_config.rb
123
155
  - lib/eh/commands/deploy.rb
156
+ - lib/eh/commands/deploy_mule.rb
157
+ - lib/eh/commands/deploy_ruby.rb
124
158
  - lib/eh/commands/generate_processor.rb
125
159
  - lib/eh/commands/package.rb
126
160
  - lib/eh/commands/package_rails.rb
@@ -155,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
189
  version: '0'
156
190
  requirements: []
157
191
  rubyforge_project:
158
- rubygems_version: 2.4.2
192
+ rubygems_version: 2.4.3
159
193
  signing_key:
160
194
  specification_version: 4
161
195
  summary: Event Hub Command Line Tool