Skip to content

Commit

Permalink
Add latest oba-gtfs-modules docs
Browse files Browse the repository at this point in the history
And remove the old maven site docs at Leonard E's request
  • Loading branch information
aaronbrethorst committed Jan 2, 2025
1 parent dd258ec commit 9c7d05f
Show file tree
Hide file tree
Showing 64 changed files with 1,151 additions and 3,939 deletions.
77 changes: 40 additions & 37 deletions bin/update_javadocs
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,48 @@
require 'tmpdir'

MODULES = {
"onebusaway-gtfs-modules" => (->{ build_gtfs_modules })
# "onebusaway-gtfs-modules" => (->{ build_gtfs_modules })
}

def build_gtfs_modules
repo_url = 'https://github.com/OneBusAway/onebusaway-gtfs-modules.git'
temp_dir = Dir.mktmpdir

begin
# Clone the repository into the temporary directory
system("git clone --single-branch --branch gh-pages #{repo_url} #{temp_dir}")

if $?.success?
puts "Repository cloned into temporary directory: #{temp_dir}"
else
puts "Failed to clone repository."
exit
end

archive_path = Dir.chdir(temp_dir) do |path|
archive_command = "git archive --format=zip -o gh-pages.zip HEAD"
system(archive_command)

archive_path = File.join(temp_dir, 'gh-pages.zip')

if $?.success?
puts "Archive created successfully: #{archive_path}"
else
puts "Failed to create archive."
exit
end
archive_path
end

system("unzip -o #{archive_path} -d ./src/modules/onebusaway-gtfs-modules/current")
ensure
# Clean up the temporary directory
FileUtils.remove_entry(temp_dir)
end
end
# n.b. January 2025 - this repo is no longer generating docs via Maven, but it's kept
# here as an example of how to clone a repo and extract a specific directory from it.

# def build_gtfs_modules
# repo_url = 'https://github.com/OneBusAway/onebusaway-gtfs-modules.git'
# temp_dir = Dir.mktmpdir

# begin
# # Clone the repository into the temporary directory
# system("git clone --single-branch --branch gh-pages #{repo_url} #{temp_dir}")

# if $?.success?
# puts "Repository cloned into temporary directory: #{temp_dir}"
# else
# puts "Failed to clone repository."
# exit
# end

# archive_path = Dir.chdir(temp_dir) do |path|
# archive_command = "git archive --format=zip -o gh-pages.zip HEAD"
# system(archive_command)

# archive_path = File.join(temp_dir, 'gh-pages.zip')

# if $?.success?
# puts "Archive created successfully: #{archive_path}"
# else
# puts "Failed to create archive."
# exit
# end
# archive_path
# end

# system("unzip -o #{archive_path} -d ./src/modules/onebusaway-gtfs-modules/current")
# ensure
# # Clean up the temporary directory
# FileUtils.remove_entry(temp_dir)
# end
# end

mod = ARGV[0]&.strip
lam = MODULES[mod]
Expand Down
4 changes: 2 additions & 2 deletions src/_partials/_navbar.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
)) %>

<%= render(NavigationSection.new(
"Javadocs",
"Projects",
children: {
"onebusaway-gtfs-modules" => '/modules/onebusaway-gtfs-modules/current/'
"onebusaway-gtfs-modules" => '/projects/onebusaway-gtfs-modules'
},
current_path: resource.relative_url
)) %>
Expand Down
116 changes: 0 additions & 116 deletions src/modules/onebusaway-gtfs-modules/current/ci-management.html

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions src/modules/onebusaway-gtfs-modules/current/css/print.css

This file was deleted.

1 change: 0 additions & 1 deletion src/modules/onebusaway-gtfs-modules/current/css/site.css

This file was deleted.

Loading

0 comments on commit 9c7d05f

Please sign in to comment.