rundoc 1.1.3 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check_changelog.yml +16 -7
  3. data/.github/workflows/ci.yml +48 -0
  4. data/.standard.yml +6 -0
  5. data/CHANGELOG.md +12 -0
  6. data/Gemfile +1 -1
  7. data/README.md +98 -5
  8. data/Rakefile +9 -10
  9. data/lib/rundoc/cli.rb +15 -17
  10. data/lib/rundoc/code_command/background/log/clear.rb +1 -1
  11. data/lib/rundoc/code_command/background/log/read.rb +1 -1
  12. data/lib/rundoc/code_command/background/process_spawn.rb +8 -9
  13. data/lib/rundoc/code_command/background/start.rb +7 -7
  14. data/lib/rundoc/code_command/background/stop.rb +1 -1
  15. data/lib/rundoc/code_command/background/wait.rb +2 -2
  16. data/lib/rundoc/code_command/background.rb +6 -6
  17. data/lib/rundoc/code_command/bash/cd.rb +6 -7
  18. data/lib/rundoc/code_command/bash.rb +10 -12
  19. data/lib/rundoc/code_command/file_command/append.rb +12 -16
  20. data/lib/rundoc/code_command/file_command/remove.rb +6 -9
  21. data/lib/rundoc/code_command/no_such_command.rb +0 -1
  22. data/lib/rundoc/code_command/pipe.rb +2 -5
  23. data/lib/rundoc/code_command/print/erb.rb +48 -0
  24. data/lib/rundoc/code_command/print/text.rb +33 -0
  25. data/lib/rundoc/code_command/raw.rb +1 -1
  26. data/lib/rundoc/code_command/rundoc/depend_on.rb +0 -1
  27. data/lib/rundoc/code_command/rundoc/require.rb +2 -3
  28. data/lib/rundoc/code_command/rundoc_command.rb +3 -4
  29. data/lib/rundoc/code_command/website/driver.rb +17 -17
  30. data/lib/rundoc/code_command/website/navigate.rb +2 -2
  31. data/lib/rundoc/code_command/website/screenshot.rb +1 -1
  32. data/lib/rundoc/code_command/website/visit.rb +4 -5
  33. data/lib/rundoc/code_command/website.rb +4 -4
  34. data/lib/rundoc/code_command/write.rb +10 -11
  35. data/lib/rundoc/code_command.rb +28 -17
  36. data/lib/rundoc/code_section.rb +42 -25
  37. data/lib/rundoc/parser.rb +17 -19
  38. data/lib/rundoc/peg_parser.rb +57 -59
  39. data/lib/rundoc/version.rb +1 -1
  40. data/lib/rundoc.rb +10 -14
  41. data/rundoc.gemspec +19 -21
  42. data/test/fixtures/rails_4/rundoc.md +92 -30
  43. data/test/fixtures/rails_5/rundoc.md +69 -10
  44. data/test/fixtures/rails_6/rundoc.md +226 -165
  45. data/test/fixtures/rails_7/rundoc.md +477 -0
  46. data/test/integration/print_test.rb +194 -0
  47. data/test/rundoc/code_commands/append_file_test.rb +5 -8
  48. data/test/rundoc/code_commands/background_test.rb +3 -6
  49. data/test/rundoc/code_commands/bash_test.rb +7 -9
  50. data/test/rundoc/code_commands/pipe_test.rb +9 -9
  51. data/test/rundoc/code_commands/print_test.rb +94 -0
  52. data/test/rundoc/code_commands/remove_contents_test.rb +4 -5
  53. data/test/rundoc/code_section_test.rb +50 -56
  54. data/test/rundoc/parser_test.rb +28 -61
  55. data/test/rundoc/peg_parser_test.rb +49 -53
  56. data/test/rundoc/regex_test.rb +141 -126
  57. data/test/rundoc/test_parse_java.rb +1 -3
  58. data/test/test_helper.rb +4 -6
  59. metadata +39 -42
  60. data/.travis.yml +0 -8
  61. data/lib/rundoc/code_command/repl.rb +0 -37
data/test/test_helper.rb CHANGED
@@ -1,13 +1,11 @@
1
- require 'bundler'
1
+ require "bundler"
2
2
 
3
3
  Bundler.require
4
4
 
5
-
6
- require 'rundoc'
5
+ require "rundoc"
7
6
  require "minitest/autorun"
8
- require "mocha/setup"
9
- require 'tmpdir'
10
-
7
+ require "mocha/minitest"
8
+ require "tmpdir"
11
9
 
12
10
  def assert_tests_run
13
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rundoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 2.0.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: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2024-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -25,61 +25,61 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: repl_runner
28
+ name: parslet
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: parslet
42
+ name: capybara
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1'
47
+ version: '3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
- name: capybara
56
+ name: selenium-webdriver
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3'
61
+ version: '4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3'
68
+ version: '4'
69
69
  - !ruby/object:Gem::Dependency
