Class: Rack::Rsync
- Inherits:
-
Object
- Object
- Rack::Rsync
- Defined in:
- lib/rack/rsync.rb,
lib/rack/rsync/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, source, destination, *options, &condition) ⇒ Rsync
constructor
A new instance of Rsync.
Constructor Details
#initialize(app, source, destination, *options, &condition) ⇒ Rsync
Returns a new instance of Rsync.
7 8 9 10 11 12 13 |
# File 'lib/rack/rsync.rb', line 7 def initialize(app, source, destination, *, &condition) @app = app @source = source @destination = destination @options = [*] @condition = condition || Proc.new { true } end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
5 6 7 |
# File 'lib/rack/rsync.rb', line 5 def destination @destination end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/rack/rsync.rb', line 5 def @options end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/rack/rsync.rb', line 5 def source @source end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 |
# File 'lib/rack/rsync.rb', line 15 def call(env) res = @app.call(env) sync if should_run?(env) res end |