oode 0.0.1
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/LICENSE +20 -0
- data/README.md +0 -0
- data/Rakefile +81 -0
- data/bin/oode +22 -0
- data/lib/oode.rb +2 -0
- data/lib/oode/colour.rb +9 -0
- data/lib/oode/version.rb +3 -0
- data/spec/oode_spec.rb +7 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +2 -0
- metadata +71 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Chris Brown
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
#
|
2
|
+
# Helpers
|
3
|
+
#
|
4
|
+
|
5
|
+
def command?(command)
|
6
|
+
`type -t #{command}`
|
7
|
+
$?.success?
|
8
|
+
end
|
9
|
+
|
10
|
+
task :load_oode do
|
11
|
+
$LOAD_PATH.unshift 'lib'
|
12
|
+
require 'oode'
|
13
|
+
end
|
14
|
+
|
15
|
+
task :check_dirty do
|
16
|
+
if !`git status`.include?('nothing to commit')
|
17
|
+
abort "dirty index - not publishing!"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Tests
|
24
|
+
#
|
25
|
+
|
26
|
+
begin
|
27
|
+
require 'spec/rake/spectask'
|
28
|
+
rescue LoadError
|
29
|
+
puts 'To use rspec for testing you must install rspec gem:'
|
30
|
+
puts '$ sudo gem install rspec'
|
31
|
+
exit
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Run the specs under spec"
|
35
|
+
Spec::Rake::SpecTask.new do |t|
|
36
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
37
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Default task is to run specs"
|
41
|
+
task :default => :spec
|
42
|
+
|
43
|
+
#
|
44
|
+
# Ron
|
45
|
+
#
|
46
|
+
|
47
|
+
if command? :ronn
|
48
|
+
desc "Show the manual"
|
49
|
+
task :man => "man:build" do
|
50
|
+
exec "man man/oode.1"
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Build the manual"
|
54
|
+
task "man:build" do
|
55
|
+
sh "ronn -br5 --organization=XOEBUS --manual='Oode Manual' man/*.ronn"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
#
|
61
|
+
# Gems
|
62
|
+
#
|
63
|
+
|
64
|
+
begin
|
65
|
+
require 'mg'
|
66
|
+
MG.new('oode.gemspec')
|
67
|
+
rescue LoadError
|
68
|
+
warn "mg not available."
|
69
|
+
warn "Install it with: gem install mg"
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
desc "Push a new version."
|
74
|
+
task :publish => "gem:publish" do
|
75
|
+
require 'oode/version'
|
76
|
+
sh "git tag v#{Oode::Version}"
|
77
|
+
sh "git push origin v#{Oode::Version}"
|
78
|
+
sh "git push origin master"
|
79
|
+
sh "gem push pkg/oode-#{Oode::Version}.gem"
|
80
|
+
sh "git clean -fd"
|
81
|
+
end
|
data/bin/oode
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "optparse"
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
6
|
+
require "oode"
|
7
|
+
|
8
|
+
options = {}
|
9
|
+
|
10
|
+
optparse = OptionParser.new do |opts|
|
11
|
+
opts.banner = "Usage: oode [options] filename"
|
12
|
+
|
13
|
+
options[:printer] = nil
|
14
|
+
opts.on( "-p", "--printer PRINTER", "The printer to send the file to." ) do |printer|
|
15
|
+
options[:printer] = printer
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
optparse.parse!
|
20
|
+
|
21
|
+
raise ArgumentError, 'Please specify a printer.' if options[:printer].nil?
|
22
|
+
|
data/lib/oode.rb
ADDED
data/lib/oode/colour.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
module Oode
|
2
|
+
# This wonderful code taken from http://github.com/michaeldv/awesome_print.
|
3
|
+
class String
|
4
|
+
[:gray, :red, :green, :yellow, :blue, :purple, :cyan, :white].each_with_index do |color, i|
|
5
|
+
define_method color do "\033[1;#{30+i}m#{self}\033[0m" end
|
6
|
+
define_method :"#{color}ish" do "\033[0;#{30+i}m#{self}\033[0m" end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
data/lib/oode/version.rb
ADDED
data/spec/oode_spec.rb
ADDED
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: oode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Chris Brown
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-04-25 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: oode prints to AT printers from laptops
|
22
|
+
email: cb@tardis.ed.ac.uk
|
23
|
+
executables:
|
24
|
+
- oode
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- README.md
|
31
|
+
- Rakefile
|
32
|
+
- LICENSE
|
33
|
+
- lib/oode/colour.rb
|
34
|
+
- lib/oode/version.rb
|
35
|
+
- lib/oode.rb
|
36
|
+
- bin/oode
|
37
|
+
- spec/oode_spec.rb
|
38
|
+
- spec/spec.opts
|
39
|
+
- spec/spec_helper.rb
|
40
|
+
has_rdoc: true
|
41
|
+
homepage: http://github.com/xoebus/oode
|
42
|
+
licenses: []
|
43
|
+
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
version: "0"
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
63
|
+
requirements: []
|
64
|
+
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 1.3.6
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: oode prints to AT printers from laptops
|
70
|
+
test_files: []
|
71
|
+
|