Module: Reloadapp
- Defined in:
- lib/reloadapp.rb,
lib/reloadapp/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"- @@token =
''
Class Method Summary collapse
Class Method Details
.change_event ⇒ Object
12 13 14 15 |
# File 'lib/reloadapp.rb', line 12 def self.change_event `curl -silet http://reloadapp.com/faye -d 'message={"channel" :"/websites/#{@@token}/reload", "data":"reload"}' > /dev/null` puts "sending reload request" end |
.on_change(&block) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/reloadapp.rb', line 17 def self.on_change &block FSEvent.new.tap do |fsevent| fsevent.watch('.', &block) fsevent.run end end |
.run(token) ⇒ Object
7 8 9 10 |
# File 'lib/reloadapp.rb', line 7 def self.run(token) @@token = token on_change { change_event } end |