rundoc 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45657dd48e87b08e841e90a828d026a9248b0c52667824b77eb799c5d2afc6f5
4
- data.tar.gz: 03b6a8b17ba747ae9952398772edf2cbff4b2ac0710a8a52e20055b46aafd657
3
+ metadata.gz: 4ffd4e661f146495e1f5a1c450ab4b053a0c625a980ef877c9d1b77b1061a9a0
4
+ data.tar.gz: e2fa4c55862c6bb84a5aa5c9fd393942a47991ec8b7af6ecfe74a6bcfae91d3f
5
5
  SHA512:
6
- metadata.gz: c717ac8241f4d4b4028c0ecb2e5391705112e00001abee2385af7ece74bcef546064fc09377eec41d0e4aab1323d3c5856cbbac772ca78237681110d9e82d472
7
- data.tar.gz: c7736d871a79f584f7bb6ed9bfa50447ced0a6dd1a923578a0f5d8df28e8b1d36350715f38435959f7de2770112080005b79f7a4cbfdd27a8c87a6b906fe02b2
6
+ metadata.gz: 5ebdd506647124c812344520d0ed85a3c28cfc0443fba6d1436a3605c7b2156f99a9620f58bc56125303aeca3a33eef5bc84a17cc7031d9d86793c498203b492
7
+ data.tar.gz: 1dec5d073813c7b3853ee29b9e6425a74e201eb14adb47c9eb662f17ccc5e1e35644d463e93e80d5bf315e235ff50d9533e9c67ebd43f1041770d6fd154d3f7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## HEAD
2
2
 
