Class: Pieces::Listener
- Inherits:
-
Object
- Object
- Pieces::Listener
- Defined in:
- lib/pieces/listener.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Listener
constructor
A new instance of Listener.
- #listen ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Listener
Returns a new instance of Listener.
5 6 7 8 |
# File 'lib/pieces/listener.rb', line 5 def initialize(config = {}) @path = config[:path] || Dir.pwd build_pieces end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/pieces/listener.rb', line 3 def path @path end |
Instance Method Details
#listen ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pieces/listener.rb', line 10 def listen Listen.to("#{path}/config/", "#{path}/app/views/") do print "Rebuilding #{path}... " build_pieces puts 'done.' end.tap(&:start) end |