Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change property name

  • Loading branch information...
commit f2883873b73804f6947c2a402029290e7778ff41 1 parent 1edeeeb
jugyo authored
View
2  lib/termtter/client.rb
@@ -282,7 +282,7 @@ def run
call_hooks([], :initialize)
call_new_hooks(:initialize)
- @@task_manager.add_task(:repeat_interval => configatron.update_interval) do
+ @@task_manager.add_task(:interval => configatron.update_interval) do
begin
statuses = Termtter::API.twitter.get_friends_timeline(@@since_id)
unless statuses.empty?
View
4 lib/termtter/task.rb
@@ -1,9 +1,9 @@
module Termtter
class Task
- attr_accessor :exec_at, :exec_proc, :repeat_interval
+ attr_accessor :exec_at, :exec_proc, :interval
def initialize(args = {}, &block)
@exec_at = Time.now + (args[:after] || 0)
- @repeat_interval = args[:repeat_interval]
+ @interval = args[:interval]
@exec_proc = block || proc {}
end
def execute
View
4 lib/termtter/task_manager.rb
@@ -67,8 +67,8 @@ def pull_due_tasks()
@tasks.delete_if do |task|
if task.exec_at <= time_now
due_tasks << task
- if task.repeat_interval
- task.exec_at = time_now + task.repeat_interval
+ if task.interval
+ task.exec_at = time_now + task.interval
false
else
true
View
2  spec/termtter/task_manager_spec.rb
@@ -54,7 +54,7 @@ module Termtter
Time.stub!(:now).and_return(time_now)
called_count = 0
- @task_manager.add_task(:repeat_interval => 10) {called_count += 1}
+ @task_manager.add_task(:interval => 10) {called_count += 1}
@task_manager.step
called_count.should == 1
Please sign in to comment.
Something went wrong with that request. Please try again.