Module: Snatch
- Defined in:
- lib/snatch.rb,
lib/snatch/handler.rb,
lib/snatch/session.rb,
lib/snatch/version.rb
Defined Under Namespace
Classes: CredentialsError, NoDatabaseError, NoServiceError, Session, TransferHandler
Constant Summary collapse
- VERSION =
'1.0.2'
Class Method Summary collapse
- .root ⇒ Object
- .run(config) ⇒ Object
-
.valid_config?(path) ⇒ Boolean
Returns true if snatch config is valid.
Class Method Details
.root ⇒ Object
10 11 12 |
# File 'lib/snatch.rb', line 10 def self.root File.join(ENV['HOME'], '.snatch') end |
.run(config) ⇒ Object
14 15 16 17 |
# File 'lib/snatch.rb', line 14 def self.run(config) s = Snatch::Session.new(config) s.run! end |
.valid_config?(path) ⇒ Boolean
Returns true if snatch config is valid
20 21 22 23 24 25 26 27 |
# File 'lib/snatch.rb', line 20 def self.valid_config?(path) data = YAML.load_file(path) if data.kind_of?(Hash) (data.keys & ['host']).size == 1 else false end end |