rename to screenomat

This commit is contained in:
John Bintz 2010-12-09 16:59:12 -05:00
parent b71d9039f4
commit 906d85da36
17 changed files with 63 additions and 64 deletions

4
.screenomat Normal file
View File

@ -0,0 +1,4 @@
session do
screen! "bundle exec autotest", :title => 'autotest'
screen :title => 'command prompt'
end

View File

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
screenie (0.0.1) screenomat (0.0.1)
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
@ -30,4 +30,4 @@ DEPENDENCIES
bundler (>= 1.0.0) bundler (>= 1.0.0)
mocha mocha
rspec rspec
screenie! screenomat!

View File

@ -1,11 +1,11 @@
# screenie # screenomat
You like screen, I like screen. Make getting those big multi-command line-running projects You like screen, I like screen. Make getting those big multi-command line-running projects
even easier to get started up with `screenie`. even easier to get started up with `screenomat`.
## How? ## How?
Make a `.screenie` file in your app and write: Make a `.screenomat` file in your app and write:
<pre> <pre>
session do session do
@ -19,7 +19,7 @@ end
Then run: Then run:
screenie screenomat
_~~whoa~~_ _~~whoa~~_
@ -43,23 +43,23 @@ end
Then run: Then run:
screenie backend screenomat backend
or even: or even:
screenie frontend screenomat frontend
## Defaults? ## Defaults?
Like magic `screenie` bits anywhere? `~/.screenie` is what you want! Same syntax! Like magic `screenomat` bits anywhere? `~/.screenomat` is what you want! Same syntax!
## Ruby? DRY? ## Ruby? DRY?
Just like `Gemfile`, `*.gemspec`, and other modern Ruby things, `.screenie` is Ruby code. Like Just like `Gemfile`, `*.gemspec`, and other modern Ruby things, `.screenomat` is Ruby code. Like
DRYing things? You can do it! DRYing things? You can do it!
<pre> <pre>
class Screenie::DSL::Session class Screenomat::DSL::Session
def whoa(&block) def whoa(&block)
screen :title => "first" screen :title => "first"
instance_eval(&block) instance_eval(&block)

View File

@ -1,13 +1,13 @@
#!which ruby #!which ruby
require 'getoptlong' require 'getoptlong'
require 'screenie/dsl/builder' require 'screenomat/dsl/builder'
opt = GetoptLong.new( opt = GetoptLong.new(
[ '--input', '-i', GetoptLong::REQUIRED_ARGUMENT ] [ '--input', '-i', GetoptLong::REQUIRED_ARGUMENT ]
) )
files = %w{.screenie ~/.screenie} files = %w{.screenomat ~/.screenomat}
opt.each do |key, value| opt.each do |key, value|
case key case key
@ -20,7 +20,7 @@ session_name = ARGV.shift
files.each do |path| files.each do |path|
if File.exist?(target = File.expand_path(path)) if File.exist?(target = File.expand_path(path))
sessions = Screenie::DSL::Builder.new(File.read(target)) sessions = Screenomat::DSL::Builder.new(File.read(target))
if !session_name || session_name.empty? if !session_name || session_name.empty?
session = sessions.first session = sessions.first

View File

@ -1,3 +0,0 @@
module Screenie
end

View File

3
lib/screenomat.rb Normal file
View File

@ -0,0 +1,3 @@
module Screenomat
end

View File

@ -1,6 +1,6 @@
require 'screenie/dsl/session' require 'screenomat/dsl/session'
module Screenie module Screenomat
module DSL module DSL
class Builder class Builder
attr_reader :sessions attr_reader :sessions

View File

@ -1,4 +1,4 @@
module Screenie module Screenomat
module DSL module DSL
class Screen class Screen
attr_accessor :screen_id attr_accessor :screen_id

View File

@ -1,6 +1,6 @@
require 'screenie/dsl/screen' require 'screenomat/dsl/screen'
module Screenie module Screenomat
module DSL module DSL
class Session class Session
attr_accessor :name attr_accessor :name

