quarry 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +22 -1
- data/MANIFEST +30 -339
- data/RELEASE +2 -4
- data/VERSION +1 -1
- data/bin/quarry +14 -10
- data/bin/quarry-doc +2 -2
- data/lib/quarry/assertion.rb +27 -0
- data/lib/quarry/{spec/config.rb → config.rb} +0 -0
- data/lib/quarry/document/template.rhtml +239 -0
- data/lib/quarry/document.rb +126 -0
- data/lib/quarry/expectation.rb +60 -0
- data/lib/quarry/extract.rb +2 -0
- data/lib/quarry/grammar/assert.rb +48 -0
- data/lib/quarry/grammar/expect.rb +114 -0
- data/lib/quarry/grammar/legacy/assert.rb +280 -0
- data/lib/quarry/grammar/should.rb +50 -0
- data/lib/quarry/grammar.rb +4 -0
- data/lib/quarry/{spec → markup}/step.rb +4 -3
- data/lib/quarry/markup.rb +70 -0
- data/lib/quarry/{stub/mock.rb → mock.rb} +1 -1
- data/lib/quarry/{loadmonitor.rb → monitor.rb} +0 -0
- data/lib/quarry/{stub/probe.rb → probe.rb} +8 -35
- data/lib/quarry/reporter/dotprogress.rb +62 -0
- data/lib/quarry/reporter/summary.rb +70 -0
- data/lib/quarry/reporter/verbatim.rb +82 -0
- data/lib/quarry/reporter.rb +70 -0
- data/lib/quarry/{spec → runner}/context.rb +7 -2
- data/lib/quarry/runner.rb +123 -0
- data/lib/quarry/{stub/stub.rb → stub.rb} +1 -1
- data/lib/quarry.rb +10 -0
- data/spec/basic.rd +0 -2
- data/spec/complex.rd +0 -2
- data/spec/mock.rd +20 -26
- data/spec/stub.rd +8 -12
- metadata +48 -361
- data/bin/ruby-break +0 -10
- data/doc/assets/images/clipboard.jpg +0 -0
- data/doc/assets/images/clipboard2.png +0 -0
- data/doc/assets/images/darksilver.png +0 -0
- data/doc/assets/images/icon/book.jpg +0 -0
- data/doc/assets/images/icon/download.gif +0 -0
- data/doc/assets/images/icon/letter_r.png +0 -0
- data/doc/assets/images/icon/license.png +0 -0
- data/doc/assets/images/icon/software.png +0 -0
- data/doc/assets/images/icon/source.png +0 -0
- data/doc/assets/images/miner.jpg +0 -0
- data/doc/assets/images/rbrylmtrx.png +0 -0
- data/doc/assets/images/ruby.gif +0 -0
- data/doc/assets/images/runneth.png +0 -0
- data/doc/assets/images/silver.gif +0 -0
- data/doc/assets/images/test.jpg +0 -0
- data/doc/assets/jquery/jquery.js +0 -1
- data/doc/assets/jquery/jquery.tabs.js +0 -1
- data/doc/assets/rdoc_ad.html +0 -12
- data/doc/assets/styles/index.css +0 -138
- data/doc/guide/stubs.md +0 -125
- data/doc/index.html +0 -285
- data/doc/log/bstats/stats.html +0 -39
- data/doc/log/notes.xml +0 -32
- data/doc/log/stats.html +0 -25
- data/doc/log/stats.log +0 -14
- data/doc/log/syntax.log +0 -0
- data/doc/rdoc/classes/Assertion/False.html +0 -177
- data/doc/rdoc/classes/Assertion/True.html +0 -152
- data/doc/rdoc/classes/Assertion.html +0 -171
- data/doc/rdoc/classes/Kernel.html +0 -105
- data/doc/rdoc/classes/Method.html +0 -168
- data/doc/rdoc/classes/Object.html +0 -507
- data/doc/rdoc/classes/Quarry/Break.html +0 -231
- data/doc/rdoc/classes/Quarry/Command.html +0 -443
- data/doc/rdoc/classes/Quarry/Extract.html +0 -215
- data/doc/rdoc/classes/Quarry/MethodProbe.html +0 -325
- data/doc/rdoc/classes/Quarry/Mock/Delegator.html +0 -179
- data/doc/rdoc/classes/Quarry/Mock/Setter.html +0 -175
- data/doc/rdoc/classes/Quarry/Mock.html +0 -233
- data/doc/rdoc/classes/Quarry/Spec/Comment.html +0 -237
- data/doc/rdoc/classes/Quarry/Spec/Config.html +0 -257
- data/doc/rdoc/classes/Quarry/Spec/Context.html +0 -154
- data/doc/rdoc/classes/Quarry/Spec/Document.html +0 -382
- data/doc/rdoc/classes/Quarry/Spec/Header.html +0 -195
- data/doc/rdoc/classes/Quarry/Spec/Macro.html +0 -166
- data/doc/rdoc/classes/Quarry/Spec/Markup.html +0 -279
- data/doc/rdoc/classes/Quarry/Spec/Reporter/DotProgress.html +0 -234
- data/doc/rdoc/classes/Quarry/Spec/Reporter/Summary.html +0 -294
- data/doc/rdoc/classes/Quarry/Spec/Reporter/Verbatim.html +0 -311
- data/doc/rdoc/classes/Quarry/Spec/Runner.html +0 -352
- data/doc/rdoc/classes/Quarry/Spec/Step.html +0 -190
- data/doc/rdoc/classes/Quarry/Spec/Template.html +0 -205
- data/doc/rdoc/classes/Quarry/Stub/Delegator.html +0 -179
- data/doc/rdoc/classes/Quarry/Stub/Setter.html +0 -175
- data/doc/rdoc/classes/Quarry/Stub.html +0 -224
- data/doc/rdoc/classes/Quarry.html +0 -176
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/CHANGES.html +0 -150
- data/doc/rdoc/files/COPYING.html +0 -468
- data/doc/rdoc/files/README.html +0 -195
- data/doc/rdoc/files/RELEASE.html +0 -122
- data/doc/rdoc/files/VERSION.html +0 -107
- data/doc/rdoc/files/bin/quarry-doc.html +0 -109
- data/doc/rdoc/files/bin/quarry.html +0 -109
- data/doc/rdoc/files/bin/ruby-break.html +0 -108
- data/doc/rdoc/files/bin/ruby-xacto.html +0 -101
- data/doc/rdoc/files/lib/quarry/assert_rb.html +0 -155
- data/doc/rdoc/files/lib/quarry/break_rb.html +0 -101
- data/doc/rdoc/files/lib/quarry/extract_rb.html +0 -108
- data/doc/rdoc/files/lib/quarry/loadmonitor_rb.html +0 -101
- data/doc/rdoc/files/lib/quarry/spec/config_rb.html +0 -101
- data/doc/rdoc/files/lib/quarry/spec/context_rb.html +0 -101
- data/doc/rdoc/files/lib/quarry/spec/document_rb.html +0 -111
- data/doc/rdoc/files/lib/quarry/spec/markup_rb.html +0 -108
- data/doc/rdoc/files/lib/quarry/spec/reporter/dotprogress_rb.html +0 -108
- data/doc/rdoc/files/lib/quarry/spec/reporter/summary_rb.html +0 -108
- data/doc/rdoc/files/lib/quarry/spec/reporter/verbatim_rb.html +0 -108
- data/doc/rdoc/files/lib/quarry/spec/reporter_rb.html +0 -109
- data/doc/rdoc/files/lib/quarry/spec/runner_rb.html +0 -109
- data/doc/rdoc/files/lib/quarry/spec/step_rb.html +0 -101
- data/doc/rdoc/files/lib/quarry/spec/template_rhtml.html +0 -228
- data/doc/rdoc/files/lib/quarry/spec_rb.html +0 -113
- data/doc/rdoc/files/lib/quarry/stub/mock_rb.html +0 -101
- data/doc/rdoc/files/lib/quarry/stub/probe_rb.html +0 -122
- data/doc/rdoc/files/lib/quarry/stub/spec_txt.html +0 -118
- data/doc/rdoc/files/lib/quarry/stub/stub_rb.html +0 -101
- data/doc/rdoc/fr_class_index.html +0 -56
- data/doc/rdoc/fr_file_index.html +0 -55
- data/doc/rdoc/fr_method_index.html +0 -117
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/doc/ri/Assertion/False/assert-i.yaml +0 -10
- data/doc/ri/Assertion/False/cdesc-False.yaml +0 -21
- data/doc/ri/Assertion/False/message-i.yaml +0 -10
- data/doc/ri/Assertion/True/assert-i.yaml +0 -11
- data/doc/ri/Assertion/True/cdesc-True.yaml +0 -26
- data/doc/ri/Assertion/True/message-c.yaml +0 -11
- data/doc/ri/Assertion/True/message-i.yaml +0 -11
- data/doc/ri/Assertion/True/method_missing-i.yaml +0 -12
- data/doc/ri/Assertion/True/new-c.yaml +0 -11
- data/doc/ri/Assertion/cdesc-Assertion.yaml +0 -40
- data/doc/ri/Kernel/cdesc-Kernel.yaml +0 -15
- data/doc/ri/Method/cdesc-Method.yaml +0 -18
- data/doc/ri/Method/migration-i.yaml +0 -12
- data/doc/ri/Method/signature-i.yaml +0 -12
- data/doc/ri/Object/assert%21-i.yaml +0 -17
- data/doc/ri/Object/assert-i.yaml +0 -15
- data/doc/ri/Object/assert_raises%21-i.yaml +0 -12
- data/doc/ri/Object/assert_raises-i.yaml +0 -15
- data/doc/ri/Object/cdesc-Object.yaml +0 -42
- data/doc/ri/Object/mock-i.yaml +0 -12
- data/doc/ri/Object/refute-i.yaml +0 -13
- data/doc/ri/Object/refute_raises-i.yaml +0 -17
- data/doc/ri/Object/remove-i.yaml +0 -12
- data/doc/ri/Object/should-i.yaml +0 -12
- data/doc/ri/Object/should_not-i.yaml +0 -12
- data/doc/ri/Object/should_not_raise-i.yaml +0 -12
- data/doc/ri/Object/should_raise-i.yaml +0 -12
- data/doc/ri/Object/stub-i.yaml +0 -12
- data/doc/ri/Quarry/Break/cdesc-Break.yaml +0 -23
- data/doc/ri/Quarry/Break/edit-i.yaml +0 -11
- data/doc/ri/Quarry/Break/new-c.yaml +0 -11
- data/doc/ri/Quarry/Extract/cdesc-Extract.yaml +0 -26
- data/doc/ri/Quarry/Extract/create_test-i.yaml +0 -12
- data/doc/ri/Quarry/Extract/extract_test_from_file-i.yaml +0 -12
- data/doc/ri/Quarry/Extract/test_extract-i.yaml +0 -18
- data/doc/ri/Quarry/MethodProbe/cdesc-MethodProbe.yaml +0 -46
- data/doc/ri/Quarry/MethodProbe/duckcall-c.yaml +0 -10
- data/doc/ri/Quarry/MethodProbe/initialize_copy-i.yaml +0 -10
- data/doc/ri/Quarry/MethodProbe/method_missing-i.yaml +0 -10
- data/doc/ri/Quarry/MethodProbe/new-c.yaml +0 -10
- data/doc/ri/Quarry/Mock/Delegator/cdesc-Delegator.yaml +0 -20
- data/doc/ri/Quarry/Mock/Delegator/method_missing-i.yaml +0 -10
- data/doc/ri/Quarry/Mock/Delegator/new-c.yaml +0 -10
- data/doc/ri/Quarry/Mock/Setter/%3d%3d-i.yaml +0 -10
- data/doc/ri/Quarry/Mock/Setter/cdesc-Setter.yaml +0 -18
- data/doc/ri/Quarry/Mock/Setter/new-c.yaml +0 -10
- data/doc/ri/Quarry/Mock/__table__-i.yaml +0 -11
- data/doc/ri/Quarry/Mock/cdesc-Mock.yaml +0 -25
- data/doc/ri/Quarry/Mock/method_missing-i.yaml +0 -12
- data/doc/ri/Quarry/Mock/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Comment/cdesc-Comment.yaml +0 -33
- data/doc/ri/Quarry/Spec/Comment/macro%3f-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Comment/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Comment/type-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Config/after-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Config/after_spec-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Config/before-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Config/before_spec-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Config/cdesc-Config.yaml +0 -26
- data/doc/ri/Quarry/Spec/Config/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Context/cdesc-Context.yaml +0 -21
- data/doc/ri/Quarry/Spec/Context/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Document/cdesc-Document.yaml +0 -76
- data/doc/ri/Quarry/Spec/Document/generate-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Document/new-c.yaml +0 -12
- data/doc/ri/Quarry/Spec/Document/quiet%3f-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Document/require_rdoc-i.yaml +0 -11
- data/doc/ri/Quarry/Spec/Document/save-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Document/template-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Header/cdesc-Header.yaml +0 -30
- data/doc/ri/Quarry/Spec/Header/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Macro/cdesc-Macro.yaml +0 -22
- data/doc/ri/Quarry/Spec/Macro/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Markup/cdesc-Markup.yaml +0 -31
- data/doc/ri/Quarry/Spec/Markup/description-i.yaml +0 -11
- data/doc/ri/Quarry/Spec/Markup/new-c.yaml +0 -11
- data/doc/ri/Quarry/Spec/Markup/parse-i.yaml +0 -11
- data/doc/ri/Quarry/Spec/Markup/parse_section-i.yaml +0 -11
- data/doc/ri/Quarry/Spec/Reporter/DotProgress/cdesc-DotProgress.yaml +0 -21
- data/doc/ri/Quarry/Spec/Reporter/DotProgress/report_intro-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/DotProgress/report_step-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/DotProgress/report_summary-i.yaml +0 -16
- data/doc/ri/Quarry/Spec/Reporter/Summary/cdesc-Summary.yaml +0 -31
- data/doc/ri/Quarry/Spec/Reporter/Summary/report_comment-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Summary/report_error-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Summary/report_fail-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Summary/report_header-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Summary/report_macro-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Summary/report_pass-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/cdesc-Verbatim.yaml +0 -29
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/report_comment-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/report_error-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/report_fail-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/report_header-i.yaml +0 -16
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/report_macro-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/Verbatim/report_pass-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/Reporter/cdesc-Reporter.yaml +0 -20
- data/doc/ri/Quarry/Spec/Runner/cdesc-Runner.yaml +0 -47
- data/doc/ri/Quarry/Spec/Runner/check-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Runner/check_spec-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Runner/new-c.yaml +0 -12
- data/doc/ri/Quarry/Spec/Runner/run_step-i.yaml +0 -12
- data/doc/ri/Quarry/Spec/Step/cdesc-Step.yaml +0 -30
- data/doc/ri/Quarry/Spec/Step/new-c.yaml +0 -10
- data/doc/ri/Quarry/Spec/Template/cdesc-Template.yaml +0 -31
- data/doc/ri/Quarry/Spec/Template/new-c.yaml +0 -11
- data/doc/ri/Quarry/Spec/Template/parse_template-i.yaml +0 -10
- data/doc/ri/Quarry/Spec/cdesc-Spec.yaml +0 -15
- data/doc/ri/Quarry/Stub/Delegator/cdesc-Delegator.yaml +0 -20
- data/doc/ri/Quarry/Stub/Delegator/method_missing-i.yaml +0 -10
- data/doc/ri/Quarry/Stub/Delegator/new-c.yaml +0 -10
- data/doc/ri/Quarry/Stub/Setter/%3d%3d-i.yaml +0 -10
- data/doc/ri/Quarry/Stub/Setter/cdesc-Setter.yaml +0 -18
- data/doc/ri/Quarry/Stub/Setter/new-c.yaml +0 -10
- data/doc/ri/Quarry/Stub/__table__-i.yaml +0 -11
- data/doc/ri/Quarry/Stub/cdesc-Stub.yaml +0 -23
- data/doc/ri/Quarry/Stub/method_missing-i.yaml +0 -11
- data/doc/ri/Quarry/Stub/new-c.yaml +0 -10
- data/doc/ri/Quarry/cdesc-Quarry.yaml +0 -16
- data/doc/ri/created.rid +0 -1
- data/doc/spec/stub.html +0 -394
- data/lib/quarry/assert.rb +0 -198
- data/lib/quarry/break.rb +0 -51
- data/lib/quarry/spec/document.rb +0 -130
- data/lib/quarry/spec/markup.rb +0 -85
- data/lib/quarry/spec/reporter/dotprogress.rb +0 -66
- data/lib/quarry/spec/reporter/summary.rb +0 -74
- data/lib/quarry/spec/reporter/verbatim.rb +0 -87
- data/lib/quarry/spec/reporter.rb +0 -74
- data/lib/quarry/spec/runner.rb +0 -127
- data/lib/quarry/spec/template.rhtml +0 -116
- data/lib/quarry/spec.rb +0 -7
- data/lib/quarry/stub/spec.txt +0 -113
- data/work/consider/document.rb +0 -35
- data/work/consider/fixture.rb +0 -153
- data/work/deprecated/assert/must.rb +0 -9
- data/work/deprecated/assert/should.rb +0 -9
- data/work/deprecated/build.rb +0 -82
- data/work/deprecated/mock/file.rb +0 -11
- data/work/deprecated/mock/mock.0.rb +0 -77
- data/work/deprecated/overlay.rb +0 -64
- data/work/deprecated/spec.rb +0 -195
- data/work/deprecated/stub/stub.0.rb +0 -180
- data/work/deprecated/stub/stub.1.rb +0 -114
- data/work/deprecated/stub/test_stub.rb +0 -66
- data/work/deprecated/test/case.rb +0 -141
- data/work/sandbox/assert.rb +0 -100
- data/work/sandbox/bug.rb +0 -49
- data/work/sandbox/build/announce.rb +0 -213
- data/work/sandbox/build/check.rb +0 -109
- data/work/sandbox/build/gem.rb +0 -235
- data/work/sandbox/build/make.rb +0 -118
- data/work/sandbox/build/manpage.rb +0 -201
- data/work/sandbox/build/notes.rb +0 -214
- data/work/sandbox/build/pack.rb +0 -228
- data/work/sandbox/build/rdoc.rb +0 -289
- data/work/sandbox/build/rubyforge.rb +0 -91
- data/work/sandbox/build/sign.rb +0 -241
- data/work/sandbox/build/stamp.rb +0 -37
- data/work/sandbox/build/stats.rb +0 -154
- data/work/sandbox/build/svn.rb +0 -193
- data/work/sandbox/build/test.rb +0 -521
- data/work/sandbox/design.rb +0 -200
- data/work/sandbox/iface_scanner.rb +0 -102
- data/work/sandbox/testunit/assertions/assert_has_keys.rb +0 -38
- data/work/sandbox/testunit/assertions/assert_has_only_keys.rb +0 -38
- data/work/sandbox/testunit/unit.rb +0 -104
- data/work/sandbox/unitspec.rb +0 -54
- data/work/sandbox/x_isotest.rb +0 -532
data/work/sandbox/build/rdoc.rb
DELETED
@@ -1,289 +0,0 @@
|
|
1
|
-
require 'quarry/build'
|
2
|
-
|
3
|
-
module Quarry
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
class RDoc < Build
|
8
|
-
|
9
|
-
DEFAULT_TEMPLATE = 'html'
|
10
|
-
DEFAULT_OUTPUT = 'doc'
|
11
|
-
DEFAULT_INLINE = true
|
12
|
-
DEFAULT_MERGE = true
|
13
|
-
DEFAULT_EXCLUDE = []
|
14
|
-
DEFAULT_INCLUDE = ['lib', '[A-Z]*']
|
15
|
-
DEFAULT_ADFILE = 'doc/rdoc_ad.html'
|
16
|
-
|
17
|
-
# common
|
18
|
-
|
19
|
-
attr_accessor :output
|
20
|
-
|
21
|
-
attr_accessor :include
|
22
|
-
|
23
|
-
attr_accessor :exclude
|
24
|
-
|
25
|
-
# rdoc specific.
|
26
|
-
|
27
|
-
attr_accessor :rdoc_output
|
28
|
-
|
29
|
-
attr_accessor :template
|
30
|
-
|
31
|
-
attr_accessor :adfile
|
32
|
-
|
33
|
-
attr_accessor :inline
|
34
|
-
|
35
|
-
attr_accessor :merge
|
36
|
-
|
37
|
-
# Defaults to {output}/rdoc.
|
38
|
-
|
39
|
-
def rdoc_output
|
40
|
-
@rdoc_output || File.join(output, 'rdoc')
|
41
|
-
end
|
42
|
-
|
43
|
-
# ri specific
|
44
|
-
|
45
|
-
attr_accessor :ri_output
|
46
|
-
|
47
|
-
# Defaults to {output}/ri.
|
48
|
-
|
49
|
-
def ri_output
|
50
|
-
@ri_output ||= File.join(output, 'ri')
|
51
|
-
end
|
52
|
-
|
53
|
-
|
54
|
-
# Generate rdocs.
|
55
|
-
#
|
56
|
-
# Generate Rdoc documentation. Settings are the
|
57
|
-
# same as the rdoc command's option, with two
|
58
|
-
# exceptions: +inline+ for +inline-source+ and
|
59
|
-
# +output+ for +op+.
|
60
|
-
|
61
|
-
def rdoc(options=nil)
|
62
|
-
options ||= {}
|
63
|
-
options.rekey!(&:to_s)
|
64
|
-
|
65
|
-
config = configuration['rdoc']
|
66
|
-
options = RDOC_DEFAULTS.merge(config).merge(options)
|
67
|
-
|
68
|
-
cmdopts = {}
|
69
|
-
cmdopts['template'] = options['template'] || template || DEFAULT_TEMPLATE
|
70
|
-
cmdopts['op'] = options['output'] || output || DEFAULT_OUTPUT
|
71
|
-
cmdopts['merge'] = options['merge'] || merge || DEFAULT_MERGE
|
72
|
-
cmdopts['inline-source'] = options['inline'] || incline || DEFAULT_INLINE
|
73
|
-
cmdopts['exclude'] = options['exclude'] || exlcude || DEFAULT_EXCLUDE
|
74
|
-
|
75
|
-
output = cmdopts['op']
|
76
|
-
|
77
|
-
files = options['include'] || include || DEFAULT_INCLUDE
|
78
|
-
adfile = options['adfile'] || adfile || DEFAULT_ADFILE
|
79
|
-
|
80
|
-
input = files.collect do |i|
|
81
|
-
dir?(i) ? File.join(i,'**','*') : i
|
82
|
-
end
|
83
|
-
|
84
|
-
if out_of_date?(output, *input) or force?
|
85
|
-
rdoc_shell(files, config)
|
86
|
-
rdoc_insert_ads(output, adfile)
|
87
|
-
else
|
88
|
-
puts "Rdocs are current."
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
# Remove rdocs products.
|
93
|
-
|
94
|
-
def clobber_rdoc(options=nil)
|
95
|
-
options ||= {}
|
96
|
-
options.rekey!(&:to_s)
|
97
|
-
|
98
|
-
config = configuration['rdoc']
|
99
|
-
options = DEFAULTS_RDOC.merge(config).merge(options)
|
100
|
-
|
101
|
-
dir = options['output']
|
102
|
-
|
103
|
-
rm_r(dir) if File.directory?(dir)
|
104
|
-
end
|
105
|
-
|
106
|
-
private
|
107
|
-
|
108
|
-
# Document target.
|
109
|
-
|
110
|
-
def rdoc_shell(files, config)
|
111
|
-
output = config['op']
|
112
|
-
rm_r(output) if exist?(output) and safe?(output) # remove old rdocs
|
113
|
-
sh "rdoc #{[files, config].to_console}"
|
114
|
-
end
|
115
|
-
|
116
|
-
# Insert an ad if available.
|
117
|
-
|
118
|
-
def rdoc_insert_ads(site, adfile)
|
119
|
-
return unless adfile && File.file?(adfile)
|
120
|
-
adtext = File.read(adfile)
|
121
|
-
#puts
|
122
|
-
dirs = Dir.glob(File.join(site,'*/'))
|
123
|
-
dirs.each do |dir|
|
124
|
-
files = Dir.glob(File.join(dir, '**/*.html'))
|
125
|
-
files.each do |file|
|
126
|
-
html = file_read(file)
|
127
|
-
bodi = html.index('<body>')
|
128
|
-
html[bodi + 7] = "\n" + adtext
|
129
|
-
#print "Augmenting #{file}..."
|
130
|
-
file_write(file, html) unless dryrun?
|
131
|
-
#puts "[done]"
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
public
|
137
|
-
|
138
|
-
|
139
|
-
# generate local ri docs
|
140
|
-
#
|
141
|
-
# Generate RI documentation. This utilizes
|
142
|
-
# rdoc to produce the appropriate files.
|
143
|
-
|
144
|
-
def ri(options=nil)
|
145
|
-
options ||= {}
|
146
|
-
options.rekey!(&:to_s)
|
147
|
-
|
148
|
-
config = configuration['ri']
|
149
|
-
options = DEFAULTS_RI.merge(config).merge(options)
|
150
|
-
|
151
|
-
cmdopts = {}
|
152
|
-
cmdopts['op'] = options['output']
|
153
|
-
cmdopts['exclude'] = options['exclude']
|
154
|
-
|
155
|
-
output = options['output']
|
156
|
-
files = options['include'] # || ['lib', '[A-Z]*']
|
157
|
-
|
158
|
-
input = files.collect do |i|
|
159
|
-
dir?(i) ? File.join(i,'**','*') : i
|
160
|
-
end
|
161
|
-
|
162
|
-
if out_of_date?(output, *input) or force?
|
163
|
-
ri_shell(files, config)
|
164
|
-
else
|
165
|
-
puts "RI Docs are current."
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
# Remove ri products.
|
170
|
-
|
171
|
-
def clobber_ri(options=nil)
|
172
|
-
options ||= {}
|
173
|
-
options.rekey!(&:to_s)
|
174
|
-
|
175
|
-
config = configuration['ri']
|
176
|
-
options = DEFAULTS_RI.merge(config).merge(options)
|
177
|
-
|
178
|
-
dir = options['output']
|
179
|
-
|
180
|
-
rm_r(dir) if File.directory?(dir)
|
181
|
-
end
|
182
|
-
|
183
|
-
private
|
184
|
-
|
185
|
-
# Shell out to rdoc to create ri docs.
|
186
|
-
|
187
|
-
def ri_shell(files, config)
|
188
|
-
output = config['op']
|
189
|
-
input = config.delete('include')
|
190
|
-
|
191
|
-
# Check for 'doc' directory.
|
192
|
-
# (Helps to ensure we're in the right place.)
|
193
|
-
#dir!(File.dirname(site))
|
194
|
-
|
195
|
-
# Remove old rdocs.
|
196
|
-
rm_r(output) if exist?(output) and safe?(output)
|
197
|
-
|
198
|
-
#input = input.collect{ |i| glob(i) }.flatten
|
199
|
-
vector = ['--ri', input, config]
|
200
|
-
rdoc(vector.to_console)
|
201
|
-
end
|
202
|
-
|
203
|
-
# Defaults to output.
|
204
|
-
|
205
|
-
attr_accessor :html_output
|
206
|
-
|
207
|
-
def html_ouput
|
208
|
-
@html_output ||= output
|
209
|
-
end
|
210
|
-
|
211
|
-
# Stylesheet to use for html converted files.
|
212
|
-
|
213
|
-
attr_accessor :css
|
214
|
-
|
215
|
-
attr_accessor :metafiles
|
216
|
-
|
217
|
-
def metafiles
|
218
|
-
@files ||= Dir.glob('[A-Z]*')
|
219
|
-
end
|
220
|
-
|
221
|
-
def css
|
222
|
-
@css ||= Dir.glob('*.css').first
|
223
|
-
end
|
224
|
-
|
225
|
-
# Create web index.html from README.
|
226
|
-
|
227
|
-
def html(options=nil)
|
228
|
-
require 'rdoc/markup/simple_markup'
|
229
|
-
require 'rdoc/markup/simple_markup/to_html'
|
230
|
-
|
231
|
-
s = SM::SimpleMarkup.new
|
232
|
-
h = SM::ToHtml.new
|
233
|
-
|
234
|
-
metafiles.each do |file|
|
235
|
-
unless File.exist?(file)
|
236
|
-
puts "Warning: file does not exist -- #{file}"
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
mkdir_p(output) unless dryrun?
|
241
|
-
|
242
|
-
files.each do |file|
|
243
|
-
name = file.downcase.chomp('.txt')
|
244
|
-
if /^readme/ =~ name
|
245
|
-
name = "index"
|
246
|
-
end
|
247
|
-
path = File.join(dir, name + '.html')
|
248
|
-
|
249
|
-
if dryrun?
|
250
|
-
puts "[DRYRUN] Create #{path}"
|
251
|
-
else
|
252
|
-
next unless out_of_date?(path, file)
|
253
|
-
|
254
|
-
title = "#{package.title} #{name.upcase}"
|
255
|
-
|
256
|
-
input = File.read(file)
|
257
|
-
output = s.convert(input, h)
|
258
|
-
|
259
|
-
File.open(path, 'w') do |f|
|
260
|
-
f << %{<html>}
|
261
|
-
f << %{<head>}
|
262
|
-
f << %{ <title>#{title}<title>}
|
263
|
-
f << %{ <link rel="stylesheet" TYPE="text/css" HREF="#{css}">} if css
|
264
|
-
f << %{</head>}
|
265
|
-
f << %{<body>}
|
266
|
-
f << output
|
267
|
-
f << %{</body>}
|
268
|
-
f << %{</html>}
|
269
|
-
end
|
270
|
-
|
271
|
-
puts "Created #{path}"
|
272
|
-
end
|
273
|
-
end
|
274
|
-
end
|
275
|
-
|
276
|
-
# Create off-line docs package.
|
277
|
-
|
278
|
-
def package(name, version)
|
279
|
-
#name = release.name
|
280
|
-
#ver = release.version
|
281
|
-
|
282
|
-
Dir.chdir(output) do
|
283
|
-
zip "-czhvf #{name}-docs-#{version}.zip *"
|
284
|
-
end
|
285
|
-
end
|
286
|
-
|
287
|
-
end
|
288
|
-
|
289
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'reap/tool'
|
2
|
-
|
3
|
-
module Reap
|
4
|
-
|
5
|
-
class Rubyforge < Build
|
6
|
-
|
7
|
-
# Command attributes.
|
8
|
-
|
9
|
-
attr_accessor :project
|
10
|
-
attr_accessor :username
|
11
|
-
|
12
|
-
# For releasing.
|
13
|
-
|
14
|
-
attr_accessor :version
|
15
|
-
|
16
|
-
# Release packages to rubyforge (using icli).
|
17
|
-
|
18
|
-
def release
|
19
|
-
name, version = release.name, release.version
|
20
|
-
sh "icli rubyforge release --version=#{version}"
|
21
|
-
end
|
22
|
-
|
23
|
-
# For publishing.
|
24
|
-
|
25
|
-
attr_accessor :subdir
|
26
|
-
attr_accessor :source
|
27
|
-
attr_accessor :clear
|
28
|
-
attr_accessor :protect
|
29
|
-
attr_accessor :exclude
|
30
|
-
|
31
|
-
def source
|
32
|
-
@source ||= "doc"
|
33
|
-
end
|
34
|
-
|
35
|
-
def username
|
36
|
-
@username ||= ENV['RUBYFORGE_USERNAME'] # good idea here?
|
37
|
-
end
|
38
|
-
|
39
|
-
# Publish website to rubyforge.
|
40
|
-
#
|
41
|
-
# This task publishes the source dir (deafult 'doc')
|
42
|
-
# to a rubyforge website.
|
43
|
-
#
|
44
|
-
# Uses RSync to upload files to webserver.
|
45
|
-
|
46
|
-
def publish
|
47
|
-
if clear
|
48
|
-
protect = protect().to_a
|
49
|
-
exclude = exclude().to_a
|
50
|
-
else
|
51
|
-
protect = %w{usage statcvs statsvn robot.txt wiki} + protect().to_a
|
52
|
-
exclude = %w{.svn} + exclude().to_a
|
53
|
-
end
|
54
|
-
|
55
|
-
abort "no project" unless project
|
56
|
-
abort "no username" unless username
|
57
|
-
|
58
|
-
if subdir
|
59
|
-
destination = File.join(project, subdir)
|
60
|
-
else
|
61
|
-
destination = project
|
62
|
-
end
|
63
|
-
|
64
|
-
dir = source.chomp('/') + '/'
|
65
|
-
url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{destination}"
|
66
|
-
|
67
|
-
op = ['-rLvz', '--delete-after'] # maybe -p ?
|
68
|
-
|
69
|
-
# Using commandline filter options didn't seem
|
70
|
-
# to work, so I opted for creating an .rsync_filter file for
|
71
|
-
# all cases.
|
72
|
-
|
73
|
-
unless protect.empty? && exclude.empty?
|
74
|
-
rsync_file = File.join(source,'.rsync-filter')
|
75
|
-
unless file?(rsync_file)
|
76
|
-
File.open(rsync_file, 'w') do |f|
|
77
|
-
exclude.each{|e| f << "- #{e}\n"}
|
78
|
-
protect.each{|e| f << "P #{e}\n"}
|
79
|
-
end
|
80
|
-
end
|
81
|
-
op << "--filter='dir-merge #{rsync_file}'"
|
82
|
-
end
|
83
|
-
|
84
|
-
args = op + [dir, url]
|
85
|
-
|
86
|
-
rsync(*args.to_params)
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
data/work/sandbox/build/sign.rb
DELETED
@@ -1,241 +0,0 @@
|
|
1
|
-
# = TITLE:
|
2
|
-
#
|
3
|
-
# Sign DSL
|
4
|
-
#
|
5
|
-
# = COPYING:
|
6
|
-
#
|
7
|
-
# Copyright (c) 2007,2008 Tiger Ops
|
8
|
-
#
|
9
|
-
# This file is part of the Reap program.
|
10
|
-
#
|
11
|
-
# Reap is free software: you can redistribute it and/or modify
|
12
|
-
# it under the terms of the GNU General Public License as published by
|
13
|
-
# the Free Software Foundation, either version 3 of the License, or
|
14
|
-
# (at your option) any later version.
|
15
|
-
#
|
16
|
-
# Reap is distributed in the hope that it will be useful,
|
17
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
-
# GNU General Public License for more details.
|
20
|
-
#
|
21
|
-
# You should have received a copy of the GNU General Public License
|
22
|
-
# along with Reap. If not, see <http://www.gnu.org/licenses/>.
|
23
|
-
#
|
24
|
-
# = TODO:
|
25
|
-
# - Do signitures belong under data/{name}/?
|
26
|
-
# Heck do all these metadata files belong there?
|
27
|
-
# OTOH using remote require, how would one access these?
|
28
|
-
# should they be contigious to the libs themselves?
|
29
|
-
|
30
|
-
#require 'autorake/tasks/manifest'
|
31
|
-
|
32
|
-
#
|
33
|
-
module Quarry
|
34
|
-
|
35
|
-
# Create signitures for libraries.
|
36
|
-
# FIXME
|
37
|
-
|
38
|
-
class Sign < Build
|
39
|
-
|
40
|
-
# Default set of files to sign.
|
41
|
-
DEFAULT_SIGN_FILES = ['lib/**/*', 'ext/**/*']
|
42
|
-
|
43
|
-
DEFAULT_PUBLIC_KEY = 'pubkey.pem'
|
44
|
-
DEFAULT_PRIVATE_KEY = '_privkey.pem'
|
45
|
-
|
46
|
-
# Generate file signitures. This task generates signitures
|
47
|
-
# for each library file using public/private keys.
|
48
|
-
# The sign script will generate encrypted signitures for
|
49
|
-
# files in the project --by default the lib/ and ext/ files.
|
50
|
-
#
|
51
|
-
# name Project name [name]
|
52
|
-
# keyfile Pathname to .pem file for private key
|
53
|
-
# files Files to include/exclude.
|
54
|
-
# output Directory to store signiture files
|
55
|
-
# [data/{name}/signitures/]
|
56
|
-
#
|
57
|
-
# By default the keyfile is '_privkey.pem'. (BE SURE NEVER
|
58
|
-
# TO PUBLISH THIS FILE!!!) But if no a private key file is
|
59
|
-
# given/found, this will ask if you would like to
|
60
|
-
# generate one. It also can generate a public key for the
|
61
|
-
# project if it does not have one.
|
62
|
-
#
|
63
|
-
# There are two ways to approach key usage here. Either
|
64
|
-
# a per project key pair, or use a personal key pair.
|
65
|
-
|
66
|
-
def sign( override=nil )
|
67
|
-
name = info.project
|
68
|
-
keyfile = info.private_key
|
69
|
-
|
70
|
-
output = info.sign_output
|
71
|
-
files = info.sign_files
|
72
|
-
|
73
|
-
files ||= DEFAULT_SIGN_FILES
|
74
|
-
keyfile ||= DEFAULT_PRIVATE_KEY
|
75
|
-
output ||= File.join('data',name,'signitures')
|
76
|
-
|
77
|
-
files = Dir.multiglob_with_default(DEFAULT_SIGN_FILES, files)
|
78
|
-
|
79
|
-
unless File.directory?( dir = File.dirname(output) )
|
80
|
-
puts "Output directory #{dir} doesn't exist."
|
81
|
-
return nil
|
82
|
-
end
|
83
|
-
|
84
|
-
output = File.expand_path(output)
|
85
|
-
|
86
|
-
unless keyfile and File.exist?(keyfile)
|
87
|
-
ans = ask("Private key file required. Generate one?", "yN")
|
88
|
-
case ans
|
89
|
-
when 'y', 'Y'
|
90
|
-
keyfile = genkey(name)
|
91
|
-
puts "\nFile '#{keyfile}' created. Be sure to keep this file private and secure."
|
92
|
-
else
|
93
|
-
puts "Task cancelled."
|
94
|
-
exit -1
|
95
|
-
#return nil
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
keyfile = File.expand_path(keyfile)
|
100
|
-
|
101
|
-
generate_signitures(keyfile, files, output)
|
102
|
-
end
|
103
|
-
|
104
|
-
private
|
105
|
-
|
106
|
-
# Generate a signiture for a file.
|
107
|
-
|
108
|
-
def generate_signitures( keyfile, files, to_folder )
|
109
|
-
privkey = load_key(keyfile)
|
110
|
-
|
111
|
-
dir = File.dirname(to_folder)
|
112
|
-
save_key(privkey.public_key, File.join(dir, DEFAULT_PUBLIC_KEY))
|
113
|
-
|
114
|
-
fu.mkdir_p(to_folder)
|
115
|
-
files.each do |file|
|
116
|
-
next if File.directory?(file)
|
117
|
-
sig = sign_file(privkey, file)
|
118
|
-
write_signiture(to_folder, file, sig)
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
# Write signiture to file.
|
123
|
-
|
124
|
-
def write_signiture( to_folder, file, sig )
|
125
|
-
sigfile = File.join(to_folder, file + '.sig')
|
126
|
-
fu.mkdir_p(File.dirname(sigfile))
|
127
|
-
if project.dryrun?
|
128
|
-
puts "(save #{sigfile})" unless project.quiet?
|
129
|
-
else
|
130
|
-
File.open( sigfile, 'w' ) do |f|
|
131
|
-
f << sig
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
# Generate a signiture of a file.
|
137
|
-
|
138
|
-
def sign_file( key, file )
|
139
|
-
plain = File.read( file )
|
140
|
-
dig = digester(info.digest||'sha256').new
|
141
|
-
sig = key.sign(dig, plain)
|
142
|
-
return sig
|
143
|
-
end
|
144
|
-
|
145
|
-
# Verify a signiture of a file.
|
146
|
-
|
147
|
-
def verify_signiture?( pubkey, sig, plain )
|
148
|
-
plain = plain.read if IO === plain
|
149
|
-
dig = digester(info.digest||'sha256').new
|
150
|
-
success = pubkey.verify(dig, sig, plain)
|
151
|
-
return success
|
152
|
-
end
|
153
|
-
|
154
|
-
# Generate a public key from a private key.
|
155
|
-
#
|
156
|
-
#def pubkey( privkey )
|
157
|
-
# pubkey = privkey.public_key
|
158
|
-
# return pubkey
|
159
|
-
#end
|
160
|
-
|
161
|
-
# Load key.
|
162
|
-
|
163
|
-
def load_key( file )
|
164
|
-
key = OpenSSL::PKey::RSA.new(File.read(file))
|
165
|
-
end
|
166
|
-
|
167
|
-
# Save key.
|
168
|
-
|
169
|
-
def save_key( key, file )
|
170
|
-
if project.dryrun?
|
171
|
-
puts "(save #{file})" unless project.quiet?
|
172
|
-
else
|
173
|
-
File.open( file, 'w' ) do |f|
|
174
|
-
f << key.to_pem
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
# Generate a private key and save it to '_privkey.pem'.
|
180
|
-
|
181
|
-
def genkey( name )
|
182
|
-
key = OpenSSL::PKey::RSA.new(2048){ print "." } # @name }
|
183
|
-
save_key( key, PRIVATE_KEY )
|
184
|
-
return PRIVATE_KEY
|
185
|
-
end
|
186
|
-
|
187
|
-
# def write_keypair( libname )
|
188
|
-
# privkey = genkey( libname )
|
189
|
-
# pubkey = privkey.public_key
|
190
|
-
# save_key( privkey, "privkey.pem" )
|
191
|
-
# save_key( pubkey, "pubkey.pem" )
|
192
|
-
# puts "Key pair generated. Please secure privkey.pem."
|
193
|
-
# end
|
194
|
-
#
|
195
|
-
# # Generate a private key.
|
196
|
-
#
|
197
|
-
# def genkey( libname='.' )
|
198
|
-
# key = OpenSSL::PKey::RSA.new(2048) { print "." } # libname }
|
199
|
-
# return key
|
200
|
-
# end
|
201
|
-
#
|
202
|
-
# # Generate a public key from a private key.
|
203
|
-
#
|
204
|
-
# def pubkey( privkey )
|
205
|
-
# pubkey = privkey.public_key
|
206
|
-
# return pubkey
|
207
|
-
# end
|
208
|
-
|
209
|
-
# Return a digest class for given +type+.
|
210
|
-
# Supported digests are:
|
211
|
-
#
|
212
|
-
# * md5
|
213
|
-
# * sha1
|
214
|
-
# * sha128 (same as sha1)
|
215
|
-
# * sha256
|
216
|
-
# * sha512
|
217
|
-
#
|
218
|
-
# Default digest type is sha256.
|
219
|
-
|
220
|
-
# def digester( type=nil )
|
221
|
-
# require 'openssl'
|
222
|
-
# type = 'sha256' unless type
|
223
|
-
# case type.to_s.downcase
|
224
|
-
# when 'md5'
|
225
|
-
# require 'digest/md5'
|
226
|
-
# Digest::MD5
|
227
|
-
# when 'sha128', 'sha1'
|
228
|
-
# require 'digest/sha1' #need?
|
229
|
-
# OpenSSL::Digest::SHA1
|
230
|
-
# when 'sha256'
|
231
|
-
# require 'digest/sha1' #need?
|
232
|
-
# OpenSSL::Digest::SHA256
|
233
|
-
# when 'sha512'
|
234
|
-
# require 'digest/sha1' #need?
|
235
|
-
# OpenSSL::Digest::SHA512
|
236
|
-
# end
|
237
|
-
# end
|
238
|
-
|
239
|
-
end
|
240
|
-
|
241
|
-
end
|
data/work/sandbox/build/stamp.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
rquire 'quarry/build'
|
2
|
-
|
3
|
-
module Quarry
|
4
|
-
|
5
|
-
# Create a VERSION stamp.
|
6
|
-
|
7
|
-
class Stamp < Build
|
8
|
-
|
9
|
-
attr_accessor :file
|
10
|
-
attr_accessor :name
|
11
|
-
attr_accessor :version
|
12
|
-
attr_accessor :status
|
13
|
-
|
14
|
-
attr_accessor :default
|
15
|
-
attr_accessor :libpath
|
16
|
-
|
17
|
-
# Update release "stamp" (.roll) file.
|
18
|
-
|
19
|
-
def stamp
|
20
|
-
w = ''
|
21
|
-
w << "#{name} #{version} #{status} #{Time.now.strftime('%Y-%m-%d')}"
|
22
|
-
w << " #{default}" if default
|
23
|
-
w << "\n"
|
24
|
-
w << libpath.join("\n")
|
25
|
-
|
26
|
-
if dryrun?
|
27
|
-
puts file + ":"
|
28
|
-
puts w
|
29
|
-
else
|
30
|
-
File.open(file, 'w'){|f| f << w}
|
31
|
-
puts "#{file} updated."
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|