md4c 0.0.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.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Markdown for C, for Ruby
2
+
3
+ This is a [MD4C](https://github.com/mity/md4c) binding for Ruby.
4
+
5
+ ## Installation
6
+
7
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ ```bash
12
+ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
13
+ ```
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ ```bash
18
+ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install
28
+ dependencies. Then, run `rake test` to run the tests. You can also run
29
+ `bin/console` for an interactive prompt that will allow you to
30
+ experiment.
31
+
32
+ To install this gem onto your local machine, run `bundle exec rake
33
+ install`. To release a new version, update the version number in
34
+ `version.rb`, and then run `bundle exec rake release`, which will
35
+ create a git tag for the version, push git commits and the created
36
+ tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+
38
+ ## Contributing
39
+
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/md4c.
41
+
42
+ ## License
43
+
44
+ Copyright (C) 2026 gemmaro
45
+
46
+ This program is free software: you can redistribute it and/or modify
47
+ it under the terms of the GNU General Public License as published by
48
+ the Free Software Foundation, either version 3 of the License, or
49
+ (at your option) any later version.
50
+
51
+ This program is distributed in the hope that it will be useful,
52
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
53
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54
+ GNU General Public License for more details.
55
+
56
+ You should have received a copy of the GNU General Public License
57
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ require "rake/extensiontask"
13
+
14
+ task build: :compile
15
+
16
+ GEMSPEC = Gem::Specification.load("md4c.gemspec")
17
+
18
+ Rake::ExtensionTask.new("md4c", GEMSPEC) do |ext|
19
+ ext.lib_dir = "lib/md4c"
20
+ end
21
+
22
+ task default: %i[clobber compile test]
data/compile_flags.txt ADDED
@@ -0,0 +1,5 @@
1
+ -I/usr/local/include
2
+ -I/usr/local/include/ruby-4.0
3
+ -I/usr/local/include/ruby-4.0/x86_64-openbsd
4
+ -I/usr/local/llvm21/lib/clang/21/include
5
+ -Wall -Wextra
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ #--
4
+ # Copyright (C) 2026 gemmaro
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+ #++
19
+
20
+ require "mkmf"
21
+
22
+ have_library("md4c") or raise "no md4c library found"
23
+ have_func("md_parse", "md4c.h") \
24
+ or raise "no md4c's md_parse function found"
25
+
26
+ have_library("md4c-html") or raise "no md4c-html library found"
27
+ have_func("md_html", "md4c-html.h") \
28
+ or raise "no md4c-html's md_html function found"
29
+
30
+ # Makes all symbols private by default to avoid unintended conflict
31
+ # with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
32
+ # selectively, or entirely remove this flag.
33
+ append_cflags("-fvisibility=hidden")
34
+
35
+ create_makefile("md4c/md4c")