Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Terminal action in order to automate the workflow and launch a …
…Terminal the first pomodoro of the day and maybe use http://github.com/achiu/terminitor to configure which tabs to open
- Loading branch information
21croissants
committed
Oct 4, 2010
1 parent
5f54f1f
commit 8378f0e
Showing
3 changed files
with
48 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,22 @@ | ||
class Terminal < CapreseAction | ||
include Appscript | ||
config_schema [String] | ||
|
||
def start | ||
unless Terminal.caprese_application.running? | ||
Terminal.caprese_application.activate! | ||
app = Terminal.caprese_application.handle | ||
app.do_script(config, :in => app.windows.first) | ||
end | ||
end | ||
|
||
def stop | ||
end | ||
|
||
class << self | ||
def caprese_application | ||
@@terminal ||= Application.new("Terminal") | ||
end | ||
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,25 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | ||
|
||
describe Terminal do | ||
|
||
before :each do | ||
@action = Terminal.new(["echo 'hello world!'"]) | ||
end | ||
|
||
describe "#start" do | ||
it "launch a Terminal only if it isn't running already" do | ||
@action.start | ||
Terminal.caprese_application.should be_running | ||
end | ||
|
||
it "should run the script in the first windows" do | ||
# I don't know how to write a test for this! | ||
end | ||
|
||
after :each do | ||
Terminal.caprese_application.quit! | ||
end | ||
|
||
end | ||
|
||
end |