Class: Blastr::Process
- Inherits:
-
Object
- Object
- Blastr::Process
- Defined in:
- lib/blastr.rb
Instance Method Summary collapse
- #announce(commit) ⇒ Object
-
#initialize(args) ⇒ Process
constructor
A new instance of Process.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Process
Returns a new instance of Process.
21 22 23 24 25 26 27 28 |
# File 'lib/blastr.rb', line 21 def initialize(args) Blastr::trap_and_exit("INT") validate(args) scm_url = args[0] @scm = Blastr::SourceControl.implementation_for(scm_url) @since_revision = @scm.as_revision(args[1]) if args.size > 1 @since_revision = @scm.latest_revision unless args.size > 1 end |
Instance Method Details
#announce(commit) ⇒ Object
38 39 40 41 |
# File 'lib/blastr.rb', line 38 def announce(commit) puts "[#{commit.revision}] Commit by #{commit.author}: #{commit.comment}" Blastr::TTS.speak("Commit by #{People.full_name_of(commit.author)}: #{commit.comment}") end |
#run ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/blastr.rb', line 30 def run puts "Polling #{@scm.name} commits since revision #{@since_revision}..." while should_run? announce_new_commits sleep 30 end end |