inochi 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CREDITS +17 -1
- data/bin/inochi +19 -539
- data/lib/inochi.rb +1 -41
- data/lib/inochi/engine.rb +101 -0
- data/lib/inochi/generate.rb +52 -0
- data/lib/inochi/inochi.rb +109 -0
- data/lib/inochi/tasks/ann.rake +230 -0
- data/lib/inochi/tasks/api.rake +28 -0
- data/lib/inochi/tasks/gem.rake +46 -0
- data/lib/inochi/tasks/init.rake +38 -0
- data/lib/inochi/tasks/man.rake +78 -0
- data/lib/inochi/tasks/project.rake +25 -0
- data/lib/inochi/tasks/pub.rake +130 -0
- data/lib/inochi/templates/CREDITS.rbs +18 -0
- data/lib/inochi/templates/EXAMPLES.rbs +24 -0
- data/lib/inochi/templates/FURTHER.rbs +17 -0
- data/lib/inochi/templates/HACKING.rbs +92 -0
- data/lib/inochi/templates/HISTORY.rbs +55 -0
- data/lib/inochi/templates/LICENSE.rbs +15 -0
- data/lib/inochi/templates/MANUAL.rbs +27 -0
- data/lib/inochi/templates/README.rbs +60 -0
- data/lib/inochi/templates/USAGE.rbs +23 -0
- data/lib/inochi/templates/command.rbs +23 -0
- data/lib/inochi/templates/inochi.opts.rbs +43 -0
- data/lib/inochi/templates/inochi.rb.rbs +102 -0
- data/lib/inochi/templates/library.rbs +7 -0
- data/lib/inochi/templates/library_test.rb.rbs +3 -0
- data/lib/inochi/templates/test_helper.rb.rbs +3 -0
- data/lib/inochi/templates/test_runner.rbs +25 -0
- data/{doc → logo}/inochi.png +0 -0
- data/man.html +959 -0
- data/man/man1/inochi.1.gz +0 -0
- metadata +129 -198
- data/doc/README +0 -6
- data/doc/api/apple-touch-icon.png +0 -0
- data/doc/api/classes/Array.html +0 -370
- data/doc/api/classes/File.html +0 -110
- data/doc/api/classes/Inochi.html +0 -1477
- data/doc/api/classes/Inochi/Manual.html +0 -157
- data/doc/api/classes/Inochi/Phrases.html +0 -331
- data/doc/api/classes/Inochi/Version.html +0 -190
- data/doc/api/classes/TempDir.html +0 -164
- data/doc/api/created.rid +0 -1
- data/doc/api/css/main.css +0 -263
- data/doc/api/css/panel.css +0 -383
- data/doc/api/css/reset.css +0 -53
- data/doc/api/favicon.ico +0 -0
- data/doc/api/files/CREDITS.html +0 -61
- data/doc/api/files/LICENSE.html +0 -76
- data/doc/api/files/lib/inochi/book_rb.html +0 -106
- data/doc/api/files/lib/inochi/init_rb.html +0 -66
- data/doc/api/files/lib/inochi/main_rb.html +0 -52
- data/doc/api/files/lib/inochi/rake_rb.html +0 -52
- data/doc/api/files/lib/inochi/test/bacon_rb.html +0 -67
- data/doc/api/files/lib/inochi/test/context_rb.html +0 -69
- data/doc/api/files/lib/inochi/test/dfect_rb.html +0 -67
- data/doc/api/files/lib/inochi/test/matchy_rb.html +0 -69
- data/doc/api/files/lib/inochi/test/minitest_rb.html +0 -71
- data/doc/api/files/lib/inochi/test/mocha_rb.html +0 -67
- data/doc/api/files/lib/inochi/test/rspec_rb.html +0 -67
- data/doc/api/files/lib/inochi/test/shoulda_rb.html +0 -67
- data/doc/api/files/lib/inochi/test/test_spec_rb.html +0 -67
- data/doc/api/files/lib/inochi/test/test_unit_rb.html +0 -67
- data/doc/api/files/lib/inochi/util/combo_rb.html +0 -59
- data/doc/api/files/lib/inochi/util/tempdir_rb.html +0 -68
- data/doc/api/files/lib/inochi/util_rb.html +0 -59
- data/doc/api/files/lib/inochi_rb.html +0 -76
- data/doc/api/i/arrows.png +0 -0
- data/doc/api/i/results_bg.png +0 -0
- data/doc/api/i/tree_bg.png +0 -0
- data/doc/api/index.html +0 -14
- data/doc/api/js/jquery-1.3.2.min.js +0 -19
- data/doc/api/js/jquery-effect.js +0 -593
- data/doc/api/js/main.js +0 -22
- data/doc/api/js/searchdoc.js +0 -628
- data/doc/api/panel/index.html +0 -71
- data/doc/api/panel/search_index.js +0 -1
- data/doc/api/panel/tree.js +0 -1
- data/doc/history.erb +0 -268
- data/doc/index.erb +0 -11
- data/doc/index.html +0 -3179
- data/doc/inochi.svg +0 -405
- data/doc/intro.erb +0 -87
- data/doc/setup.erb +0 -105
- data/doc/usage.erb +0 -641
- data/lib/inochi/book.rb +0 -91
- data/lib/inochi/init.rb +0 -256
- data/lib/inochi/main.rb +0 -85
- data/lib/inochi/rake.rb +0 -902
- data/lib/inochi/test/bacon.rb +0 -3
- data/lib/inochi/test/context.rb +0 -4
- data/lib/inochi/test/dfect.rb +0 -3
- data/lib/inochi/test/matchy.rb +0 -4
- data/lib/inochi/test/minitest.rb +0 -7
- data/lib/inochi/test/mocha.rb +0 -3
- data/lib/inochi/test/rspec.rb +0 -3
- data/lib/inochi/test/shoulda.rb +0 -3
- data/lib/inochi/test/test_spec.rb +0 -3
- data/lib/inochi/test/test_unit.rb +0 -3
- data/lib/inochi/util.rb +0 -99
- data/lib/inochi/util/combo.rb +0 -191
- data/lib/inochi/util/tempdir.rb +0 -29
- data/rakefile +0 -12
- data/test/inochi.rb +0 -111
@@ -0,0 +1,28 @@
|
|
1
|
+
@api_dir = 'api'
|
2
|
+
@api_dst = "#{@api_dir}/index.html"
|
3
|
+
|
4
|
+
desc 'Build API documentation.'
|
5
|
+
task :api => @api_dst
|
6
|
+
|
7
|
+
file @api_dst => FileList['lib/**/*.rb'].include('LICENSE') do
|
8
|
+
inner_task_name = 'api:yard'
|
9
|
+
|
10
|
+
Inochi.require 'yard'
|
11
|
+
require 'yard/rake/yardoc_task'
|
12
|
+
YARD::Rake::YardocTask.new(inner_task_name) do |yardoc|
|
13
|
+
yardoc.options = [
|
14
|
+
'--output-dir', @api_dir,
|
15
|
+
'--title', (
|
16
|
+
Rake::Task[:@project].invoke
|
17
|
+
@project_module.inspect
|
18
|
+
),
|
19
|
+
'--readme', 'LICENSE',
|
20
|
+
'--no-private'
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
24
|
+
Rake::Task[inner_task_name].invoke
|
25
|
+
end
|
26
|
+
|
27
|
+
CLEAN.include '.yardoc'
|
28
|
+
CLOBBER.include @api_dir
|
@@ -0,0 +1,46 @@
|
|
1
|
+
desc 'Build release package for RubyGems.'
|
2
|
+
task :gem do
|
3
|
+
Rake::Task[:@project].invoke
|
4
|
+
Rake::Task[:@ann_nfo_text].invoke
|
5
|
+
Rake::Task[:@project_authors_text].invoke
|
6
|
+
|
7
|
+
gem = Gem::Specification.new
|
8
|
+
gem.name = @project_package_name
|
9
|
+
gem.date = @project_module::RELDATE
|
10
|
+
gem.version = @project_module::VERSION
|
11
|
+
gem.summary = @project_module::TAGLINE
|
12
|
+
gem.description = @ann_nfo_text
|
13
|
+
gem.homepage = @project_module::WEBSITE
|
14
|
+
gem.authors = @project_authors_text.split(/\s*,\s*/)
|
15
|
+
gem.executables = FileList['bin/*'].pathmap('%f')
|
16
|
+
|
17
|
+
Rake::Task[:man].invoke
|
18
|
+
gem.files = FileList[
|
19
|
+
'{bin,lib,ext}/**/*',
|
20
|
+
'LICENSE',
|
21
|
+
'CREDITS',
|
22
|
+
@man_html_dst,
|
23
|
+
@man_roff_dst_glob
|
24
|
+
]
|
25
|
+
|
26
|
+
@project_module::DEVTIME.each do |gem_name, gem_version|
|
27
|
+
gem.add_development_dependency gem_name, *Array(gem_version)
|
28
|
+
end
|
29
|
+
|
30
|
+
@project_module::RUNTIME.each do |gem_name, gem_version|
|
31
|
+
gem.add_dependency gem_name, *Array(gem_version)
|
32
|
+
end
|
33
|
+
|
34
|
+
# allow user to configure the gem before it is built
|
35
|
+
if logic = @project_options[:gem_spec_logic] and not logic.empty?
|
36
|
+
eval logic, binding, "#{@project_options_file} in :gem_spec_logic"
|
37
|
+
end
|
38
|
+
|
39
|
+
# emit gemspec
|
40
|
+
File.write @project_gem_file + 'spec', gem.to_ruby
|
41
|
+
|
42
|
+
# build gem
|
43
|
+
Gem::Builder.new(gem).build
|
44
|
+
end
|
45
|
+
|
46
|
+
CLOBBER.include '*.gem', '*.gemspec'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
desc 'Instill Inochi into current directory.'
|
2
|
+
task :init do
|
3
|
+
|
4
|
+
unless project_name = ENV[:project]
|
5
|
+
raise ArgumentError, 'project name not specified'
|
6
|
+
end
|
7
|
+
|
8
|
+
library_name = Engine.calc_library_name(project_name)
|
9
|
+
package_name = ENV[:package] || Engine.calc_package_name(library_name)
|
10
|
+
|
11
|
+
project_version = '0.0.0'
|
12
|
+
project_release = Time.now.strftime('%F')
|
13
|
+
|
14
|
+
command_file = "bin/#{package_name}"
|
15
|
+
create_from_rbs binding, command_file, 'command'
|
16
|
+
chmod 0755, command_file
|
17
|
+
|
18
|
+
create_from_rbs binding, 'inochi.opts'
|
19
|
+
|
20
|
+
create_from_rbs binding, "lib/#{package_name}.rb", 'library'
|
21
|
+
create_from_rbs binding, "lib/#{package_name}/inochi.rb"
|
22
|
+
|
23
|
+
create_from_rbs binding, 'test/runner', 'test_runner'
|
24
|
+
chmod 0755, 'test/runner'
|
25
|
+
create_from_rbs binding, 'test/test_helper.rb', 'test_helper.rb'
|
26
|
+
create_from_rbs binding, "test/#{package_name}_test.rb", 'library_test.rb'
|
27
|
+
|
28
|
+
create_from_rbs binding, 'LICENSE'
|
29
|
+
create_from_rbs binding, 'README'
|
30
|
+
create_from_rbs binding, 'MANUAL'
|
31
|
+
create_from_rbs binding, 'USAGE'
|
32
|
+
create_from_rbs binding, 'EXAMPLES'
|
33
|
+
create_from_rbs binding, 'HACKING'
|
34
|
+
create_from_rbs binding, 'HISTORY'
|
35
|
+
create_from_rbs binding, 'CREDITS'
|
36
|
+
create_from_rbs binding, 'FURTHER'
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
@man_src = FileList['MANUAL', '[A-Z]*[A-Z]']
|
2
|
+
@man_html_dst = 'man.html'
|
3
|
+
@man_ronn_dst = 'man.ronn'
|
4
|
+
@man_roff_dst_glob = 'man/man*/*.?{,.gz}'
|
5
|
+
|
6
|
+
desc 'Build the help manual.'
|
7
|
+
task :man => @man_html_dst
|
8
|
+
|
9
|
+
file @man_html_dst => @man_src do
|
10
|
+
Rake::Task[:@man_doc].invoke
|
11
|
+
|
12
|
+
# write ronn version
|
13
|
+
|
14
|
+
# write roff version
|
15
|
+
roff_file = "man/man#{@man_doc.section}/#{@man_doc.basename}"
|
16
|
+
mkdir_p File.dirname(roff_file)
|
17
|
+
|
18
|
+
require 'zlib'
|
19
|
+
Zlib::GzipWriter.open(roff_file + '.gz') do |gz|
|
20
|
+
gz.write @man_doc.to_roff
|
21
|
+
end
|
22
|
+
|
23
|
+
# write html version
|
24
|
+
File.write @man_html_dst, @man_doc.to_html
|
25
|
+
end
|
26
|
+
|
27
|
+
CLOBBER.include @man_html_dst, @man_ronn_dst, @man_roff_dst_glob
|
28
|
+
|
29
|
+
# loads the manual as a Ronn document
|
30
|
+
task :@man_doc => @man_src do
|
31
|
+
unless @man_doc
|
32
|
+
Rake::Task[:@project].invoke
|
33
|
+
|
34
|
+
# render eRuby template
|
35
|
+
ember_input =
|
36
|
+
"# #{@project_package_name}(1) - #{@project_module::TAGLINE}\n\n"\
|
37
|
+
"%+ #{@man_src.first.inspect}"
|
38
|
+
|
39
|
+
ember_opts = {
|
40
|
+
:source_file => :@man_doc,
|
41
|
+
:shorthand => true,
|
42
|
+
:unindent => true,
|
43
|
+
:infer_end => true,
|
44
|
+
}
|
45
|
+
|
46
|
+
Inochi.require 'ember'
|
47
|
+
ronn_input = Ember::Template.new(ember_input, ember_opts).render
|
48
|
+
File.write @man_ronn_dst, ronn_input # for debugging / sanity check
|
49
|
+
|
50
|
+
# build Ronn document
|
51
|
+
require 'date'
|
52
|
+
ronn_opts = {
|
53
|
+
:date => Date.parse(@project_module::RELDATE),
|
54
|
+
:manual => "Version #{@project_module::VERSION}",
|
55
|
+
}
|
56
|
+
ronn_file = "#{@project_package_name}.1.ronn"
|
57
|
+
|
58
|
+
Inochi.require 'ronn'
|
59
|
+
@man_doc = Ronn::Document.new(ronn_file, ronn_opts) { ronn_input }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
task :@man_html do
|
64
|
+
unless @man_html
|
65
|
+
Rake::Task[:@man_doc].invoke
|
66
|
+
@man_html = @man_doc.to_html
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
task :@man_html_dom do
|
71
|
+
unless @man_html_dom
|
72
|
+
Rake::Task[:@man_html].invoke
|
73
|
+
|
74
|
+
Inochi.require 'nokogiri'
|
75
|
+
@man_html_dom = Nokogiri::HTML(@man_html)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
task :@project do
|
2
|
+
begin
|
3
|
+
@project_options_file = 'inochi.opts'
|
4
|
+
@project_options = YAML.load_file(@project_options_file).to_hash
|
5
|
+
|
6
|
+
# load the project module
|
7
|
+
library_file = Dir['lib/*/inochi.rb'].first
|
8
|
+
package_name = File.basename(File.dirname(library_file))
|
9
|
+
library_name = File.read(library_file)[/\b(module|class)\b\s+(\w+)/, 2]
|
10
|
+
|
11
|
+
$LOAD_PATH.unshift 'lib'
|
12
|
+
require "#{package_name}/inochi"
|
13
|
+
|
14
|
+
@project_module = Object.const_get(library_name)
|
15
|
+
@project_package_name = package_name
|
16
|
+
@project_library_name = library_name
|
17
|
+
@project_gem_file = "#{@project_package_name}-#{@project_module::VERSION}.gem"
|
18
|
+
rescue
|
19
|
+
puts
|
20
|
+
puts 'The current directory is not an Inochi project.'
|
21
|
+
puts 'Run the `inochi init` command to make it one.'
|
22
|
+
puts
|
23
|
+
raise
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
desc 'Publish a release of this project.'
|
2
|
+
task :pub => %w[ pub:gem pub:web pub:ann ]
|
3
|
+
|
4
|
+
#-----------------------------------------------------------------------------
|
5
|
+
# RubyGems
|
6
|
+
#-----------------------------------------------------------------------------
|
7
|
+
|
8
|
+
desc 'Publish gem release package to RubyGems.org.'
|
9
|
+
task 'pub:gem' do
|
10
|
+
Rake::Task[:@project].invoke
|
11
|
+
Rake::Task[:gem].invoke unless File.exist? @project_gem_file
|
12
|
+
sh 'gem', 'push', @project_gem_file
|
13
|
+
end
|
14
|
+
|
15
|
+
#-----------------------------------------------------------------------------
|
16
|
+
# website
|
17
|
+
#-----------------------------------------------------------------------------
|
18
|
+
|
19
|
+
desc 'Publish help manual, API docs, and RSS feed to project website.'
|
20
|
+
task 'pub:web' => %w[ man api ann:feed ] do |t|
|
21
|
+
Rake::Task[:@project].invoke
|
22
|
+
|
23
|
+
if target = @project_options[:pub_web_target]
|
24
|
+
options = @project_options[:pub_web_options]
|
25
|
+
sources = [@man_html_dst, @api_dir, @ann_feed_dst,
|
26
|
+
@project_options[:pub_web_extras]].compact
|
27
|
+
|
28
|
+
sh ['rsync', options, sources, target].join(' ')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
#-----------------------------------------------------------------------------
|
33
|
+
# announcements
|
34
|
+
#-----------------------------------------------------------------------------
|
35
|
+
|
36
|
+
desc 'Announce release on all news outlets.'
|
37
|
+
task 'pub:ann' => %w[ pub:ann:raa pub:ann:ruby-talk ]
|
38
|
+
|
39
|
+
desc 'Announce release on ruby-talk mailing list.'
|
40
|
+
task 'pub:ann:ruby-talk' do
|
41
|
+
site = 'http://ruby-forum.com'
|
42
|
+
|
43
|
+
Inochi.require 'mechanize'
|
44
|
+
browser = Mechanize.new
|
45
|
+
|
46
|
+
# fetch login form
|
47
|
+
page = browser.get("#{site}/user/login")
|
48
|
+
form = page.forms_with(:action => '/user/login').first or
|
49
|
+
raise "cannot find login form on Web page: #{page.uri}"
|
50
|
+
|
51
|
+
# fill login information
|
52
|
+
Inochi.require 'highline'
|
53
|
+
highline = HighLine.new
|
54
|
+
|
55
|
+
form['name'] = highline.ask("#{site} username: ")
|
56
|
+
form['password'] = highline.ask("#{site} password: ") {|q| q.echo = false }
|
57
|
+
|
58
|
+
# submit login form
|
59
|
+
page = form.click_button
|
60
|
+
page.at('a[href="/user/logout"]') or
|
61
|
+
raise "invalid login for #{site}"
|
62
|
+
|
63
|
+
# make the announcement
|
64
|
+
page = browser.get("#{site}/topic/new?forum_id=4")
|
65
|
+
form = page.forms_with(:action => '/topic/new#postform').first or
|
66
|
+
raise "cannot find post creation form on Web page: #{page.uri}"
|
67
|
+
|
68
|
+
# enable notification by email whenever
|
69
|
+
# someone replies to this announcement
|
70
|
+
form['post[subscribed_by_author]'] = '1'
|
71
|
+
|
72
|
+
Rake::Task[:@ann_subject].invoke
|
73
|
+
form['post[subject]'] = @ann_subject
|
74
|
+
|
75
|
+
Rake::Task[@ann_text_dst].invoke
|
76
|
+
form['post[text]'] = File.read(@ann_text_dst)
|
77
|
+
|
78
|
+
# submit the announcement
|
79
|
+
page = form.submit
|
80
|
+
|
81
|
+
if error = page.at('.error')
|
82
|
+
raise "Announcement to #{site} failed:\n#{error.text}"
|
83
|
+
else
|
84
|
+
puts "Successfully announced to #{site}:", page.uri
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
desc 'Announce release on RAA (Ruby Application Archive).'
|
89
|
+
task 'pub:ann:raa' do
|
90
|
+
site = 'http://raa.ruby-lang.org'
|
91
|
+
|
92
|
+
Rake::Task[:@project].invoke
|
93
|
+
project = @project_package_name
|
94
|
+
|
95
|
+
Inochi.require 'mechanize'
|
96
|
+
browser = Mechanize.new
|
97
|
+
|
98
|
+
# fetch project information form
|
99
|
+
page = browser.get("#{site}/update.rhtml?name=#{project}")
|
100
|
+
form = page.forms_with(:action => 'regist.rhtml').first or
|
101
|
+
raise "cannot find project information form on Web page: #{page.uri}"
|
102
|
+
|
103
|
+
# fill project information
|
104
|
+
Rake::Task[:@ann_nfo_text].invoke
|
105
|
+
form['description'] = @ann_nfo_text
|
106
|
+
form['description_style'] = 'Plain'
|
107
|
+
|
108
|
+
Rake::Task[:@project].invoke
|
109
|
+
form['short_description'] = @project_module::TAGLINE
|
110
|
+
form['version'] = @project_module::VERSION
|
111
|
+
form['url'] = @project_module::WEBSITE
|
112
|
+
|
113
|
+
# fill login information
|
114
|
+
Inochi.require 'highline'
|
115
|
+
highline = HighLine.new
|
116
|
+
|
117
|
+
prompt = '%s password for %s project and %s owner: ' %
|
118
|
+
[ site, project.inspect, form.owner.inspect ]
|
119
|
+
form['pass'] = highline.ask(prompt) {|q| q.echo = false }
|
120
|
+
|
121
|
+
# submit project information
|
122
|
+
page = form.submit
|
123
|
+
|
124
|
+
if page.title =~ /error/i
|
125
|
+
error = "#{page.at('h2').text} -- #{page.at('p').text.strip}"
|
126
|
+
raise "Announcement to #{site} failed:\n#{error}"
|
127
|
+
else
|
128
|
+
puts "Successfully announced to #{site}."
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
%#----------------------------------------------------------------------------
|
2
|
+
## CREDITS
|
3
|
+
%#----------------------------------------------------------------------------
|
4
|
+
|
5
|
+
> TODO: attribute yourself, your predecessors, and your contributors
|
6
|
+
|
7
|
+
Your Name,
|
8
|
+
Contributor name,
|
9
|
+
[Contributor name](http://the.contributor.url),
|
10
|
+
Another contributor <contributor@email.address>,
|
11
|
+
Yet another contributor
|
12
|
+
|
13
|
+
%#----------------------------------------------------------------------------
|
14
|
+
## LICENSE
|
15
|
+
%#----------------------------------------------------------------------------
|
16
|
+
|
17
|
+
%# See the file named "LICENSE".
|
18
|
+
%< "LICENSE"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
%#----------------------------------------------------------------------------
|
2
|
+
## EXAMPLES
|
3
|
+
%#----------------------------------------------------------------------------
|
4
|
+
|
5
|
+
> TODO: give examples of how to use your
|
6
|
+
> project to perform certain tasks
|
7
|
+
|
8
|
+
%#----------------------------------------------------------------------------
|
9
|
+
### A task
|
10
|
+
%#----------------------------------------------------------------------------
|
11
|
+
|
12
|
+
> TODO: explain how to perform this task
|
13
|
+
|
14
|
+
%#----------------------------------------------------------------------------
|
15
|
+
### Another task
|
16
|
+
%#----------------------------------------------------------------------------
|
17
|
+
|
18
|
+
> TODO: explain how to perform this task
|
19
|
+
|
20
|
+
%#----------------------------------------------------------------------------
|
21
|
+
### Yet another task
|
22
|
+
%#----------------------------------------------------------------------------
|
23
|
+
|
24
|
+
> TODO: explain how to perform this task
|
@@ -0,0 +1,17 @@
|
|
1
|
+
%#----------------------------------------------------------------------------
|
2
|
+
## SEE ALSO
|
3
|
+
%#----------------------------------------------------------------------------
|
4
|
+
|
5
|
+
> TODO: list related UNIX man pages here
|
6
|
+
|
7
|
+
some_command(1),
|
8
|
+
another_command(5),
|
9
|
+
yet_another_command(7)
|
10
|
+
|
11
|
+
%#----------------------------------------------------------------------------
|
12
|
+
%# Markdown link references
|
13
|
+
%#----------------------------------------------------------------------------
|
14
|
+
|
15
|
+
[Inochi]: <%= Inochi::WEBSITE %>
|
16
|
+
[RubyGems]: http://rubygems.org
|
17
|
+
[Ruby]: http://ruby-lang.org
|
@@ -0,0 +1,92 @@
|
|
1
|
+
%#----------------------------------------------------------------------------
|
2
|
+
## HACKING
|
3
|
+
%#----------------------------------------------------------------------------
|
4
|
+
|
5
|
+
This section is meant for people who want to develop #{project_name}'s source
|
6
|
+
code.
|
7
|
+
|
8
|
+
%#----------------------------------------------------------------------------
|
9
|
+
### Prerequisites
|
10
|
+
%#----------------------------------------------------------------------------
|
11
|
+
|
12
|
+
> TODO: list the tools and libraries needed to develop your project
|
13
|
+
|
14
|
+
Install Ruby libraries necessary for development:
|
15
|
+
|
16
|
+
gem install #{package_name} --development
|
17
|
+
|
18
|
+
%#----------------------------------------------------------------------------
|
19
|
+
### Infrastructure
|
20
|
+
%#----------------------------------------------------------------------------
|
21
|
+
|
22
|
+
[Inochi] serves as the project infrastructure for #{project_name}. It handles
|
23
|
+
tasks such as building this help manual and API documentation, and packaging,
|
24
|
+
announcing, and publishing new releases. See its help manual and list of
|
25
|
+
tasks to get started:
|
26
|
+
|
27
|
+
inochi --help # display help manual
|
28
|
+
inochi --tasks # list available tasks
|
29
|
+
|
30
|
+
%#----------------------------------------------------------------------------
|
31
|
+
### $LOAD_PATH setup
|
32
|
+
%#----------------------------------------------------------------------------
|
33
|
+
|
34
|
+
Ensure that the `lib/` directory is listed in Ruby's `$LOAD_PATH` before you
|
35
|
+
use any libraries therein or run any executables in the `bin/` directory.
|
36
|
+
|
37
|
+
This can be achieved by passing an option to Ruby:
|
38
|
+
|
39
|
+
ruby -Ilib bin/#{package_name}
|
40
|
+
irb -Ilib -r #{package_name}
|
41
|
+
|
42
|
+
Or by setting the `$RUBYLIB` environment variable:
|
43
|
+
|
44
|
+
export RUBYLIB=lib # bash, ksh, zsh
|
45
|
+
setenv RUBYLIB lib # csh
|
46
|
+
set -x RUBYLIB lib # fish
|
47
|
+
|
48
|
+
ruby bin/#{package_name}
|
49
|
+
irb -r #{package_name}
|
50
|
+
|
51
|
+
Or by installing the [ruby-wrapper](http://github.com/chneukirchen/rup) tool.
|
52
|
+
|
53
|
+
%#----------------------------------------------------------------------------
|
54
|
+
### RubyGems setup
|
55
|
+
%#----------------------------------------------------------------------------
|
56
|
+
|
57
|
+
If you use Ruby 1.8 or older, then ensure that RubyGems is activated before
|
58
|
+
you use any libraries in the `lib/` directory or run any executables in the
|
59
|
+
`bin/` directory.
|
60
|
+
|
61
|
+
This can be achieved by passing an option to Ruby:
|
62
|
+
|
63
|
+
ruby -rubygems bin/#{package_name}
|
64
|
+
irb -rubygems -r #{package_name}
|
65
|
+
|
66
|
+
Or by setting the `$RUBYOPT` environment variable:
|
67
|
+
|
68
|
+
export RUBYOPT=-rubygems # bash, ksh, zsh
|
69
|
+
setenv RUBYOPT -rubygems # csh
|
70
|
+
set -x RUBYOPT -rubygems # fish
|
71
|
+
|
72
|
+
%#----------------------------------------------------------------------------
|
73
|
+
### Running tests
|
74
|
+
%#----------------------------------------------------------------------------
|
75
|
+
|
76
|
+
Simply execute the included test runner, which sets up Ruby's `$LOAD_PATH` for
|
77
|
+
testing, loads the included `test/test_helper.rb` file, and then evaluates all
|
78
|
+
`test/**/*_test.rb` files:
|
79
|
+
|
80
|
+
test/runner
|
81
|
+
|
82
|
+
Its exit status will indicate whether all tests have passed. It may also
|
83
|
+
print additional pass/fail information depending on the testing library used
|
84
|
+
in the `test/test_helper.rb` file.
|
85
|
+
|
86
|
+
%#----------------------------------------------------------------------------
|
87
|
+
### Contributing
|
88
|
+
%#----------------------------------------------------------------------------
|
89
|
+
|
90
|
+
> TODO: explain how someone can contribute their changes to your repository
|
91
|
+
|
92
|
+
Fork this project on GitHub (see **Resources** above) and send a pull request.
|