bigcat 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/BigCat.gemspec +54 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +25 -0
- data/README.md +4 -0
- data/Rakefile +21 -0
- data/VERSION +1 -0
- data/bin/bigcat +7 -0
- data/lib/bigcat.rb +19 -0
- data/spec/integration/bigcat_spec.rb +87 -0
- metadata +116 -0
data/BigCat.gemspec
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{bigcat}
|
8
|
+
s.version = "1.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Nolan Eakins"]
|
12
|
+
s.date = %q{2011-09-01}
|
13
|
+
s.default_executable = %q{bigcat}
|
14
|
+
s.description = %q{I cat BIG.}
|
15
|
+
s.email = %q{sneakin+bigcat@semanticgap.com}
|
16
|
+
s.executables = ["bigcat"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README.md"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
"BigCat.gemspec",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"README.md",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"bin/bigcat",
|
28
|
+
"lib/bigcat.rb",
|
29
|
+
"spec/integration/bigcat_spec.rb"
|
30
|
+
]
|
31
|
+
s.homepage = %q{http://github.com/sneakin/BigCat}
|
32
|
+
s.require_paths = ["lib"]
|
33
|
+
s.rubygems_version = %q{1.4.1}
|
34
|
+
s.summary = %q{RAWR!!}
|
35
|
+
|
36
|
+
if s.respond_to? :specification_version then
|
37
|
+
s.specification_version = 3
|
38
|
+
|
39
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
40
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
41
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
42
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
43
|
+
else
|
44
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
45
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
46
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
47
|
+
end
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
50
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
51
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.3)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.6.4)
|
7
|
+
bundler (~> 1.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rake (0.9.2)
|
11
|
+
rspec (2.6.0)
|
12
|
+
rspec-core (~> 2.6.0)
|
13
|
+
rspec-expectations (~> 2.6.0)
|
14
|
+
rspec-mocks (~> 2.6.0)
|
15
|
+
rspec-core (2.6.4)
|
16
|
+
rspec-expectations (2.6.0)
|
17
|
+
diff-lcs (~> 1.1.2)
|
18
|
+
rspec-mocks (2.6.0)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
jeweler
|
25
|
+
rspec
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'jeweler'
|
3
|
+
Jeweler::Tasks.new do |gem|
|
4
|
+
gem.name = "bigcat"
|
5
|
+
gem.summary = %Q{RAWR!!}
|
6
|
+
gem.description = %Q{I cat BIG.}
|
7
|
+
gem.email = "sneakin+bigcat@semanticgap.com"
|
8
|
+
gem.homepage = "http://github.com/sneakin/BigCat"
|
9
|
+
gem.authors = ["Nolan Eakins"]
|
10
|
+
gem.add_development_dependency "rspec"
|
11
|
+
gem.executables = [ 'bigcat' ]
|
12
|
+
end
|
13
|
+
Jeweler::GemcutterTasks.new
|
14
|
+
rescue LoadError
|
15
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'rspec/core/rake_task'
|
19
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
20
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
21
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.2
|
data/bin/bigcat
ADDED
data/lib/bigcat.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module BigCat
|
2
|
+
class Command
|
3
|
+
def initialize()
|
4
|
+
end
|
5
|
+
|
6
|
+
def run!
|
7
|
+
begin
|
8
|
+
line = $stdin.readline
|
9
|
+
if line == "\n"
|
10
|
+
$stdout.puts("\n\n")
|
11
|
+
else
|
12
|
+
$stdout.puts("\e#3#{line}\e#4#{line}")
|
13
|
+
end
|
14
|
+
$stdout.flush
|
15
|
+
end while true
|
16
|
+
rescue EOFError
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
describe 'bigcat' do
|
2
|
+
let!(:bigcat) { Pathname.new(__FILE__).parent.parent.parent.join('bin', 'bigcat') }
|
3
|
+
|
4
|
+
def run(&block)
|
5
|
+
IO.popen(bigcat, 'r+') do |io|
|
6
|
+
if block
|
7
|
+
block.call(io)
|
8
|
+
else
|
9
|
+
io.close
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
$?.exitstatus
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'without any arguments' do
|
17
|
+
context 'immediate EOF' do
|
18
|
+
it "exits with retval of 0" do
|
19
|
+
run.should == 0
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'immediate newline' do
|
24
|
+
it "writes two empty lines" do
|
25
|
+
run do |io|
|
26
|
+
io.puts("")
|
27
|
+
io.read(2).should == "\n\n"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
it "exits on EOF" do
|
32
|
+
ret = run do |io|
|
33
|
+
io.puts
|
34
|
+
io.read(2)
|
35
|
+
io.close
|
36
|
+
end
|
37
|
+
ret.should == 0
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'multiple newlines' do
|
42
|
+
it "writes two empty lines for each line" do
|
43
|
+
run do |io|
|
44
|
+
io.write("\n\n\n")
|
45
|
+
io.read(6).should == "\n\n\n\n\n\n"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'line with characters' do
|
51
|
+
let!(:string) { "Hello" }
|
52
|
+
|
53
|
+
it "writes the line as two lines wrapped with VT100's top half double sized escape" do
|
54
|
+
run do |io|
|
55
|
+
io.puts(string)
|
56
|
+
io.readline.should == "\e#3#{string}\n"
|
57
|
+
io.readline.should == "\e#4#{string}\n"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
it "is waiting for more input" do
|
62
|
+
run do |io|
|
63
|
+
io.puts(string)
|
64
|
+
io.readline
|
65
|
+
io.readline
|
66
|
+
|
67
|
+
io.puts(string)
|
68
|
+
io.readline.should_not be_empty
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'multiple lines before EOF' do
|
74
|
+
it "writes each line wrapped as line pairs with VT100's double size escape sequences" do
|
75
|
+
run do |io|
|
76
|
+
io.puts("hello")
|
77
|
+
io.puts("world")
|
78
|
+
|
79
|
+
io.readline.should == "\e#3hello\n"
|
80
|
+
io.readline.should == "\e#4hello\n"
|
81
|
+
io.readline.should == "\e#3world\n"
|
82
|
+
io.readline.should == "\e#4world\n"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bigcat
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Nolan Eakins
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-09-01 00:00:00 -04:00
|
19
|
+
default_executable: bigcat
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :development
|
32
|
+
name: jeweler
|
33
|
+
requirement: *id001
|
34
|
+
prerelease: false
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 3
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
type: :development
|
46
|
+
name: rspec
|
47
|
+
requirement: *id002
|
48
|
+
prerelease: false
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
type: :development
|
60
|
+
name: rspec
|
61
|
+
requirement: *id003
|
62
|
+
prerelease: false
|
63
|
+
description: I cat BIG.
|
64
|
+
email: sneakin+bigcat@semanticgap.com
|
65
|
+
executables:
|
66
|
+
- bigcat
|
67
|
+
extensions: []
|
68
|
+
|
69
|
+
extra_rdoc_files:
|
70
|
+
- README.md
|
71
|
+
files:
|
72
|
+
- BigCat.gemspec
|
73
|
+
- Gemfile
|
74
|
+
- Gemfile.lock
|
75
|
+
- README.md
|
76
|
+
- Rakefile
|
77
|
+
- VERSION
|
78
|
+
- bin/bigcat
|
79
|
+
- lib/bigcat.rb
|
80
|
+
- spec/integration/bigcat_spec.rb
|
81
|
+
has_rdoc: true
|
82
|
+
homepage: http://github.com/sneakin/BigCat
|
83
|
+
licenses: []
|
84
|
+
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
requirements: []
|
109
|
+
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 1.4.1
|
112
|
+
signing_key:
|
113
|
+
specification_version: 3
|
114
|
+
summary: RAWR!!
|
115
|
+
test_files: []
|
116
|
+
|