markdown-run 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2e8f65ab44ef28a81d72e8abc661a6f0e2c90a1426024fd6846911f19c2b578
4
- data.tar.gz: 31cf8bef8665311e688abc5f3f74f0d1f1fcd5a5230260c354baeb0406f3a5a3
3
+ metadata.gz: 4d88163df8a4b5204c0cdd4f4d4b236d6bf67ab1515df8ba799ec760ee49838a
4
+ data.tar.gz: e1cf3aa3edd95f6d3d0f818bd58645859043954a9a5eeffda46f453e5beed351
5
5
  SHA512:
6
- metadata.gz: 53c01a92fd506129d65501a83d4ad5f644828499e78632c22ecf0c5a2c2289665453b8807e875f141f205920f6388e219692ff4f2270a66ca908005b0c91f7c3
7
- data.tar.gz: 80aab9de978acc7c80f3c091ee33bad06e483f2aed00f02d42153491db1db2b8ccf440a2ff1b2c174b0c4274272f1c372e5360e9361c4c7736c144fe55f66c80
6
+ metadata.gz: f8de05f11aaf161c9ba30c6de2d28d4ce1a3e2a917e452ce485380523b6c34be4c4d337e764c5bbf9ee160d6559395a6930827615b0c5be4c94707df8b6f4540
7
+ data.tar.gz: 37c23d79f0ea057781bba56b1740b11dad46a95515cafa05aa3222082d0449ae77e7e4d80301c3e1c53e8b90fdb93a4534484656250a7755dcb92fbb9d26082a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2025-05-14
4
+
5
+ - Fix missing minitest dep
6
+
7
+ ## [0.2.0] - 2025-05-14
8
+
9
+ - Gemfile update
10
+
3
11
  ## [0.1.1] - 2025-05-14
4
12
 
5
13
  - Added checks for missing dependencies
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  [![Ruby](https://github.com/aurelienbottazini/markdown-run/actions/workflows/main.yml/badge.svg)](https://github.com/aurelienbottazini/markdown-run/actions/workflows/main.yml)
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/markdown-run.svg)](https://badge.fury.io/rb/markdown-run)
4
+
3
5
  # Markdown-run
4
6
 
5
7
  ## Installation
data/exe/markdown-run CHANGED
@@ -3,6 +3,7 @@
3
3
  require "tempfile"
4
4
  require "open3"
5
5
  require "fileutils"
6
+ require "minitest/spec"
6
7
 
7
8
  # --- Language Execution Configuration ---
8
9
  JS_CONFIG = {
@@ -30,8 +31,7 @@ SUPPORTED_LANGUAGES = {
30
31
  command: ->(code_content, _temp_file_path) {
31
32
  psql_exists = system("command -v psql > /dev/null 2>&1")
32
33
  unless psql_exists
33
- warn "Error: psql command not found. Please install PostgreSQL or ensure psql is in your PATH."
34
- exit 1 # Abort the script
34
+ abort "Error: psql command not found. Please install PostgreSQL or ensure psql is in your PATH."
35
35
  end
36
36
  [ "psql -A -t -X", { stdin_data: code_content } ]
37
37
  }
@@ -40,8 +40,7 @@ SUPPORTED_LANGUAGES = {
40
40
  command: ->(_code_content, temp_file_path) {
41
41
  xmpfilter_exists = system("command -v xmpfilter > /dev/null 2>&1")
42
42
  unless xmpfilter_exists
43
- warn "Error: xmpfilter command not found. Please install xmpfilter or ensure it is in your PATH."
44
- exit 1 # Abort the script
43
+ abort "Error: xmpfilter command not found. Please install xmpfilter or ensure it is in your PATH."
45
44
  end
46
45
  [ "xmpfilter #{temp_file_path}", {} ]
47
46
  },
@@ -67,7 +66,6 @@ if ARGV.empty?
67
66
  end
68
67
 
69
68
  puts "Running tests..."
70
- require "minitest/spec"
71
69
  require "minitest/autorun"
72
70
  end
73
71
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Markdown
4
4
  module Run
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
@@ -0,0 +1,49 @@
1
+ This is an example markdown file
2
+
3
+ The following psql code block should be executed
4
+ And the result should be shown in a following codeblock
5
+
6
+ ```ruby
7
+ p "foo"
8
+ ```
9
+
10
+ ```js
11
+ 1 + 2;
12
+ console.log(3);
13
+ ```
14
+
15
+ ```RESULT
16
+ 3
17
+ ```
18
+
19
+ ```psql
20
+ \d
21
+ ```
22
+
23
+ ```RESULT
24
+ public|ar_internal_metadata|table|aurelienbottazini
25
+ public|schema_migrations|table|aurelienbottazini
26
+ ```
27
+
28
+ ```sqlite3
29
+ .stats
30
+ ```
31
+
32
+ ```RESULT
33
+ Memory Used: 147824 (max 147888) bytes
34
+ Number of Outstanding Allocations: 169 (max 170)
35
+ Number of Pcache Overflow Bytes: 4608 (max 4608) bytes
36
+ Largest Allocation: 122400 bytes
37
+ Largest Pcache Allocation: 4104 bytes
38
+ Lookaside Slots Used: 34 (max 34)
39
+ Successful lookaside attempts: 34
40
+ Lookaside failures due to size: 0
41
+ Lookaside failures due to OOM: 0
42
+ Pager Heap Usage: 5632 bytes
43
+ Page cache hits: 0
44
+ Page cache misses: 0
45
+ Page cache writes: 0
46
+ Page cache spills: 0
47
+ Schema Heap Usage: 0 bytes
48
+ Statement Heap/Lookaside Usage: 0 bytes
49
+ ```
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown-run
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aurélien Bottazini
@@ -24,8 +24,8 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: Run code blocks in Markdown files. Store output in a code block following
28
- the original code block.
27
+ description: Run code blocks in Markdown files for Ruby, JavaScript, sqlite and psql.
28
+ Insert execution results next to the original code blocks.
29
29
  email:
30
30
  - 32635+aurelienbottazini@users.noreply.github.com
31
31
  executables:
@@ -40,6 +40,7 @@ files:
40
40
  - README.md
41
41
  - exe/markdown-run
42
42
  - lib/markdown/run/version.rb
43
+ - markdown-run-sample.md
43
44
  homepage: https://rubygems.org/gems/markdown-run
44
45
  licenses:
45
46
  - MIT