70
- name: selenium-webdriver
70
+ name: base64
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3'
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: aws-sdk-s3
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: standard
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  description: RunDOC turns docs to runable code
154
168
  email:
155
169
  - richard.schneeman+rubygems@gmail.com
@@ -159,8 +173,9 @@ extensions: []
159
173
  extra_rdoc_files: []
160
174
  files:
161
175
  - ".github/workflows/check_changelog.yml"
176
+ - ".github/workflows/ci.yml"
162
177
  - ".gitignore"
163
- - ".travis.yml"
178
+ - ".standard.yml"
164
179
  - CHANGELOG.md
165
180
  - Dockerfile
166
181
  - Gemfile
@@ -183,8 +198,9 @@ files:
183
198
  - lib/rundoc/code_command/file_command/remove.rb
184
199
  - lib/rundoc/code_command/no_such_command.rb
185
200
  - lib/rundoc/code_command/pipe.rb
201
+ - lib/rundoc/code_command/print/erb.rb
202
+ - lib/rundoc/code_command/print/text.rb
186
203
  - lib/rundoc/code_command/raw.rb
187
- - lib/rundoc/code_command/repl.rb
188
204
  - lib/rundoc/code_command/rundoc/depend_on.rb
189
205
  - lib/rundoc/code_command/rundoc/require.rb
190
206
  - lib/rundoc/code_command/rundoc_command.rb
@@ -207,13 +223,16 @@ files:
207
223
  - test/fixtures/rails_4/rundoc.md
208
224
  - test/fixtures/rails_5/rundoc.md
209
225
  - test/fixtures/rails_6/rundoc.md
226
+ - test/fixtures/rails_7/rundoc.md
210
227
  - test/fixtures/require/dependency/rundoc.md
211
228
  - test/fixtures/require/main/rundoc.md
212
229
  - test/fixtures/screenshot/rundoc.md
230
+ - test/integration/print_test.rb
213
231
  - test/rundoc/code_commands/append_file_test.rb
214
232
  - test/rundoc/code_commands/background_test.rb
215
233
  - test/rundoc/code_commands/bash_test.rb
216
234
  - test/rundoc/code_commands/pipe_test.rb
235
+ - test/rundoc/code_commands/print_test.rb
217
236
  - test/rundoc/code_commands/remove_contents_test.rb
218
237
  - test/rundoc/code_section_test.rb
219
238
  - test/rundoc/parser_test.rb
@@ -240,30 +259,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
259
  - !ruby/object:Gem::Version
241
260
  version: '0'
242
261
  requirements: []
243
- rubygems_version: 3.0.3
262
+ rubygems_version: 3.5.9
244
263
  signing_key:
245
264
  specification_version: 4
246
265
  summary: RunDOC generates runable code from docs
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
252
- - test/fixtures/play/source.md
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
259
- - test/rundoc/code_commands/append_file_test.rb
260
- - test/rundoc/code_commands/background_test.rb
261
- - test/rundoc/code_commands/bash_test.rb
262
- - test/rundoc/code_commands/pipe_test.rb
263
- - test/rundoc/code_commands/remove_contents_test.rb
264
- - test/rundoc/code_section_test.rb
265
- - test/rundoc/parser_test.rb
266
- - test/rundoc/peg_parser_test.rb
267
- - test/rundoc/regex_test.rb
268
- - test/rundoc/test_parse_java.rb
269
- - test/test_helper.rb
266
+ test_files: []
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4
4
-
5
- sudo: false
6
-
7
- script: bundle exec rake test
8
-
@@ -1,37 +0,0 @@
1
- require 'repl_runner'
2
-
3
- module Rundoc
4
- class CodeCommand
5
- class Repl < Rundoc::CodeCommand
6
- def initialize(command)
7
- @command = command
8
- @contents = ""
9
- end
10
-
11
- def keyword=(keyword)
12
- @keyword = keyword
13
- if keyword.to_s == "repl"
14
- command_array = @command.split(" ")
15
- @keyword = command_array.first
16
- else
17
- @command = "#{keyword} #{@command}"
18
- end
19
- end
20
-
21
- def call(env = {})
22
- puts "Running '#{@command}'' with repl: #{keyword}"
23
- repl = ReplRunner.new(:"#{keyword}", @command)
24
- @result = repl.zip(contents.strip).flatten.join("\n")
25
- return @result
26
- end
27
-
28
- def to_md(env = {})
29
- return "$ #{@command}"
30
- end
31
- end
32
- end
33
- end
34
-
35
-
36
- Rundoc.register_code_command(:repl, Rundoc::CodeCommand::Repl)
37
- Rundoc.register_code_command(:irb, Rundoc::CodeCommand::Repl)