Skip to content

Commit 3453bcd

Browse files
authored
Merge pull request #15 from OpenVoxProject/fix_build
Make documentation build again
2 parents 1364466 + d9b70d1 commit 3453bcd

10 files changed

Lines changed: 53 additions & 27 deletions

File tree

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Build site on PR
3+
4+
on:
5+
pull_request: {}
6+
push:
7+
branches:
8+
- master
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
rake_checks:
15+
name: Rake Checks
16+
runs-on: ubuntu-24.04
17+
steps:
18+
# needs fetch-depth because the packaging dem reads old git tags
19+
- name: Checkout current PR
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install Ruby version 3.3
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: 3.3
27+
bundler-cache: true
28+
- name: Display Ruby environment
29+
run: bundle env
30+
- name: Validate code
31+
run: bundle exec rake generate
32+
env:
33+
DEBUG_PUPPET_DOCS_RAKEFILE: 1

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def jekyll(command = 'build', source = SOURCE_DIR, destination = OUTPUT_DIR, *ar
4343
puts about_verbose_mode
4444

4545
if ENV['DEBUG_PUPPET_DOCS_RAKEFILE']
46-
verbose_mode = '--verbose | tee puppet-docs-build.log'
46+
verbose_mode = '--verbose --trace | tee puppet-docs-build.log'
4747
end
4848

4949
amended_config = "#{SOURCE_DIR}/_config_amended.yml"

config.ru

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ module Rack
3030
return entity_not_found(path_info)
3131
end
3232

33-
def list_path
33+
def list_path(env = @env, path = @path, path_info = @path_info, script_name = @script_name)
34+
@env = env
35+
@path = path
36+
@path_info = path_info
37+
@script_name = script_name
3438
@stat = ::File.stat(@path)
3539

3640
if @stat.readable?
@@ -41,15 +45,15 @@ module Rack
4145
@env['PATH_INFO'] = @env['PATH_INFO'].sub(/\/?$/, '/index.html')
4246
return @app.call(@env)
4347
else
44-
return list_directory
48+
return list_directory(@path_info, @path, @script_name)
4549
end
4650
end
4751
else
4852
raise Errno::ENOENT, 'No such file or directory'
4953
end
5054

5155
rescue Errno::ENOENT, Errno::ELOOP
52-
return entity_not_found
56+
return entity_not_found(@path_info)
5357
end
5458

5559
end

lib/puppet_references.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def self.build_puppet_references(commit)
3737
PuppetReferences::Puppet::Functions
3838
]
3939
config = PuppetReferences::Config.read
40-
repo = PuppetReferences::Repo.new('puppet', PUPPET_DIR, nil, config['puppet']['repo'])
40+
repo = PuppetReferences::Repo.new('openvox', PUPPET_DIR, nil, config['puppet']['repo'])
4141
real_commit = repo.checkout(commit)
4242
repo.update_bundle
4343
build_from_list_of_classes(references, real_commit)

lib/puppet_references/puppet/functions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def build_variant(filename, preferred_version = 'ruby4x')
4444
# BTW, I learned this trick from the Facter reference that the agent team made for us back in the day.
4545
template_binding = OpenStruct.new({ functions: functions }).instance_eval {binding}
4646

47-
body = ERB.new(File.read(TEMPLATE_FILE), nil, '-').result(template_binding)
47+
body = ERB.new(File.read(TEMPLATE_FILE), trim_mode: '-').result(template_binding)
4848
# This substitution could potentially make things a bit brittle, but it has to be done because the jump
4949
# From H2s to H4s is causing issues with the DITA-OT, which sees this as a rule violation. If it
5050
# Does become an issue, we should return to this and figure out a better way to generate the functions doc.

lib/puppet_references/puppet/type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Puppet
88
class Type < PuppetReferences::Reference
99
TYPEDOCS_SCRIPT = PuppetReferences::BASE_DIR + 'lib/puppet_references/quarantine/get_typedocs.rb'
1010
TEMPLATE_FILE = Pathname.new(File.expand_path(__FILE__)).dirname + 'type_template.erb'
11-
TEMPLATE = ERB.new(TEMPLATE_FILE.read, nil, '-')
11+
TEMPLATE = ERB.new(TEMPLATE_FILE.read, trim_mode: '-')
1212
PREAMBLE_FILE = Pathname.new(File.expand_path(__FILE__)).dirname + 'type_preamble.md'
1313
PREAMBLE = PREAMBLE_FILE.read
1414

lib/puppet_references/repo.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(name, directory, sources = nil, config = nil)
1313
if sources
1414
@sources = [sources].flatten
1515
else
16-
@sources = ["git@github.com:puppetlabs/#{@name}.git"]
16+
@sources = ["git@github.com:openvoxproject/#{@name}.git"]
1717
end
1818
@main_source = @sources[0]
1919
unless Dir.exist?(@directory + '.git') || @config['skip_download']
@@ -52,4 +52,4 @@ def update_bundle
5252
end
5353

5454
end
55-
end
55+
end

source/_config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ defaultnav:
3434
# subdirectory: documentation # A subdirectory within the remote repository that contains the documentation files that we'll build and mount at the specified url.
3535
externalsources:
3636
/mcollective:
37-
repo: git@github.com:choria-legacy/marionette-collective.git
37+
repo: https://github.com/choria-legacy/marionette-collective.git
3838
commit: origin/2.12.x
3939
subdirectory: website
4040

@@ -92,7 +92,7 @@ documents:
9292
version: "latest"
9393
nav: ./_puppetdb_nav.html
9494
external_source:
95-
repo: git://github.com/puppetlabs/puppetdb.git
95+
repo: https://github.com/puppetlabs/puppetdb.git
9696
commit: doc-latest
9797
subdirectory: documentation
9898
hide: true
@@ -101,7 +101,7 @@ documents:
101101
version: "7"
102102
nav: ./_puppetdb_nav.html
103103
external_source:
104-
repo: git://github.com/puppetlabs/puppetdb.git
104+
repo: https://github.com/puppetlabs/puppetdb.git
105105
commit: doc-7.y
106106
subdirectory: documentation
107107
hide: true
@@ -110,7 +110,7 @@ documents:
110110
version: "6"
111111
nav: ./_puppetdb_nav.html
112112
external_source:
113-
repo: git://github.com/puppetlabs/puppetdb.git
113+
repo: https://github.com/puppetlabs/puppetdb.git
114114
commit: doc-6.y
115115
subdirectory: documentation
116116
hide: true
@@ -119,7 +119,7 @@ documents:
119119
version: "5.2"
120120
nav: ./_puppetdb_nav.html
121121
external_source:
122-
repo: git://github.com/puppetlabs/puppetdb.git
122+
repo: https://github.com/puppetlabs/puppetdb.git
123123
commit: doc-5.2
124124
subdirectory: documentation
125125
hide: true
@@ -129,7 +129,7 @@ documents:
129129
doc: puppet
130130
version: "latest"
131131
nav: ./_puppet_toc.html
132-
132+
133133
# Puppet 6.y
134134
/puppet/6.y:
135135
doc: puppet

source/_plugins/change_baseurl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def render(context)
2727

2828
(@url, @old_baseurl, @new_baseurl) = @args.map{|arg|
2929
if arg =~ @var_regex
30-
Liquid::Variable.new(arg).render(context)
30+
context[arg]
3131
else
3232
arg.sub(/\A['"]/, '').sub(/['"]\Z/, '')
3333
end

source/facter/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)