View File

@ -1,3 +1,3 @@
module Screenie module Screenomat
VERSION = '0.0.1' VERSION = '0.0.1'
end end

View File

@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
require File.expand_path("../lib/screenie/version", __FILE__) require File.expand_path("../lib/screenomat/version", __FILE__)
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "screenie" s.name = "screenomat"
s.version = Screenie::VERSION s.version = Screenomat::VERSION
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.authors = [] s.authors = []
s.email = [] s.email = []

View File

@ -1,24 +0,0 @@
require 'spec_helper'
require 'screenie/dsl/builder'
describe Screenie::DSL::Builder do
describe '#sessions' do
context 'from block' do
subject { Screenie::DSL::Builder.new { session("cats") { } }}
specify { subject[:cats].should_not be_nil }
end
context 'from code' do
subject { Screenie::DSL::Builder.new(%{session("cats") { } })}
specify { subject[:cats].should_not be_nil }
end
end
describe '#first' do
subject { Screenie::DSL::Builder.new { session do; end }}
its(:first) { should be_a_kind_of(Screenie::DSL::Session) }
end
end

View File

@ -1,5 +0,0 @@
require 'spec_helper'
describe Screenie do
end

View File

@ -0,0 +1,24 @@
require 'spec_helper'
require 'screenomat/dsl/builder'
describe Screenomat::DSL::Builder do
describe '#sessions' do
context 'from block' do
subject { Screenomat::DSL::Builder.new { session("cats") { } }}
specify { subject[:cats].should_not be_nil }
end
context 'from code' do
subject { Screenomat::DSL::Builder.new(%{session("cats") { } })}
specify { subject[:cats].should_not be_nil }
end
end
describe '#first' do
subject { Screenomat::DSL::Builder.new { session do; end }}
its(:first) { should be_a_kind_of(Screenomat::DSL::Session) }
end
end

View File

@ -1,9 +1,9 @@
require 'spec_helper' require 'spec_helper'
require 'screenie/dsl/screen' require 'screenomat/dsl/screen'
describe Screenie::DSL::Screen do describe Screenomat::DSL::Screen do
describe '#to_cmd' do describe '#to_cmd' do
let(:screen) { Screenie::DSL::Screen.new(*params) } let(:screen) { Screenomat::DSL::Screen.new(*params) }
subject { screen } subject { screen }

View File

@ -1,11 +1,11 @@
require 'spec_helper' require 'spec_helper'
require 'screenie/dsl/session' require 'screenomat/dsl/session'
describe Screenie::DSL::Session do describe Screenomat::DSL::Session do
describe '#to_cmd' do describe '#to_cmd' do
context 'one screen' do context 'one screen' do
subject { subject {
Screenie::DSL::Session.new("my-session") { screen "test" }.to_cmd Screenomat::DSL::Session.new("my-session") { screen "test" }.to_cmd
} }
it { should == [ it { should == [
@ -18,7 +18,7 @@ describe Screenie::DSL::Session do
context 'two screens' do context 'two screens' do
subject { subject {
Screenie::DSL::Session.new("my-session") { screen "test"; screen "test2" }.to_cmd Screenomat::DSL::Session.new("my-session") { screen "test"; screen "test2" }.to_cmd
} }
it { should == [ it { should == [
@ -35,7 +35,7 @@ describe Screenie::DSL::Session do
describe 'from string' do describe 'from string' do
subject { subject {
Screenie::DSL::Session.new("my-session", <<-EOR).to_cmd Screenomat::DSL::Session.new("my-session", <<-EOR).to_cmd
screen "test" screen "test"
EOR EOR
} }
@ -50,7 +50,7 @@ screen "test"
describe 'screen!' do describe 'screen!' do
subject { subject {
Screenie::DSL::Session.new("my-session") { screen "test"; screen! "test2" }.to_cmd Screenomat::DSL::Session.new("my-session") { screen "test"; screen! "test2" }.to_cmd
} }
it { should == [ it { should == [