-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
21croissants
committed
Oct 2, 2010
1 parent
96d21e8
commit d31a5d7
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class SkypeStatus < CapreseAction | ||
include Appscript | ||
|
||
config_schema({:away => String, :available => String}) | ||
|
||
def start | ||
set_status("dnd") | ||
set_status_message(config[:away]) | ||
end | ||
|
||
def stop | ||
set_status("online") | ||
set_status_message(config[:available]) | ||
end | ||
|
||
def skype | ||
@skype ||= app("Skype") | ||
end | ||
|
||
private | ||
|
||
def set_status(status) | ||
skype.send_(:command => "set userstatus #{status}", :script_name => "caprese") | ||
end | ||
|
||
def set_status_message(message) | ||
skype.send_(:command => "set profile mood_text #{message}", :script_name => "caprese") | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | ||
|
||
describe SkypeStatus do | ||
|
||
before :each do | ||
@action = SkypeStatus.new( | ||
:away => "Pomodoro! Ends", | ||
:available => "Available" | ||
) | ||
end | ||
|
||
# spces are commented as Skype needs to be running | ||
describe "status update" do | ||
it "can set status to Do Not Disturb when pomodoro starts" do | ||
# @action.start | ||
end | ||
|
||
it "can set status to online when pomodoro ends" do | ||
# @action.stop | ||
end | ||
end | ||
|
||
end |