holman 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +151 -0
- data/bin/holman +3 -0
- data/holman.gemspec +55 -0
- data/lib/holman.rb +53 -0
- metadata +70 -0
data/Rakefile
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
#############################################################################
|
6
|
+
#
|
7
|
+
# Helper functions
|
8
|
+
#
|
9
|
+
#############################################################################
|
10
|
+
|
11
|
+
def name
|
12
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
13
|
+
end
|
14
|
+
|
15
|
+
def version
|
16
|
+
#line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
17
|
+
#line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
18
|
+
"0.0.1"
|
19
|
+
end
|
20
|
+
|
21
|
+
def date
|
22
|
+
Date.today.to_s
|
23
|
+
end
|
24
|
+
|
25
|
+
def rubyforge_project
|
26
|
+
name
|
27
|
+
end
|
28
|
+
|
29
|
+
def gemspec_file
|
30
|
+
"#{name}.gemspec"
|
31
|
+
end
|
32
|
+
|
33
|
+
def gem_file
|
34
|
+
"#{name}-#{version}.gem"
|
35
|
+
end
|
36
|
+
|
37
|
+
def replace_header(head, header_name)
|
38
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
39
|
+
end
|
40
|
+
|
41
|
+
#############################################################################
|
42
|
+
#
|
43
|
+
# Standard tasks
|
44
|
+
#
|
45
|
+
#############################################################################
|
46
|
+
|
47
|
+
task :default => :test
|
48
|
+
|
49
|
+
require 'rake/testtask'
|
50
|
+
Rake::TestTask.new(:test) do |test|
|
51
|
+
test.libs << 'lib' << 'test'
|
52
|
+
test.pattern = 'test/**/test_*.rb'
|
53
|
+
test.verbose = true
|
54
|
+
end
|
55
|
+
|
56
|
+
desc "Generate RCov test coverage and open in your browser"
|
57
|
+
task :coverage do
|
58
|
+
require 'rcov'
|
59
|
+
sh "rm -fr coverage"
|
60
|
+
sh "rcov test/test_*.rb"
|
61
|
+
sh "open coverage/index.html"
|
62
|
+
end
|
63
|
+
|
64
|
+
require 'rake/rdoctask'
|
65
|
+
Rake::RDocTask.new do |rdoc|
|
66
|
+
rdoc.rdoc_dir = 'rdoc'
|
67
|
+
rdoc.title = "#{name} #{version}"
|
68
|
+
rdoc.rdoc_files.include('README*')
|
69
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
70
|
+
end
|
71
|
+
|
72
|
+
desc "Open an irb session preloaded with this library"
|
73
|
+
task :console do
|
74
|
+
sh "irb -rubygems -r ./lib/#{name}.rb"
|
75
|
+
end
|
76
|
+
|
77
|
+
#############################################################################
|
78
|
+
#
|
79
|
+
# Custom tasks (add your own tasks here)
|
80
|
+
#
|
81
|
+
#############################################################################
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
#############################################################################
|
86
|
+
#
|
87
|
+
# Packaging tasks
|
88
|
+
#
|
89
|
+
#############################################################################
|
90
|
+
|
91
|
+
desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
|
92
|
+
task :release => :build do
|
93
|
+
unless `git branch` =~ /^\* master$/
|
94
|
+
puts "You must be on the master branch to release!"
|
95
|
+
exit!
|
96
|
+
end
|
97
|
+
#sh "git commit --allow-empty -a -m 'Release #{version}'"
|
98
|
+
#sh "git tag v#{version}"
|
99
|
+
sh "git push origin master"
|
100
|
+
#sh "git push origin v#{version}"
|
101
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
102
|
+
end
|
103
|
+
|
104
|
+
desc "Build #{gem_file} into the pkg directory"
|
105
|
+
task :build => :gemspec do
|
106
|
+
sh "mkdir -p pkg"
|
107
|
+
sh "gem build #{gemspec_file}"
|
108
|
+
sh "mv #{gem_file} pkg"
|
109
|
+
end
|
110
|
+
|
111
|
+
desc "Generate #{gemspec_file}"
|
112
|
+
task :gemspec => :validate do
|
113
|
+
# read spec file and split out manifest section
|
114
|
+
spec = File.read(gemspec_file)
|
115
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
116
|
+
|
117
|
+
# replace name version and date
|
118
|
+
replace_header(head, :name)
|
119
|
+
replace_header(head, :version)
|
120
|
+
replace_header(head, :date)
|
121
|
+
#comment this out if your rubyforge_project has a different name
|
122
|
+
replace_header(head, :rubyforge_project)
|
123
|
+
|
124
|
+
# determine file list from git ls-files
|
125
|
+
files = `git ls-files`.
|
126
|
+
split("\n").
|
127
|
+
sort.
|
128
|
+
reject { |file| file =~ /^\./ }.
|
129
|
+
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
130
|
+
map { |file| " #{file}" }.
|
131
|
+
join("\n")
|
132
|
+
|
133
|
+
# piece file back together and write
|
134
|
+
manifest = " s.files = %w[\n#{files}\n ]\n"
|
135
|
+
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
136
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
137
|
+
puts "Updated #{gemspec_file}"
|
138
|
+
end
|
139
|
+
|
140
|
+
desc "Validate #{gemspec_file}"
|
141
|
+
task :validate do
|
142
|
+
libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
|
143
|
+
unless libfiles.empty?
|
144
|
+
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
145
|
+
exit!
|
146
|
+
end
|
147
|
+
unless Dir['VERSION*'].empty?
|
148
|
+
puts "A `VERSION` file at root level violates Gem best practices."
|
149
|
+
exit!
|
150
|
+
end
|
151
|
+
end
|
data/bin/holman
ADDED
data/holman.gemspec
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
## This is the rakegem gemspec template. Make sure you read and understand
|
2
|
+
## all of the comments. Some sections require modification, and others can
|
3
|
+
## be deleted if you don't need them. Once you understand the contents of
|
4
|
+
## this file, feel free to delete any comments that begin with two hash marks.
|
5
|
+
## You can find comprehensive Gem::Specification documentation, at
|
6
|
+
## http://docs.rubygems.org/read/chapter/20
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
|
+
s.rubygems_version = '1.3.5'
|
11
|
+
|
12
|
+
## Leave these as is they will be modified for you by the rake gemspec task.
|
13
|
+
## If your rubyforge_project name is different, then edit it and comment out
|
14
|
+
## the sub! line in the Rakefile
|
15
|
+
s.name = 'holman'
|
16
|
+
s.version = '0.0.1'
|
17
|
+
s.date = '2011-03-17'
|
18
|
+
s.rubyforge_project = 'holman'
|
19
|
+
|
20
|
+
## Make sure your summary is short. The description may be as long
|
21
|
+
## as you like.
|
22
|
+
s.summary = "@holman"
|
23
|
+
s.description = "Holman."
|
24
|
+
|
25
|
+
## List the primary authors. If there are a bunch of authors, it's probably
|
26
|
+
## better to set the email to an email list or something. If you don't have
|
27
|
+
## a custom homepage, consider using your GitHub URL or the like.
|
28
|
+
s.authors = ["Zach Holman"]
|
29
|
+
s.email = 'hello@zachholman.com'
|
30
|
+
s.homepage = 'https://github.com/holman/holman'
|
31
|
+
|
32
|
+
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
33
|
+
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
34
|
+
s.require_paths = %w[lib]
|
35
|
+
|
36
|
+
## If your gem includes any executables, list them here.
|
37
|
+
s.executables = ["holman"]
|
38
|
+
s.default_executable = 'holman'
|
39
|
+
|
40
|
+
## Leave this section as-is. It will be automatically generated from the
|
41
|
+
## contents of your Git repository via the gemspec task. DO NOT REMOVE
|
42
|
+
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
43
|
+
# = MANIFEST =
|
44
|
+
s.files = %w[
|
45
|
+
Rakefile
|
46
|
+
bin/holman
|
47
|
+
holman.gemspec
|
48
|
+
lib/holman.rb
|
49
|
+
]
|
50
|
+
# = MANIFEST =
|
51
|
+
|
52
|
+
## Test files will be grabbed from the file list. Make sure the path glob
|
53
|
+
## matches what you actually use.
|
54
|
+
s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
|
55
|
+
end
|
data/lib/holman.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
puts "
|
2
|
+
G G L L f f f j j j t t L t i i i i i i t t t t t j f L L L K # # W W
|
3
|
+
G L L f f f j j j t t t j j t j j i i i ; i i t t j j f L L W # # W K
|
4
|
+
L L f f f j j t t t t t D # # # t t j t ; ; i i i t j f f f K # # # E
|
5
|
+
G L f f j j t t j W # # # # # # # # K L t ; ; ; i t j f f f K # # # K
|
6
|
+
E L f f j j j f # # # # # # # # # # # # E i ; i i t j f f f W W # # E
|
7
|
+
L L f j j j D # # # # # # # # # # # # # # t ; ; i t t j f D W # W # K
|
8
|
+
f D j j j K # # # # # # # # # # # # W W E W , ; ; i t j f K W # W # K
|
9
|
+
f f j j K # # # # # # K E W K E K D D D E D L ; i t f G G W W # # K K
|
10
|
+
f f L L # # # # K E f j G f W D D , . . i E W j G D K E D # W # W t D
|
11
|
+
j j L # # # # K K L i , i : t t t . # K L G D W E # W W W i L
|
12
|
+
j t f # # # # W D i : . E G f f L D # # W W W ; t
|
13
|
+
j t L # # # # W i : : . i E t j j j # K W W L ; ;
|
14
|
+
j t K # # W # L : : : : D i t i W # E W W ; ; ;
|
15
|
+
t t D # # # W L , : . i L ; G L G f # # W K W ; , ,
|
16
|
+
t t D # # W K G , : : i f W E j . . f G : : K j t j # # K # t i ; ;
|
17
|
+
i i L # # # # G ; i L E L G L i : . i ; i . # i : j # W W # ; ; ; ;
|
18
|
+
i ; G # # # # t i i t D W # j j . , t ; W t D : ; # W # W i ; ; i
|
19
|
+
i ; K # # # # i i j K t i t ; ; . : . ; : : # W # G ; ; ; i
|
20
|
+
i ; f E # # # i i i ; : ; ; . . : : # K K i i i i t
|
21
|
+
i ; ; j L # K i : . . . . W # E W K K t i i i t
|
22
|
+
t t i t L # W i , . . . K W W K E K t i i t t
|
23
|
+
i ; ; i f i j i : . . . D G # W K G t t t t j
|
24
|
+
t i ; i ; i i t , . . : j E D t t : . . G W W t t t t j
|
25
|
+
j t i ; ; , i t ; , : ; , . . , ; j i : . , G # E f G j j j j j L
|
26
|
+
j t i ; , t t t i ; ; : . : . . f L # K L G f j j j j j
|
27
|
+
j t ; ; , , , t t : ; . : L j i ; ; t f , f G # # f G L j j j L t
|
28
|
+
j i ; ; ; , , t t ; . . . : . . . f L # E L G L f j j j j
|
29
|
+
j i i ; ; , , i t i , , . . . . . . . ; t E # E f G L f f L f f
|
30
|
+
t t i i ; ; , , j i i , ; . . . . . : W D # # W f G L f L t j j
|
31
|
+
j t i ; t # # # L j i ; ; , . . . . . . , i # # # # E K D G W # # G
|
32
|
+
# # # # # # # # # D j i i ; , . . . . . . : . # # # # # # # # # # # #
|
33
|
+
# # # # # # # # # # E G j j i ; : . : : ; : . K # # # # # # # # # # #
|
34
|
+
# # # # # # # # # # G E E f j t i ; ; i t : : L # # # # # # # # # # #
|
35
|
+
# # # # # # # # # # K f L E E D G G f , , , : E # # # # # # # # # # #
|
36
|
+
# # # # # # # # # # # L f f L L f t ; i i , , # # # # # # # # # # # #
|
37
|
+
"
|
38
|
+
|
39
|
+
puts "
|
40
|
+
__ __
|
41
|
+
| \\ | \\
|
42
|
+
| $$____ ______ | $$ ______ ____ ______ _______
|
43
|
+
| $$ \\ / \\ | $$| \\ \\ | \\ | \\
|
44
|
+
| $$$$$$$\\| $$$$$$\\| $$| $$$$$$\\$$$$\\ \\$$$$$$\\| $$$$$$$\\
|
45
|
+
| $$ | $$| $$ | $$| $$| $$ | $$ | $$ / $$| $$ | $$
|
46
|
+
| $$ | $$| $$__/ $$| $$| $$ | $$ | $$| $$$$$$$| $$ | $$
|
47
|
+
| $$ | $$ \\$$ $$| $$| $$ | $$ | $$ \\$$ $$| $$ | $$
|
48
|
+
\\$$ \\$$ \\$$$$$$ \\$$ \\$$ \\$$ \\$$ \\$$$$$$$ \\$$ \\$$
|
49
|
+
"
|
50
|
+
|
51
|
+
puts ""
|
52
|
+
puts ""
|
53
|
+
puts " holman - http://twitter.com/holman - http://zachholman.com "
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: holman
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Zach Holman
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-03-17 00:00:00 -07:00
|
19
|
+
default_executable: holman
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: Holman.
|
23
|
+
email: hello@zachholman.com
|
24
|
+
executables:
|
25
|
+
- holman
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- Rakefile
|
32
|
+
- bin/holman
|
33
|
+
- holman.gemspec
|
34
|
+
- lib/holman.rb
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: https://github.com/holman/holman
|
37
|
+
licenses: []
|
38
|
+
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
hash: 3
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
version: "0"
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project: holman
|
65
|
+
rubygems_version: 1.3.7
|
66
|
+
signing_key:
|
67
|
+
specification_version: 2
|
68
|
+
summary: "@holman"
|
69
|
+
test_files: []
|
70
|
+
|