remote_executor 0.1.0 → 0.2.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.
data/README.rdoc ADDED
@@ -0,0 +1,25 @@
1
+ = Remote Executor: A simplistic remote command launcher over SSH conections
2
+
3
+ == Installing
4
+
5
+ The latest stable version is published in gemcutter.
6
+
7
+ gem source --add http://gemcutter.org
8
+ gem install remote_executor
9
+
10
+
11
+ == Notes
12
+
13
+ At the moment the gem have a strong dependency of your local SSH configuration, commonly located at ${HOME}/.ssh/config, this is only a
14
+ very simple mechanism for keep safe your private data, but this need a ugly configuration with a fake user name in the connection
15
+ process. I provide a basic SSH config if your aren´t familiar with this configuration stuff
16
+
17
+
18
+ == TODO
19
+
20
+ * Document all stuff in english... I promise ;)
21
+ * Write some test...
22
+
23
+ == License
24
+
25
+ Copyright © 2007-2010 Javier Juarez, released under the MIT license.
data/bin/remote_executor CHANGED
@@ -1,15 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.unshift( File.join( File.dirname( __FILE__ ), '..', 'lib' ) )
3
+ $:.unshift File.join( File.dirname( __FILE__ ), %w[.. lib] )
4
4
 
5
5
  require 'rubygems'
6
6
  require 'remote_executor'
7
7
 
8
+ module CLIApplication
9
+
10
+ NAME = "RemoteExecutor"
11
+
12
+ def self.execute
13
+ RemoteExecutor::Cli::execute(
14
+ Choice.choices[:environment],
15
+ Choice.choices[:system],
16
+ Choice.choices[:command]
17
+ )
18
+ end
19
+ end
8
20
 
9
21
  ##
10
22
  # ::Main::
11
- RemoteExecutor::Cli::execute(
12
- Choice.choices[:environment],
13
- Choice.choices[:system],
14
- Choice.choices[:command]
15
- )
23
+ CLIApplication.execute
@@ -1,9 +1,29 @@
1
1
  module RemoteExecutor
2
+ class YAMLFileNotFound < Exception
3
+ end
4
+
2
5
  class Config
3
6
  include Singleton
4
7
 
8
+ ##
9
+ # Get the default configuration over Choice, environment and user default settings
10
+ def self.get_config_file( config_key )
11
+
12
+ return Choice.choices[:config] if Choice.choices[:config]
13
+
14
+ environment_var = ENV["#{config_key.upcase}"]
15
+ return environment_var if environment_var
16
+
17
+ default_user_config_file = "#{ENV['HOME']}/.#{config_key.downcase}rc"
18
+ return default_user_config_file if File.exist?( default_user_config_file )
19
+
20
+ raise YAMLFileNotFound.new( "Configuration file not found" )
21
+ end
22
+
5
23
  def initialize()
6
- @config = YAML.load_file( Choice.choices[:config] )
24
+ @config = YAML.load_file( Config.get_config_file( CLIApplication::NAME ) )
25
+ rescue Exception => e
26
+ raise YAMLFileNotFound.new( e.message )
7
27
  end
8
28
 
9
29
  def [](key)
@@ -6,9 +6,8 @@ module RemoteExecutor
6
6
  option :config do
7
7
  short '-c'
8
8
  long '--config=settings.yml'
9
- desc 'The yaml config file'
10
- default '../config/settings.yml'
11
- end
9
+ desc 'The YAML config file'
10
+ end
12
11
 
13
12
  option :environment, :required=>true do
14
13
  short '-e'
@@ -2,12 +2,12 @@ module RemoteExecutor
2
2
  module Version
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 1
6
- PATCH = 0
5
+ MINOR = 2
6
+ PATCH = 0
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH ].compact.join( '.' )
9
9
  end
10
10
 
11
11
  NAME = 'remote_executor'
12
12
  VERSION = Version::STRING
13
- end
13
+ end
@@ -1,6 +1,13 @@
1
1
  begin
2
2
  %w[rubygems yaml singleton choice net/ssh].each { |gem| require gem }
3
- %w[version options_parser config cli].each { |lib| require "remote_executor/#{lib}"}
4
- rescue LoadException => e
5
- $stderr.puts e.message
3
+ rescue LoadError => e
4
+ fail "Some gem dependencies can´t be loaded: #{e.message}"
6
5
  end
6
+
7
+ $:.unshift File.join( File.dirname( __FILE__), 'remote_executor' )
8
+
9
+ begin
10
+ %w[version config options_parser cli].each { |lib| require lib }
11
+ rescue LoadError => e
12
+ fail "Some lib dependencies can´t be loaded: #{e.message}"
13
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_executor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javier Juarez
@@ -15,18 +15,45 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-19 00:00:00 +01:00
18
+ date: 2010-11-20 00:00:00 +01:00
19
19
  default_executable: remote_executor
20
- dependencies: []
21
-
22
- description: A little SSH remote command launcher
23
- email: javier.juarez@gmail.com
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: choice
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: net-ssh
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ description: A little remote command launcher over SSH connections
50
+ email: javier.juarez_AT_ gmail_DOT_com
24
51
  executables:
25
52
  - remote_executor
26
53
  extensions: []
27
54
 
28
55
  extra_rdoc_files:
29
- - README
56
+ - README.rdoc
30
57
  files:
31
58
  - bin/remote_executor
32
59
  - lib/remote_executor.rb
@@ -34,11 +61,11 @@ files:
34
61
  - lib/remote_executor/config.rb
35
62
  - lib/remote_executor/options_parser.rb
36
63
  - lib/remote_executor/version.rb
37
- - README
64
+ - README.rdoc
38
65
  has_rdoc: true
39
66
  homepage: http://github.com/jjuarez/remote_executor
40
- licenses: []
41
-
67
+ licenses:
68
+ - MIT
42
69
  post_install_message:
43
70
  rdoc_options: []
44
71
 
@@ -64,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
91
  version: "0"
65
92
  requirements: []
66
93
 
67
- rubyforge_project:
94
+ rubyforge_project: http://github.com/jjuarez/remote_executor
68
95
  rubygems_version: 1.3.7
69
96
  signing_key:
70
97
  specification_version: 3
data/README DELETED
File without changes