Class: Writefully::Tools::Synchronizer
- Inherits:
-
Object
- Object
- Writefully::Tools::Synchronizer
- Includes:
- Celluloid
- Defined in:
- lib/writefully/tools/synchronizer.rb
Constant Summary collapse
- SYNC_SCRIPT =
File.dirname(__FILE__) + "/../../../scripts/sync.sh"
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message) ⇒ Synchronizer
constructor
A new instance of Synchronizer.
- #sync ⇒ Object
- #sync_command ⇒ Object
Constructor Details
#initialize(message) ⇒ Synchronizer
Returns a new instance of Synchronizer.
10 11 12 |
# File 'lib/writefully/tools/synchronizer.rb', line 10 def initialize @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/writefully/tools/synchronizer.rb', line 8 def @message end |
Instance Method Details
#sync ⇒ Object
14 15 16 17 |
# File 'lib/writefully/tools/synchronizer.rb', line 14 def sync Writefully.logger.info "Synchronizing #{[:site_slug]}" system(sync_command) end |
#sync_command ⇒ Object
19 20 21 |
# File 'lib/writefully/tools/synchronizer.rb', line 19 def sync_command ['bash', SYNC_SCRIPT, Writefully.[:content], [:site_slug]].join(' ') end |