3
+ ## 2.0.1
4
+
5
+ - Bugfix: Code blocks without a following newline are now being recognized and executed (https://github.com/zombocom/rundoc/pull/51)
6
+
3
7
  ## 2.0.0
4
8
 
5
9
  - Change: Ruby 2.7 and 3.0 are no longer supported
data/lib/rundoc/parser.rb CHANGED
@@ -2,7 +2,7 @@ module Rundoc
2
2
  class Parser
3
3
  DEFAULT_KEYWORD = ":::"
4
4
  INDENT_BLOCK = '(?<before_indent>(^\s*$\n|\A)(^(?:[ ]{4}|\t))(?<indent_contents>.*)(?<after_indent>[^\s].*$\n?(?:(?:^\s*$\n?)*^(?:[ ]{4}|\t).*[^\s].*$\n?)*))'
5
- GITHUB_BLOCK = '^(?<fence>(?<fence_char>~|`){3,})\s*?(?<lang>\w+)?\s*?\n(?<contents>.*?)^\g<fence>\g<fence_char>*\s*?\n'
5
+ GITHUB_BLOCK = '^(?<fence>(?<fence_char>~|`){3,})\s*?(?<lang>\w+)?\s*?\n(?<contents>.*?)^\g<fence>\g<fence_char>*\s*?\n?'
6
6
  CODEBLOCK_REGEX = /(#{GITHUB_BLOCK})/m
7
7
  COMMAND_REGEX = ->(keyword) {
8
8
  /^#{keyword}(?<tag>(\s|=|-|>)?(=|-|>)?)\s*(?<command>(\S)+)\s+(?<statement>.*)$/
@@ -1,3 +1,3 @@
1
1
  module Rundoc
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -252,13 +252,11 @@ Provision a Postgresql database using Add-ons.
252
252
  >A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, you will be prompted to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
253
253
 
254
254
  ```term
255
- $ heroku addons:create heroku-postgresql:mini
256
- Creating heroku-postgresql:mini on ⬢ shrouded-anchorage-34700... $5/month
257
- Database has been created and is available
258
- ! This database is empty. If upgrading, you can transfer
259
- ! data from another database with pg:copy
260
-
261
- Created postgresql-encircled-75487 as DATABASE_URL
255
+ $ heroku addons:create heroku-postgresql:essential-0
256
+ Creating heroku-postgresql:essential-0 on ⬢ shrouded-anchorage-34700... ~$0.007/hour (max $5/month)
257
+ Database should be available soon
258
+ postgresql-encircled-75487 is being created in the background. The app will restart when complete...
259
+ Use heroku addons:info postgresql-encircled-75487 to check creation progress
262
260
  Use heroku addons:docs heroku-postgresql to view documentation
263
261
  ```
264
262
 
@@ -249,7 +249,7 @@ Provision a Postgresql database using Add-ons.
249
249
  >A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, you will be prompted to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
250
250
 
251
251
  ```term
252
- :::>> $ heroku addons:create heroku-postgresql:mini
252
+ :::>> $ heroku addons:create heroku-postgresql:essential-0
253
253
  ```
254
254
 
255
255
  Your Heroku app now has access to a Postgresql database. The credentials are stored in the `DATABASE_URL` environment variable, which Rails will connect to by convention.
@@ -279,7 +279,7 @@ Provision a [Heroku Postgres](https://devcenter.heroku.com/articles/heroku-postg
279
279
  >A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, we prompt you to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
280
280
 
281
281
  ```term
282
- :::>> $ heroku addons:create heroku-postgresql:mini
282
+ :::>> $ heroku addons:create heroku-postgresql:essential-0
283
283
  ```
284
284
 
285
285
  Your Heroku app can now access this Postgres database. The `DATABASE_URL` environment variable stores your credentials, which Rails connects to by convention.
@@ -315,7 +315,7 @@ To use an interactive shell session instead, you can execute `heroku run bash`.
315
315
 
316
316
  ## Scale and Access the Application
317
317
 
318
- Heroku runs application code using defined processes and [process types](procfile). New applications don't a process type active by default. The following command scales your app up to one dyno, running the `web` process:
318
+ Heroku runs application code using defined processes and [process types](procfile). New applications don't have a process type active by default. The following command scales your app up to one dyno, running the `web` process:
319
319
 
320
320
  ```term
321
321
  :::>- $ heroku ps:scale web=1
@@ -251,7 +251,7 @@ Provision a [Heroku Postgres](https://devcenter.heroku.com/articles/heroku-postg
251
251
  >A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, we prompt you to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
252
252
 
253
253
  ```term
254
- :::>> $ heroku addons:create heroku-postgresql:mini
254
+ :::>> $ heroku addons:create heroku-postgresql:essential-0
255
255
  ```
256
256
 
257
257
  Your Heroku app can now access this Postgres database. The `DATABASE_URL` environment variable stores your credentials, which Rails connects to by convention.
@@ -287,7 +287,7 @@ To use an interactive shell session instead, you can execute `heroku run bash`.
287
287
 
288
288
  ## Scale and Access the Application
289
289
 
290
- Heroku runs application code using defined processes and [process types](procfile). New applications don't a process type active by default. The following command scales your app up to one dyno, running the `web` process:
290
+ Heroku runs application code using defined processes and [process types](procfile). New applications don't have a process type active by default. The following command scales your app up to one dyno, running the `web` process:
291
291
 
292
292
  ```term
293
293
  :::>- $ heroku ps:scale web=1
@@ -190,4 +190,26 @@ class RegexTest < Minitest::Test
190
190
 
191
191
  assert_equal contents.strip, match.to_s.strip
192
192
  end
193
+
194
+ def test_codeblock_optional_newline_regex
195
+ code_block_with_newline = <<~MD
196
+ hi
197
+ ```
198
+ :::>> $ echo "hello"
199
+ ```
200
+ MD
201
+ code_block_without_newline = code_block_with_newline.strip
202
+
203
+ expected = <<~MD.strip
204
+ ```
205
+ :::>> $ echo "hello"
206
+ ```
207
+ MD
208
+ regex = Rundoc::Parser::CODEBLOCK_REGEX
209
+ match = code_block_with_newline.match(regex)
210
+ assert_equal expected, match.to_s.strip
211
+
212
+ match = code_block_without_newline.match(regex)
213
+ assert_equal expected, match.to_s.strip
214
+ end
193
215
  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: 2.0.0
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: 2024-05-09 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
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  - !ruby/object:Gem::Version
260
260
  version: '0'
261
261
  requirements: []
262
- rubygems_version: 3.5.3
262
+ rubygems_version: 3.5.9
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: RunDOC generates runable code from docs