Skip to content

Commit

Permalink
renames Pomodoro to Caprese
Browse files Browse the repository at this point in the history
  • Loading branch information
timcharper committed Oct 28, 2009
1 parent f40fdd2 commit 9af725c
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion actions/adium_status.rb
@@ -1,4 +1,4 @@
class AdiumStatus < PomodoroAction
class AdiumStatus < CapreseAction
include Appscript

config_schema({:away => String, :available => String})
Expand Down
2 changes: 1 addition & 1 deletion actions/block_domains.rb
@@ -1,4 +1,4 @@
class BlockDomains < PomodoroAction
class BlockDomains < CapreseAction
config_schema({String => Object})

def start
Expand Down
2 changes: 1 addition & 1 deletion actions/campfire.rb
@@ -1,6 +1,6 @@
require 'tinder'

class Campfire < PomodoroAction
class Campfire < CapreseAction
config_schema({:start_message => String, :stop_message => String, :campfire => {:domain => String, :room => String, :login => String, :pass => String}})

def campfire_config
Expand Down
2 changes: 1 addition & 1 deletion actions/launch_applications.rb
@@ -1,4 +1,4 @@
class LaunchApplications < PomodoroAction
class LaunchApplications < CapreseAction
include ApplicationAction

def start
Expand Down
2 changes: 1 addition & 1 deletion actions/quit_and_block_applications.rb
@@ -1,4 +1,4 @@
class QuitAndBlockApplications < PomodoroAction
class QuitAndBlockApplications < CapreseAction
include ApplicationAction

def start
Expand Down
2 changes: 1 addition & 1 deletion actions/quit_applications.rb
@@ -1,4 +1,4 @@
class QuitApplications < PomodoroAction
class QuitApplications < CapreseAction
include ApplicationAction

def start
Expand Down
6 changes: 3 additions & 3 deletions caprese
Expand Up @@ -5,9 +5,9 @@ ArgParser.extract_env_variables(ARGV)
action = ARGV.shift

Actions = {
"start" => lambda { Pomodoro.start },
"stop" => lambda { Pomodoro.stop },
"check-config" => lambda { Pomodoro.check_config && puts("Configuration is valid") }
"start" => lambda { Caprese.start },
"stop" => lambda { Caprese.stop },
"check-config" => lambda { Caprese.check_config && puts("Configuration is valid") }
}

if action && Actions[action]
Expand Down
6 changes: 3 additions & 3 deletions lib/pomodoro.rb → lib/caprese.rb
@@ -1,12 +1,12 @@
class Pomodoro
class Caprese
def self.config
@config = CapreseConfigurator.new
end

def self.actions
config.actions
end

def self.start
unless actions_with_errors.empty?
errors = actions_with_errors.map {|a| "#{a.class}:\n" + format_errors(a.errors) }.join("\n")
Expand All @@ -18,7 +18,7 @@ def self.start
actions.each { |action| action.start }
end
end

def self.stop
with_growl_notification("stop") do
actions.each { |action| action.stop }
Expand Down
2 changes: 1 addition & 1 deletion lib/pomodoro_action.rb → lib/caprese_action.rb
@@ -1,4 +1,4 @@
class PomodoroAction
class CapreseAction
attr_reader :config

def initialize(config)
Expand Down
2 changes: 1 addition & 1 deletion lib/caprese_configurator.rb
Expand Up @@ -21,7 +21,7 @@ def actions
end

def method_missing(method, *args)
if /[A-Z]/.match(method.to_s) && Object.const_defined?(method) && Object.const_get(method).ancestors.include?(PomodoroAction)
if /[A-Z]/.match(method.to_s) && Object.const_defined?(method) && Object.const_get(method).ancestors.include?(CapreseAction)
@config << [method, args]
else
super
Expand Down
12 changes: 6 additions & 6 deletions spec/pomodoro_action_spec.rb → spec/caprese_action_spec.rb
@@ -1,10 +1,10 @@
require File.expand_path("spec_helper", File.dirname(__FILE__))

describe PomodoroAction do
describe CapreseAction do
describe ".config_schema" do
context "[String]" do
before(:each) do
@klass = Class.new(PomodoroAction) do
@klass = Class.new(CapreseAction) do
config_schema [String]
end
end
Expand All @@ -20,7 +20,7 @@

context "{...}" do
before(:each) do
@klass = Class.new(PomodoroAction) do
@klass = Class.new(CapreseAction) do
config_schema({String => Object})
end
end
Expand All @@ -38,7 +38,7 @@
describe "#validate" do
context "schema is [String]" do
before(:each) do
@klass = Class.new(PomodoroAction) do
@klass = Class.new(CapreseAction) do
config_schema [String]
end
end
Expand All @@ -52,7 +52,7 @@

context "schema is {String => String}" do
before(:each) do
@klass = Class.new(PomodoroAction) do
@klass = Class.new(CapreseAction) do
config_schema({String => String})
end
end
Expand All @@ -78,7 +78,7 @@

context "schema is {:message => String, :credentials => {:name => String, :pass => String}}" do
before(:each) do
@klass = Class.new(PomodoroAction) do
@klass = Class.new(CapreseAction) do
config_schema({:message => String, :credentials => {:name => String, :pass => String}})
end
end
Expand Down

0 comments on commit 9af725c

Please sign in to comment.