rdx 0.9.0.pre → 0.9.0.pre.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.
- checksums.yaml +4 -4
- data/README +186 -12
- data/TODO +18 -0
- data/examples/minimal/.rdx +1 -0
- data/examples/minimal/rakefile +5 -2
- data/examples/ruby-2.0.0-p0/install/core/BUGS +70 -0
- data/examples/ruby-2.0.0-p0/install/core/HALL_OF_SHAME +53 -0
- data/examples/ruby-2.0.0-p0/install/core/README +14 -4
- data/examples/ruby-2.0.0-p0/install/core/Rakefile +9 -4
- data/examples/ruby-2.0.0-p0/install/core/TODO +5 -0
- data/examples/ruby-2.0.0-p0/install/core/diffs/array.c.diff +8 -7
- data/examples/ruby-2.0.0-p0/install/core/diffs/encoding.c.diff +1 -1
- data/examples/ruby-2.0.0-p0/install/core/diffs/enumerator.c.diff +4 -12
- data/examples/ruby-2.0.0-p0/install/core/diffs/eval.c.diff +3 -5
- data/examples/ruby-2.0.0-p0/install/core/diffs/file.c.diff +2 -2
- data/examples/ruby-2.0.0-p0/install/core/diffs/gc.c.diff +5 -4
- data/examples/ruby-2.0.0-p0/install/core/diffs/hash.c.diff +4 -3
- data/examples/ruby-2.0.0-p0/install/core/diffs/object.c.diff +5 -4
- data/examples/ruby-2.0.0-p0/install/core/diffs/proc.c.diff +7 -6
- data/examples/ruby-2.0.0-p0/install/core/diffs/random.c.diff +3 -3
- data/examples/ruby-2.0.0-p0/install/core/diffs/rational.c.diff +21 -18
- data/examples/ruby-2.0.0-p0/install/core/diffs/ruby.c.diff +1 -1
- data/examples/ruby-2.0.0-p0/install/stdlib/DOCUMENTATION +22 -0
- data/examples/ruby-2.0.0-p0/install/stdlib/README +12 -4
- data/examples/ruby-2.0.0-p0/install/stdlib/Rakefile +10 -5
- data/examples/ruby-2.0.0-p0/install/stdlib/TODO +6 -0
- data/examples/ruby-2.0.0-p0/install/stdlib/diffs/lib/optparse.rb.diff +31 -11
- data/examples/ruby-2.0.0-p0/install/stdlib/diffs/lib/uri/common.rb.diff +8 -7
- data/examples/ruby-2.0.0-p0/install/stdlib/diffs/lib/weakref.rb.diff +2 -2
- data/lib/rdx.rb +42 -92
- data/lib/rdx/assertions.rb +8 -9
- data/lib/rdx/binding.rb +2 -2
- data/lib/rdx/comment.rb +7 -5
- data/lib/rdx/convention.rb +10 -9
- data/lib/rdx/directive.rb +51 -26
- data/lib/rdx/example.rb +94 -68
- data/lib/rdx/generator.rb +1 -1
- data/lib/rdx/generator/rdoc.rb +5 -6
- data/lib/rdx/options.rb +7 -3
- data/lib/rdx/reporter.rb +17 -0
- data/lib/rdx/ruby_lex.rb +3 -3
- data/lib/rdx/runner.rb +1 -1
- data/lib/rdx/statement.rb +1 -1
- data/lib/rdx/store.rb +1 -1
- data/lib/rdx/task.rb +1 -1
- data/lib/rdx/text.rb +1 -1
- data/lib/rdx/version.rb +1 -1
- data/rakefile +43 -14
- metadata +23 -3
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
Since examples are now treated as tests we can be much more descriptive - with the
|
3
|
+
appropriate formalism - in the documentation; meanwhile this reduces the coupling with
|
4
|
+
test files, which therefore become smaller. The result is a super-duper documentation
|
5
|
+
without the troubles of refactoring comments and duplicated code!
|
6
|
+
To prove this, let's consider for instance the following files (patched):
|
7
|
+
|
8
|
+
* lib/set.rb
|
9
|
+
The documentation examples were almost missing (no blame!), so almost all the content
|
10
|
+
of the test file has been translated into them succesfully.
|
11
|
+
|
12
|
+
* lib/matrix.rb
|
13
|
+
Here most documentation examples has been refactored, according to the RDX formalism:
|
14
|
+
with a simple global-accepted syntax we gain many unit tests for free.
|
15
|
+
Moreover additional examples have been imported from the test files, which can then
|
16
|
+
become much lighter (the examples now cover the vast majority of them).
|
17
|
+
|
18
|
+
* lib/optparse.rb
|
19
|
+
It's in this file that the bash directive really shines,
|
20
|
+
since it allows to easily write acceptance tests.
|
21
|
+
The user can clearly see what's the result of a given action,
|
22
|
+
even without actually trying himself to run all those combinations!
|
@@ -2,18 +2,26 @@
|
|
2
2
|
Directory structure:
|
3
3
|
|
4
4
|
stdlib
|
5
|
+
|
|
5
6
|
|- README (this file)
|
6
7
|
|
|
7
8
|
|- orig
|
8
|
-
| +
|
9
|
+
| + Contains original (Ruby 2.0.0-p0) files (Ruby sources)
|
9
10
|
|
|
10
11
|
|- patched
|
11
|
-
| +
|
12
|
+
| + Contains patched files (RDX works correctly on these)
|
12
13
|
|
|
13
14
|
|- rakefile
|
14
15
|
| Allows an easy interface for running RDX.
|
15
|
-
| The most useful action is to run
|
16
|
+
| The most useful action is to run:
|
16
17
|
| rake rdx
|
18
|
+
| You can also run RDX on the original files, but you'll encounter
|
19
|
+
| troubles (nothing harmful, anyway). Just use:
|
20
|
+
| rake rdx_on_orig
|
17
21
|
|
|
18
22
|
+- .rdx
|
19
|
-
|
23
|
+
| Contains the RDX::Specification
|
24
|
+
|
|
25
|
+
+- DOCUMENTATION
|
26
|
+
Describes the benefits of an RDX-enhanced documentation, explaining the patches
|
27
|
+
to some files of the Ruby Standard Library
|
@@ -1,4 +1,10 @@
|
|
1
1
|
|
2
|
+
current_ruby = "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
|
3
|
+
build_ruby = '2.0.0-p0'
|
4
|
+
unless current_ruby == build_ruby
|
5
|
+
raise "Run this example with Ruby #{build_ruby} (detected #{current_ruby})"
|
6
|
+
end
|
7
|
+
|
2
8
|
require 'rubygems'
|
3
9
|
require 'rake'
|
4
10
|
require 'pathname'
|
@@ -10,7 +16,6 @@ $LOAD_PATH.unshift RDX_ROOT
|
|
10
16
|
require 'rdx'
|
11
17
|
|
12
18
|
|
13
|
-
|
14
19
|
require 'rdoc/task'
|
15
20
|
rdoc_task = RDoc::Task.new do |rdoc|
|
16
21
|
%w[
|
@@ -19,15 +24,14 @@ rdoc_task = RDoc::Task.new do |rdoc|
|
|
19
24
|
%w[
|
20
25
|
|
21
26
|
].each{ |fname| rdoc.rdoc_files.exclude "#{NEW}/lib/**/#{fname}.rb" }
|
27
|
+
|
22
28
|
rdoc.options << '--all' << '--line-numbers' << '--tab-width=2'
|
23
29
|
rdoc.options << "--root=#{NEW}"
|
24
30
|
rdoc.rdoc_dir = "rdoc"
|
25
31
|
end
|
26
32
|
|
27
33
|
|
28
|
-
|
29
|
-
RDX::Task.new do |task|
|
30
|
-
task.name = :rdx_on_orig
|
34
|
+
RDX::Task.new :rdx_on_orig do |task|
|
31
35
|
task.description = 'Run RDX on the original stdlib sources'
|
32
36
|
task.files.add OLD
|
33
37
|
task.lib_dirs << "#{OLD}/lib"
|
@@ -48,6 +52,7 @@ RDX::Task.new do |task|
|
|
48
52
|
# task.debug = true
|
49
53
|
# task.verbose = true
|
50
54
|
# task.full_trace = true
|
51
|
-
|
55
|
+
task.doc_output = false
|
56
|
+
task.reporter = 'docquiet'
|
52
57
|
# task.dry_run = true
|
53
58
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
--- stdlib/orig/lib/optparse.rb 2015-06-11 07:51:45 +0000
|
2
|
-
+++ stdlib/patched/lib/optparse.rb 2015-
|
3
|
-
@@ -68,19 +68,
|
2
|
+
+++ stdlib/patched/lib/optparse.rb 2015-08-30 23:08:38 +0000
|
3
|
+
@@ -68,19 +68,41 @@
|
4
4
|
#
|
5
5
|
# === Minimal example
|
6
6
|
#
|
@@ -33,13 +33,19 @@
|
|
33
33
|
+# $ ruby example.rb -v
|
34
34
|
+# options = {:verbose=>true}
|
35
35
|
+# ARGV = []
|
36
|
+
+# $ ruby example.rb --verbose
|
37
|
+
+# options = {:verbose=>true}
|
38
|
+
+# ARGV = []
|
36
39
|
+# $ ruby example.rb --no-verbose arg1
|
37
40
|
+# options = {:verbose=>false}
|
38
41
|
+# ARGV = ["arg1"]
|
42
|
+
+# $ ruby example.rb -- --no-verbose
|
43
|
+
+# options = {}
|
44
|
+
+# ARGV = ["--no-verbose"]
|
39
45
|
#
|
40
46
|
# === Complete example
|
41
47
|
#
|
42
|
-
@@ -88,6 +
|
48
|
+
@@ -88,6 +110,8 @@
|
43
49
|
# effect of specifying various options. This is probably the best way to learn
|
44
50
|
# the features of +optparse+.
|
45
51
|
#
|
@@ -48,7 +54,7 @@
|
|
48
54
|
# require 'optparse'
|
49
55
|
# require 'optparse/time'
|
50
56
|
# require 'ostruct'
|
51
|
-
@@ -112,7 +
|
57
|
+
@@ -112,7 +136,7 @@
|
52
58
|
# options.verbose = false
|
53
59
|
#
|
54
60
|
# opt_parser = OptionParser.new do |opts|
|
@@ -57,7 +63,7 @@
|
|
57
63
|
#
|
58
64
|
# opts.separator ""
|
59
65
|
# opts.separator "Specific options:"
|
60
|
-
@@ -197,8 +
|
66
|
+
@@ -197,8 +221,43 @@
|
61
67
|
# end # class OptparseExample
|
62
68
|
#
|
63
69
|
# options = OptparseExample.parse(ARGV)
|
@@ -90,13 +96,27 @@
|
|
90
96
|
+# Common options:
|
91
97
|
+# -h, --help Show this message
|
92
98
|
+# --version Show version
|
99
|
+
+# $ ./example_app -ibak --delay 3.5 --irs=1 argument
|
100
|
+
+# options = #<OpenStruct library=[], inplace=true, encoding="utf8", transfer_type=:auto, verbose=false, extension=".bak", delay=+3.5, record_separator=1>
|
101
|
+
+# ARGV = ["argument"]
|
102
|
+
+# $ ./example_app --list 1,2,str --type=binary -- -hypenated-arg regular-arg
|
103
|
+
+# options = #<OpenStruct library=[], inplace=false, encoding="utf8", transfer_type=:binary, verbose=false, list=["1", "2", "str"]>
|
104
|
+
+# ARGV = ["-hypenated-arg", "regular-arg"]
|
93
105
|
+# $ ./example_app -rset -vi --code=sjis an_argument another_argument
|
94
106
|
+# options = #<OpenStruct library=["set"], inplace=true, encoding="shift_jis", transfer_type=:auto, verbose=true, extension="">
|
95
107
|
+# ARGV = ["an_argument", "another_argument"]
|
96
108
|
#
|
97
109
|
# === Shell Completion
|
98
110
|
#
|
99
|
-
@@ -
|
111
|
+
@@ -221,7 +280,6 @@
|
112
|
+
RequiredArgument = [REQUIRED_ARGUMENT = :REQUIRED, true].freeze
|
113
|
+
OptionalArgument = [OPTIONAL_ARGUMENT = :OPTIONAL, false].freeze
|
114
|
+
# :startdoc:
|
115
|
+
-
|
116
|
+
#
|
117
|
+
# Keyword completion module. This allows partial arguments to be specified
|
118
|
+
# and resolved against a list of acceptable values.
|
119
|
+
@@ -618,6 +676,7 @@
|
100
120
|
# +long_opts+:: List of long style options.
|
101
121
|
# +nolong_opts+:: List of long style options with "no-" prefix.
|
102
122
|
#
|
@@ -104,7 +124,7 @@
|
|
104
124
|
# prepend(switch, short_opts, long_opts, nolong_opts)
|
105
125
|
#
|
106
126
|
def prepend(*args)
|
107
|
-
@@ -634,6 +
|
127
|
+
@@ -634,6 +693,7 @@
|
108
128
|
# +long_opts+:: List of long style options.
|
109
129
|
# +nolong_opts+:: List of long style options with "no-" prefix.
|
110
130
|
#
|
@@ -112,7 +132,7 @@
|
|
112
132
|
# append(switch, short_opts, long_opts, nolong_opts)
|
113
133
|
#
|
114
134
|
def append(*args)
|
115
|
-
@@ -913,6 +
|
135
|
+
@@ -913,6 +973,7 @@
|
116
136
|
# +t+:: Argument class specifier, any object including Class.
|
117
137
|
# +pat+:: Pattern for argument, defaults to +t+ if it responds to match.
|
118
138
|
#
|
@@ -120,7 +140,7 @@
|
|
120
140
|
# accept(t, pat, &block)
|
121
141
|
#
|
122
142
|
def accept(*args, &blk) top.accept(*args, &blk) end
|
123
|
-
@@ -925,7 +
|
143
|
+
@@ -925,7 +986,7 @@
|
124
144
|
# Directs to reject specified class argument.
|
125
145
|
#
|
126
146
|
# +t+:: Argument class specifier, any object including Class.
|
@@ -129,7 +149,7 @@
|
|
129
149
|
# reject(t)
|
130
150
|
#
|
131
151
|
def reject(*args, &blk) top.reject(*args, &blk) end
|
132
|
-
@@ -1097,6 +
|
152
|
+
@@ -1097,6 +1158,7 @@
|
133
153
|
#
|
134
154
|
# Creates an OptionParser::Switch from the parameters. The parsed argument
|
135
155
|
# value is passed to the given block, where it can be processed.
|
@@ -137,7 +157,7 @@
|
|
137
157
|
#
|
138
158
|
# See at the beginning of OptionParser for some full examples.
|
139
159
|
#
|
140
|
-
@@ -1896,6 +
|
160
|
+
@@ -1896,6 +1958,7 @@
|
141
161
|
#
|
142
162
|
# Substitution of getopts is possible as follows. Also see
|
143
163
|
# OptionParser#getopts.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
--- stdlib/orig/lib/uri/common.rb 2015-06-11 07:51:45 +0000
|
2
|
-
+++ stdlib/patched/lib/uri/common.rb 2015-
|
2
|
+
+++ stdlib/patched/lib/uri/common.rb 2015-08-31 16:14:33 +0000
|
3
3
|
@@ -67,6 +67,7 @@
|
4
4
|
#
|
5
5
|
# == Synopsis
|
@@ -152,12 +152,13 @@
|
|
152
152
|
# URI::join(str[, str, ...])
|
153
153
|
#
|
154
154
|
# == Args
|
155
|
-
@@ -765,20 +771,
|
155
|
+
@@ -765,20 +771,21 @@
|
156
156
|
#
|
157
157
|
# require 'uri'
|
158
158
|
#
|
159
159
|
- # p URI.join("http://example.com/","main.rbx")
|
160
160
|
- # # => #<URI::HTTP:0x2022ac02 URL:http://localhost/main.rbx>
|
161
|
+
+ # :rdx: # Epic Fail!
|
161
162
|
+ # URI.join("http://example.com/","main.rbx")
|
162
163
|
+ # # > #<URI::HTTP:0x2022ac02 URL:http://example.com/main.rbx>
|
163
164
|
#
|
@@ -183,7 +184,7 @@
|
|
183
184
|
#
|
184
185
|
#
|
185
186
|
def self.join(*str)
|
186
|
-
@@ -788,6 +
|
187
|
+
@@ -788,6 +795,7 @@
|
187
188
|
#
|
188
189
|
# == Synopsis
|
189
190
|
#
|
@@ -191,7 +192,7 @@
|
|
191
192
|
# URI::extract(str[, schemes][,&blk])
|
192
193
|
#
|
193
194
|
# == Args
|
194
|
-
@@ -807,7 +
|
195
|
+
@@ -807,7 +815,7 @@
|
195
196
|
# require "uri"
|
196
197
|
#
|
197
198
|
# URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
|
@@ -200,7 +201,7 @@
|
|
200
201
|
#
|
201
202
|
def self.extract(str, schemes = nil, &block)
|
202
203
|
DEFAULT_PARSER.extract(str, schemes, &block)
|
203
|
-
@@ -816,6 +
|
204
|
+
@@ -816,6 +824,7 @@
|
204
205
|
#
|
205
206
|
# == Synopsis
|
206
207
|
#
|
@@ -208,7 +209,7 @@
|
|
208
209
|
# URI::regexp([match_schemes])
|
209
210
|
#
|
210
211
|
# == Args
|
211
|
-
@@ -831,6 +
|
212
|
+
@@ -831,6 +840,7 @@
|
212
213
|
#
|
213
214
|
# == Usage
|
214
215
|
#
|
@@ -216,7 +217,7 @@
|
|
216
217
|
# require 'uri'
|
217
218
|
#
|
218
219
|
# # extract first URI from html_string
|
219
|
-
@@ -961,12 +
|
220
|
+
@@ -961,12 +971,12 @@
|
220
221
|
#
|
221
222
|
# This refers http://www.w3.org/TR/html5/forms.html#url-encoded-form-data
|
222
223
|
#
|
@@ -1,5 +1,5 @@
|
|
1
1
|
--- stdlib/orig/lib/weakref.rb 2015-06-11 07:51:45 +0000
|
2
|
-
+++ stdlib/patched/lib/weakref.rb 2015-
|
2
|
+
+++ stdlib/patched/lib/weakref.rb 2015-08-30 20:19:22 +0000
|
3
3
|
@@ -8,11 +8,12 @@
|
4
4
|
# Usage:
|
5
5
|
#
|
@@ -21,7 +21,7 @@
|
|
21
21
|
# c['qux'] = omg
|
22
22
|
# puts c.inspect
|
23
23
|
-# #=> {"foo"=>"bar", "baz"=>#<Object:0x007f4ddfc6cb48>, "qux"=>"lol"}
|
24
|
-
+# # prints: {"foo"=>"bar", "baz"=>#<Object:
|
24
|
+
+# # prints: {"foo"=>"bar", "baz"=>#<Object:0x007f4ddfc6cb48>, "qux"=>"lol"}
|
25
25
|
#
|
26
26
|
# # Now run the garbage collector
|
27
27
|
# GC.start
|
data/lib/rdx.rb
CHANGED
@@ -1,106 +1,54 @@
|
|
1
|
+
|
2
|
+
# :main: README
|
3
|
+
|
1
4
|
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
# to explain and show the use of the library - if these have been unit tested and work fine.
|
15
|
-
# * DRY (Don't Repeat Yourself)!
|
16
|
-
#
|
17
|
-
# We want to avoid - honestly, we should hate - writing the same things more than once.
|
18
|
-
# It's too tedious to translate back and forth all the examples between documentation and testing.
|
19
|
-
# * Join coupled parts!
|
20
|
-
#
|
21
|
-
# Source, documentation and tests are different sides of the same thing - the programmer's idea -.
|
22
|
-
# When some parts are tightly coupled, the more these are close the more straightforward the eventual
|
23
|
-
# fix is. Documentation tools unify documentation with the source, RDX tries to take the next step.
|
24
|
-
# * Be Consistent!
|
25
|
-
#
|
26
|
-
# Most scripts of the Ruby Core and many of the Standard Library already have the examples
|
27
|
-
# written in a conformed and accepted way. It was this coherency that allowed (and induced)
|
28
|
-
# me to write RDX: a tool can easily automate tasks if they fit well into a general scheme.
|
29
|
-
#
|
30
|
-
# == How RDX works
|
31
|
-
#
|
32
|
-
# In order to achieve its goal it first deals with the documentation tool
|
33
|
-
# (RDoc is the most commonly used, so currently only its support is built-in) asking to keep
|
34
|
-
# track of examples. These are parsed and subdivided into statements: the comment at
|
35
|
-
# their end can eventually become an expectation. The tests are build according to
|
36
|
-
# conventions and directives.
|
37
|
-
#
|
38
|
-
# The *conventions*, heart of RDX, define the rules to accept the ending comments and process the code
|
39
|
-
# (for example the historical hash-rocket notation, <tt>#=></tt>, is implemented in Convention::result_eval:
|
40
|
-
# it evaluates both the statement and the expectation, then compares those results through +assert_equal+).
|
41
|
-
# See more details in the RDX::Convention class.
|
42
|
-
#
|
43
|
-
# While conventions affect single statements, the *directives* operate on a larger scale.
|
44
|
-
# Perhaps we may want to not execute an example, to interpret one as the output of the
|
45
|
-
# previous, to locally change some of the assertions methods, to run it in a temporary directory,
|
5
|
+
# The aim of RDX is to join the worlds of documentation and testing, which overlap in examples.
|
6
|
+
# Relying on RDoc and Minitest RDX parses source files, generates documentation,
|
7
|
+
# extracts examples from comments and executes them as tests.
|
8
|
+
# In the examples the significant data of a statement - like result, output or raised exception -
|
9
|
+
# is pointed out with a comment at its end.
|
10
|
+
#
|
11
|
+
# The conventions, heart of RDX, map specific patterns into those comments to a way of processing
|
12
|
+
# code (for instance the hash-rocket convention "#=>" - pioneer from IRB - simply evals both
|
13
|
+
# statement and expectation and compare those results through assert_equal).
|
14
|
+
#
|
15
|
+
# Directives (explicit or implicit) operate on a larger scale: we may want not to execute an example,
|
16
|
+
# to interpret one as the output of the previous, to change its binding, to run it in a temporary directory,
|
46
17
|
# to simulate a bash environment, and so on...
|
47
|
-
# See the RDX::Directive class for more information about them.
|
48
|
-
#
|
49
|
-
# Both the conventions and directives can be either built-in because of their popularity in the
|
50
|
-
# Ruby Community or defined for convenience by the user.
|
51
|
-
#
|
52
|
-
# Once these tests are built, the only thing left to do is to simply run them.
|
53
|
-
# As a bonus, if everything is correct, RDX's signature is added to those made by the generator
|
54
|
-
# tool: the user of our library now can know that the examples showed enjoy a high level of trust.
|
55
|
-
# All this with a single run, either from the command line or through rake.
|
56
|
-
#
|
57
|
-
# == Conclusions
|
58
|
-
#
|
59
|
-
# When RDX has finished we can see the report of our tests, as if we had manually written all of
|
60
|
-
# them refactoring the comments. In fact, it's even better: if an example has something wrong - if it
|
61
|
-
# doesn't work as declared - the error points us to its location in the comment, which is just above
|
62
|
-
# the source code. This makes the tracking and fixing steps inceadibly easy.
|
63
|
-
#
|
64
|
-
# Through execution, <b>RDX gives formalism to the documentation examples</b>,
|
65
|
-
# greatly increasing their strength. It gives all the section of a source file the deserved emphasis,
|
66
|
-
# transforming fictitious examples into living ones!
|
67
|
-
#
|
68
|
-
# A great point in its favour is that a developer familiar with the Ruby documentation
|
69
|
-
# (of course most of them) doesn't have to learn a new DSL or syntax, but just
|
70
|
-
# to code and document in the "standard" way, with very few alteration.
|
71
18
|
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
# The point that +RDX+ evaluates the comments leads to the topic of security.
|
75
|
-
# Never run blindly RDX on libraries that haven't been written for that, since it's never
|
76
|
-
# a good idea to evaluate unknown code.
|
77
|
-
# If you want, fisrt you have to scan the files and find the examples
|
78
|
-
# (the <tt>--dry-run</tt> option may help you, though it isn't fully secure).
|
79
|
-
# Once you have found that the code is safe you can give RDX a try.
|
80
|
-
#
|
81
|
-
# However, if a library has been built RDX-compatible, you can run it
|
82
|
-
# from your machine - if you _trust_ the producer. If you don't
|
83
|
-
# you must be very careful: even a plain +require+ can be dangerous,
|
84
|
-
# with RDX you have to pay an extra attention to the comments.
|
19
|
+
# Either conventions and directives can be built-in because of their popularity or defined by the user.
|
20
|
+
# By running those tests, RDX gives formalism to documentation examples, greatly increasing their strength.
|
85
21
|
#
|
86
22
|
# == Roadmap
|
87
23
|
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
# If you want to define your own conventions and directives, see the Specification.
|
92
|
-
#
|
93
|
-
# If you want to know the available command line options, see Options.
|
24
|
+
# The conventions and directives are probably the most interesting topics;
|
25
|
+
# check out their relative classes (RDX::Convention and RDX::Directive)
|
26
|
+
# to discover their details.
|
94
27
|
#
|
95
|
-
#
|
28
|
+
# To define your own conventions and directives, see the RDX::Specification.
|
29
|
+
#
|
30
|
+
# To discover how RDX interacts with +RDoc+ (and the new features brought) see ::RDoc.
|
31
|
+
#
|
32
|
+
# RDX relies also on the +Minitest+'s assertions: RDX::Assertion shapes these ones to RDX's needs,
|
33
|
+
# defining some new assertions.
|
34
|
+
#
|
35
|
+
# If you want to know the available command line options, see RDX::Options.
|
36
|
+
#
|
37
|
+
# If you want to run RDX through +rake+, see RDX::Task.
|
38
|
+
#
|
39
|
+
# To enhance text processing the RDX::Text module provides new useful functions,
|
40
|
+
# while RDX::RubyLex allows to process Ruby code.
|
41
|
+
#
|
42
|
+
# To dig into RDX's internals and discover how RDX organizes the data obtained
|
43
|
+
# parsing the files see the RDX::CodeObject class and its descendants.
|
96
44
|
#
|
97
|
-
# The role of other classes is explained in these sections.
|
45
|
+
# The role of other classes is eventually explained in these sections.
|
98
46
|
#
|
99
47
|
# == Credits
|
100
48
|
#
|
101
|
-
# I have
|
102
|
-
# I think this is the best way I have to thank Yukihiro "Matz" Matsumoto
|
103
|
-
# for the
|
49
|
+
# I have designed RDX and I am developing it. <br>
|
50
|
+
# I think this is the best way I have to thank first Yukihiro "Matz" Matsumoto,
|
51
|
+
# for the beautiful language he has developed, and then the Ruby Community for all the work done.
|
104
52
|
#
|
105
53
|
# Maurizio Destefanis
|
106
54
|
#
|
@@ -114,6 +62,8 @@ module RDX
|
|
114
62
|
|
115
63
|
ROOT = File.dirname(__FILE__).freeze
|
116
64
|
|
65
|
+
BIN_PATH = File.join(File.dirname(ROOT),'bin','rdx').freeze
|
66
|
+
|
117
67
|
require 'rdx/version'
|
118
68
|
|
119
69
|
VERSION_HEADER = "RDX version: #{VERSION}".freeze
|