Class: Piggy::CLI
Class Method Summary collapse
Instance Method Summary collapse
- #event(title) ⇒ Object
- #history ⇒ Object
- #install ⇒ Object
- #subscribe(subscriber) ⇒ Object
- #version ⇒ Object
Class Method Details
.source_root ⇒ Object
11 12 13 |
# File 'lib/piggy/cli.rb', line 11 def self.source_root File.('../../../templates', __FILE__) end |
Instance Method Details
#event(title) ⇒ Object
36 37 38 |
# File 'lib/piggy/cli.rb', line 36 def event(title) Event.create title end |
#history ⇒ Object
41 42 43 |
# File 'lib/piggy/cli.rb', line 41 def history puts Event.all if Event.any? end |
#install ⇒ Object
22 23 24 25 26 27 |
# File 'lib/piggy/cli.rb', line 22 def install copy_file "git_hook", ".git/hooks/post-commit" chmod ".git/hooks/post-commit", 0755 puts "Successfully installed git hook." puts "Piggy is now monitoring the git commits made in this project." end |
#subscribe(subscriber) ⇒ Object
30 31 32 33 |
# File 'lib/piggy/cli.rb', line 30 def subscribe(subscriber) Subscribers.add subscriber puts "Piggy is now sending events to '#{subscriber}'." end |