Module: Kinksync
- Defined in:
- lib/kinksync.rb,
lib/kinksync/version.rb,
lib/kinksync/file_2_sync.rb,
lib/kinksync/path_2_sync.rb,
lib/kinksync/configuration.rb
Overview
Kynsync parent module for all classes. Provides methods for configuration and synchronization of a group of files and/or directories
Defined Under Namespace
Classes: Configuration, File2Sync, Path2Sync
Constant Summary collapse
- VERSION =
Current gem version
'0.1.0'.freeze
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns current configuration or initializes an empty one and returns it.
Class Method Summary collapse
-
.configure {|configuration| ... } ⇒ Object
Configures a Kynksync module with the values provided through the block it recieves.
-
.reset ⇒ Object
Resets configuration: all attributes are set to nil.
-
.sync(paths_to_sync = []) ⇒ Object
Syncs lists of files and paths recieved as arguments.
Class Attribute Details
.configuration ⇒ Object
Returns current configuration or initializes an empty one and returns it
39 40 41 |
# File 'lib/kinksync.rb', line 39 def self.configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
Configures a Kynksync module with the values provided through the block it recieves
32 33 34 |
# File 'lib/kinksync.rb', line 32 def self.configure yield(configuration) end |
.reset ⇒ Object
Resets configuration: all attributes are set to nil
46 47 48 |
# File 'lib/kinksync.rb', line 46 def self.reset @configuration = nil end |
.sync(paths_to_sync = []) ⇒ Object
Syncs lists of files and paths recieved as arguments. If no arg is provided syncs all files in remote path
63 64 65 66 67 68 |
# File 'lib/kinksync.rb', line 63 def self.sync(paths_to_sync = []) synced = [] paths_to_sync = [Kinksync.configuration.remote_path] if paths_to_sync.empty? paths_to_sync.each { |p| synced += Path2Sync.new(p).sync } synced end |