rundoc 0.0.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/check_changelog.yml +13 -0
- data/.gitignore +9 -0
- data/.travis.yml +8 -0
- data/CHANGELOG.md +22 -0
- data/Dockerfile +24 -0
- data/Gemfile +1 -0
- data/README.md +276 -74
- data/bin/rundoc +4 -52
- data/lib/rundoc.rb +15 -1
- data/lib/rundoc/cli.rb +84 -0
- data/lib/rundoc/code_command.rb +25 -6
- data/lib/rundoc/code_command/background.rb +9 -0
- data/lib/rundoc/code_command/background/log/clear.rb +17 -0
- data/lib/rundoc/code_command/background/log/read.rb +16 -0
- data/lib/rundoc/code_command/background/process_spawn.rb +96 -0
- data/lib/rundoc/code_command/background/start.rb +38 -0
- data/lib/rundoc/code_command/background/stop.rb +17 -0
- data/lib/rundoc/code_command/background/wait.rb +19 -0
- data/lib/rundoc/code_command/bash.rb +1 -1
- data/lib/rundoc/code_command/bash/cd.rb +21 -3
- data/lib/rundoc/code_command/file_command/append.rb +16 -11
- data/lib/rundoc/code_command/file_command/remove.rb +6 -5
- data/lib/rundoc/code_command/no_such_command.rb +4 -0
- data/lib/rundoc/code_command/pipe.rb +18 -5
- data/lib/rundoc/code_command/raw.rb +18 -0
- data/lib/rundoc/code_command/rundoc/depend_on.rb +37 -0
- data/lib/rundoc/code_command/rundoc/require.rb +41 -0
- data/lib/rundoc/code_command/rundoc_command.rb +6 -2
- data/lib/rundoc/code_command/website.rb +7 -0
- data/lib/rundoc/code_command/website/driver.rb +111 -0
- data/lib/rundoc/code_command/website/navigate.rb +29 -0
- data/lib/rundoc/code_command/website/screenshot.rb +28 -0
- data/lib/rundoc/code_command/website/visit.rb +47 -0
- data/lib/rundoc/code_command/write.rb +22 -7
- data/lib/rundoc/code_section.rb +41 -66
- data/lib/rundoc/parser.rb +5 -4
- data/lib/rundoc/peg_parser.rb +282 -0
- data/lib/rundoc/version.rb +2 -2
- data/rundoc.gemspec +9 -3
- data/test/fixtures/build_logs/rundoc.md +56 -0
- data/test/fixtures/depend_on/dependency/rundoc.md +5 -0
- data/test/fixtures/depend_on/main/rundoc.md +10 -0
- data/test/fixtures/java/rundoc.md +9 -0
- data/test/fixtures/rails_4/rundoc.md +151 -188
- data/test/fixtures/rails_5/rundoc.md +445 -0
- data/test/fixtures/rails_6/rundoc.md +451 -0
- data/test/fixtures/require/dependency/rundoc.md +5 -0
- data/test/fixtures/require/main/rundoc.md +10 -0
- data/test/fixtures/screenshot/rundoc.md +10 -0
- data/test/rundoc/code_commands/append_file_test.rb +33 -6
- data/test/rundoc/code_commands/background_test.rb +69 -0
- data/test/rundoc/code_commands/bash_test.rb +1 -1
- data/test/rundoc/code_commands/pipe_test.rb +1 -1
- data/test/rundoc/code_commands/remove_contents_test.rb +3 -4
- data/test/rundoc/code_section_test.rb +95 -2
- data/test/rundoc/parser_test.rb +7 -13
- data/test/rundoc/peg_parser_test.rb +381 -0
- data/test/rundoc/regex_test.rb +6 -6
- data/test/rundoc/test_parse_java.rb +1 -1
- data/test/test_helper.rb +1 -3
- metadata +143 -18
- data/Gemfile.lock +0 -38
data/test/rundoc/regex_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class RegexTest < Test
|
3
|
+
class RegexTest < Minitest::Test
|
4
4
|
|
5
5
|
def setup
|
6
6
|
end
|
@@ -100,13 +100,13 @@ RUBY
|
|
100
100
|
foo
|
101
101
|
|
102
102
|
```
|
103
|
-
|
103
|
+
:::>$ mkdir
|
104
104
|
```
|
105
105
|
|
106
106
|
zoo
|
107
107
|
|
108
108
|
```
|
109
|
-
|
109
|
+
:::>$ cd ..
|
110
110
|
something
|
111
111
|
```
|
112
112
|
|
@@ -117,8 +117,8 @@ RUBY
|
|
117
117
|
|
118
118
|
actual = contents.partition(regex)
|
119
119
|
expected = ["foo\n\n",
|
120
|
-
"```\n
|
121
|
-
"\nzoo\n\n```\n
|
120
|
+
"```\n:::>$ mkdir\n```\n",
|
121
|
+
"\nzoo\n\n```\n:::>$ cd ..\nsomething\n```\n\nbar\n"]
|
122
122
|
|
123
123
|
assert_equal expected, actual
|
124
124
|
|
@@ -137,7 +137,7 @@ RUBY
|
|
137
137
|
|
138
138
|
contents = <<-RUBY
|
139
139
|
```java
|
140
|
-
|
140
|
+
:::>> write app/controllers/Application.java
|
141
141
|
package controllers;
|
142
142
|
|
143
143
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,72 +1,156 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rundoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: repl_runner
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: parslet
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: capybara
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: selenium-webdriver
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: aws-sdk-s3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: dotenv
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
39
109
|
- !ruby/object:Gem::Version
|
40
110
|
version: '0'
|
41
111
|
- !ruby/object:Gem::Dependency
|
42
112
|
name: rake
|
43
113
|
requirement: !ruby/object:Gem::Requirement
|
44
114
|
requirements:
|
45
|
-
- -
|
115
|
+
- - ">="
|
46
116
|
- !ruby/object:Gem::Version
|
47
117
|
version: '0'
|
48
118
|
type: :development
|
49
119
|
prerelease: false
|
50
120
|
version_requirements: !ruby/object:Gem::Requirement
|
51
121
|
requirements:
|
52
|
-
- -
|
122
|
+
- - ">="
|
53
123
|
- !ruby/object:Gem::Version
|
54
124
|
version: '0'
|
55
125
|
- !ruby/object:Gem::Dependency
|
56
126
|
name: mocha
|
57
127
|
requirement: !ruby/object:Gem::Requirement
|
58
128
|
requirements:
|
59
|
-
- -
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: minitest
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
60
144
|
- !ruby/object:Gem::Version
|
61
145
|
version: '0'
|
62
146
|
type: :development
|
63
147
|
prerelease: false
|
64
148
|
version_requirements: !ruby/object:Gem::Requirement
|
65
149
|
requirements:
|
66
|
-
- -
|
150
|
+
- - ">="
|
67
151
|
- !ruby/object:Gem::Version
|
68
152
|
version: '0'
|
69
|
-
description:
|
153
|
+
description: RunDOC turns docs to runable code
|
70
154
|
email:
|
71
155
|
- richard.schneeman+rubygems@gmail.com
|
72
156
|
executables:
|
@@ -74,35 +158,66 @@ executables:
|
|
74
158
|
extensions: []
|
75
159
|
extra_rdoc_files: []
|
76
160
|
files:
|
77
|
-
- .
|
161
|
+
- ".github/workflows/check_changelog.yml"
|
162
|
+
- ".gitignore"
|
163
|
+
- ".travis.yml"
|
164
|
+
- CHANGELOG.md
|
165
|
+
- Dockerfile
|
78
166
|
- Gemfile
|
79
|
-
- Gemfile.lock
|
80
167
|
- README.md
|
81
168
|
- Rakefile
|
82
169
|
- bin/rundoc
|
83
170
|
- lib/rundoc.rb
|
171
|
+
- lib/rundoc/cli.rb
|
84
172
|
- lib/rundoc/code_command.rb
|
173
|
+
- lib/rundoc/code_command/background.rb
|
174
|
+
- lib/rundoc/code_command/background/log/clear.rb
|
175
|
+
- lib/rundoc/code_command/background/log/read.rb
|
176
|
+
- lib/rundoc/code_command/background/process_spawn.rb
|
177
|
+
- lib/rundoc/code_command/background/start.rb
|
178
|
+
- lib/rundoc/code_command/background/stop.rb
|
179
|
+
- lib/rundoc/code_command/background/wait.rb
|
85
180
|
- lib/rundoc/code_command/bash.rb
|
86
181
|
- lib/rundoc/code_command/bash/cd.rb
|
87
182
|
- lib/rundoc/code_command/file_command/append.rb
|
88
183
|
- lib/rundoc/code_command/file_command/remove.rb
|
89
184
|
- lib/rundoc/code_command/no_such_command.rb
|
90
185
|
- lib/rundoc/code_command/pipe.rb
|
186
|
+
- lib/rundoc/code_command/raw.rb
|
91
187
|
- lib/rundoc/code_command/repl.rb
|
188
|
+
- lib/rundoc/code_command/rundoc/depend_on.rb
|
189
|
+
- lib/rundoc/code_command/rundoc/require.rb
|
92
190
|
- lib/rundoc/code_command/rundoc_command.rb
|
191
|
+
- lib/rundoc/code_command/website.rb
|
192
|
+
- lib/rundoc/code_command/website/driver.rb
|
193
|
+
- lib/rundoc/code_command/website/navigate.rb
|
194
|
+
- lib/rundoc/code_command/website/screenshot.rb
|
195
|
+
- lib/rundoc/code_command/website/visit.rb
|
93
196
|
- lib/rundoc/code_command/write.rb
|
94
197
|
- lib/rundoc/code_section.rb
|
95
198
|
- lib/rundoc/parser.rb
|
199
|
+
- lib/rundoc/peg_parser.rb
|
96
200
|
- lib/rundoc/version.rb
|
97
201
|
- rundoc.gemspec
|
202
|
+
- test/fixtures/build_logs/rundoc.md
|
203
|
+
- test/fixtures/depend_on/dependency/rundoc.md
|
204
|
+
- test/fixtures/depend_on/main/rundoc.md
|
205
|
+
- test/fixtures/java/rundoc.md
|
98
206
|
- test/fixtures/play/source.md
|
99
207
|
- test/fixtures/rails_4/rundoc.md
|
208
|
+
- test/fixtures/rails_5/rundoc.md
|
209
|
+
- test/fixtures/rails_6/rundoc.md
|
210
|
+
- test/fixtures/require/dependency/rundoc.md
|
211
|
+
- test/fixtures/require/main/rundoc.md
|
212
|
+
- test/fixtures/screenshot/rundoc.md
|
100
213
|
- test/rundoc/code_commands/append_file_test.rb
|
214
|
+
- test/rundoc/code_commands/background_test.rb
|
101
215
|
- test/rundoc/code_commands/bash_test.rb
|
102
216
|
- test/rundoc/code_commands/pipe_test.rb
|
103
217
|
- test/rundoc/code_commands/remove_contents_test.rb
|
104
218
|
- test/rundoc/code_section_test.rb
|
105
219
|
- test/rundoc/parser_test.rb
|
220
|
+
- test/rundoc/peg_parser_test.rb
|
106
221
|
- test/rundoc/regex_test.rb
|
107
222
|
- test/rundoc/test_parse_java.rb
|
108
223
|
- test/test_helper.rb
|
@@ -116,29 +231,39 @@ require_paths:
|
|
116
231
|
- lib
|
117
232
|
required_ruby_version: !ruby/object:Gem::Requirement
|
118
233
|
requirements:
|
119
|
-
- -
|
234
|
+
- - ">="
|
120
235
|
- !ruby/object:Gem::Version
|
121
236
|
version: '0'
|
122
237
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
238
|
requirements:
|
124
|
-
- -
|
239
|
+
- - ">="
|
125
240
|
- !ruby/object:Gem::Version
|
126
241
|
version: '0'
|
127
242
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.0.3
|
243
|
+
rubygems_version: 3.1.2
|
130
244
|
signing_key:
|
131
245
|
specification_version: 4
|
132
|
-
summary:
|
246
|
+
summary: RunDOC generates runable code from docs
|
133
247
|
test_files:
|
248
|
+
- test/fixtures/build_logs/rundoc.md
|
249
|
+
- test/fixtures/depend_on/dependency/rundoc.md
|
250
|
+
- test/fixtures/depend_on/main/rundoc.md
|
251
|
+
- test/fixtures/java/rundoc.md
|
134
252
|
- test/fixtures/play/source.md
|
135
253
|
- test/fixtures/rails_4/rundoc.md
|
254
|
+
- test/fixtures/rails_5/rundoc.md
|
255
|
+
- test/fixtures/rails_6/rundoc.md
|
256
|
+
- test/fixtures/require/dependency/rundoc.md
|
257
|
+
- test/fixtures/require/main/rundoc.md
|
258
|
+
- test/fixtures/screenshot/rundoc.md
|
136
259
|
- test/rundoc/code_commands/append_file_test.rb
|
260
|
+
- test/rundoc/code_commands/background_test.rb
|
137
261
|
- test/rundoc/code_commands/bash_test.rb
|
138
262
|
- test/rundoc/code_commands/pipe_test.rb
|
139
263
|
- test/rundoc/code_commands/remove_contents_test.rb
|
140
264
|
- test/rundoc/code_section_test.rb
|
141
265
|
- test/rundoc/parser_test.rb
|
266
|
+
- test/rundoc/peg_parser_test.rb
|
142
267
|
- test/rundoc/regex_test.rb
|
143
268
|
- test/rundoc/test_parse_java.rb
|
144
269
|
- test/test_helper.rb
|
data/Gemfile.lock
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
rundoc (0.0.1)
|
5
|
-
repl_runner
|
6
|
-
thor
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
activesupport (4.0.0)
|
12
|
-
i18n (~> 0.6, >= 0.6.4)
|
13
|
-
minitest (~> 4.2)
|
14
|
-
multi_json (~> 1.3)
|
15
|
-
thread_safe (~> 0.1)
|
16
|
-
tzinfo (~> 0.3.37)
|
17
|
-
atomic (1.1.14)
|
18
|
-
i18n (0.6.5)
|
19
|
-
metaclass (0.0.1)
|
20
|
-
minitest (4.7.5)
|
21
|
-
mocha (0.14.0)
|
22
|
-
metaclass (~> 0.0.1)
|
23
|
-
multi_json (1.8.0)
|
24
|
-
rake (10.1.0)
|
25
|
-
repl_runner (0.0.2)
|
26
|
-
activesupport
|
27
|
-
thor (0.18.1)
|
28
|
-
thread_safe (0.1.3)
|
29
|
-
atomic
|
30
|
-
tzinfo (0.3.37)
|
31
|
-
|
32
|
-
PLATFORMS
|
33
|
-
ruby
|
34
|
-
|
35
|
-
DEPENDENCIES
|
36
|
-
mocha
|
37
|
-
rake
|
38
|
-
rundoc!
|