Skip to content

Commit da87058

Browse files
RISCfutureclaude
andcommitted
Publish YARD documentation to GitHub Pages
Add a workflow that builds the YARD docs and deploys them to GitHub Pages on every push to master. Wire up YARD itself: yard and redcarpet as development dependencies, plus a :doc Rake task matching the one in validates_im. Trim .document to the Ruby sources it covers. It still listed Jeweler-era paths alongside Markdown and bin/*, all of which YARD merged into its inputs and tried to parse as Ruby. Point the gemspec's documentation_uri at the new Pages site. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 80210be commit da87058

6 files changed

Lines changed: 72 additions & 4 deletions

File tree

.document

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
README.rdoc
21
lib/**/*.rb
3-
bin/*
4-
features/**/*.feature
5-
LICENSE
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
name: Build Documentation
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
- name: Set up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: "4.0"
27+
bundler-cache: true
28+
- name: Build documentation
29+
run: bundle exec rake doc
30+
- name: Upload artifact
31+
uses: actions/upload-pages-artifact@v5
32+
with:
33+
path: ./doc
34+
35+
deploy:
36+
name: Deploy to GitHub Pages
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v5

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
source "https://rubygems.org"
44

55
gemspec
6+
7+
group :development do
8+
gem "redcarpet", require: false
9+
gem "yard", require: false
10+
end

Gemfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ GEM
5555
public_suffix (7.0.5)
5656
rack (3.2.6)
5757
rake (13.4.2)
58+
redcarpet (3.6.1)
5859
rexml (3.4.4)
5960
rspec (3.13.2)
6061
rspec-core (~> 3.13.0)
@@ -77,16 +78,19 @@ GEM
7778
addressable (>= 2.8.0)
7879
crack (>= 0.3.2)
7980
hashdiff (>= 0.4.0, < 2.0.0)
81+
yard (0.9.45)
8082

8183
PLATFORMS
8284
arm64-darwin-25
8385
ruby
8486

8587
DEPENDENCIES
8688
rake (~> 13.0)
89+
redcarpet
8790
rspec (~> 3.13)
8891
url_validation!
8992
webmock (~> 3.0)
93+
yard
9094

9195
CHECKSUMS
9296
activemodel (8.1.3) sha256=90c05cbe4cef3649b8f79f13016191ea94c4525ce4a5c0fb7ef909c4b91c8219
@@ -111,6 +115,7 @@ CHECKSUMS
111115
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
112116
rack (3.2.6) sha256=5ed78e1f73b2e25679bec7d45ee2d4483cc4146eb1be0264fc4d94cb5ef212c2
113117
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
118+
redcarpet (3.6.1) sha256=d444910e6aa55480c6bcdc0cdb057626e8a32c054c29e793fa642ba2f155f445
114119
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
115120
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
116121
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
@@ -122,6 +127,7 @@ CHECKSUMS
122127
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
123128
url_validation (2.0.0)
124129
webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
130+
yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
125131

126132
BUNDLED WITH
127133
4.0.16

Rakefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,19 @@ require "rspec/core/rake_task"
55

66
RSpec::Core::RakeTask.new(:spec)
77

8+
begin
9+
require "yard"
10+
YARD::Rake::YardocTask.new(:doc) do |doc|
11+
doc.options += ["--markup", "markdown"]
12+
doc.options += ["--markup-provider", "redcarpet"]
13+
doc.options += ["--protected", "--no-private"]
14+
doc.options += ["--readme", "README.md"]
15+
doc.options += ["--output-dir", "doc"]
16+
doc.options += ["--title", "url_validation Documentation"]
17+
doc.files = %w[lib/**/*.rb]
18+
end
19+
rescue LoadError
20+
# YARD is optional
21+
end
22+
823
task default: :spec

url_validation.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
1919

2020
spec.metadata = {
2121
"homepage_uri" => spec.homepage,
22+
"documentation_uri" => "https://riscfuture.github.io/url_validation/",
2223
"bug_tracker_uri" => "#{spec.homepage}/issues",
2324
"changelog_uri" => "#{spec.homepage}/blob/master/CHANGELOG.md",
2425
"rubygems_mfa_required" => "true"

0 commit comments

Comments
 (0)