-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from railsbump/feature/rails-compatibility-pa…
…ge-per-gem-and-rails-release New Rails Compatibility Page
- Loading branch information
Showing
15 changed files
with
165 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
body.rails_releases { | ||
h2 { | ||
font-size: 1em; | ||
} | ||
section.checking { | ||
color: $yellow; | ||
} | ||
|
||
section.incompatible { | ||
color: $red; | ||
} | ||
|
||
section.compatible { | ||
color: $green; | ||
} | ||
|
||
section.more { | ||
margin-top: 8px; | ||
} | ||
|
||
section.details { | ||
margin-top: 2em; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ table.compat-table { | |
color: $green; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RailsReleasesController < ApplicationController | ||
def show | ||
@gemmy = Gemmy.find_by!(name: params[:gemmy_id]) | ||
@rails_release = RailsRelease.find_by!(version: params[:id].gsub("rails-", "").gsub("-", ".")) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# app/controllers/sitemaps_controller.rb | ||
class SitemapsController < ApplicationController | ||
require "open-uri" | ||
|
||
def show | ||
sitemap_url = ENV["FOG_URL"] | ||
if sitemap_url.present? | ||
sitemap_content = URI.open("#{sitemap_url}/sitemap.xml").read | ||
send_data sitemap_content, type: "application/xml", disposition: "inline" | ||
else | ||
head :not_found | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module LockfilesHelper | ||
def head_title | ||
if @lockfile | ||
"Compatibility for Gemfile.lock##{@lockfile.slug}" | ||
else | ||
super | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module RailsReleasesHelper | ||
def head_title | ||
if @gemmy | ||
if @rails_release | ||
"#{@gemmy} gem: Compatibility with #{@rails_release}" | ||
else | ||
rails_releases = RailsRelease.order(:version) | ||
first_version = rails_releases.first.version | ||
last_version = rails_releases.last.version | ||
"#{@gemmy} gem: Compatibility with Rails #{first_version} to #{last_version}" | ||
end | ||
else | ||
super | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
%html | ||
%head | ||
%title | ||
RailsBump | ||
= head_title | ||
|
||
= csrf_meta_tags | ||
= csp_meta_tag | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
%section | ||
|
||
%h1 | ||
Gem | ||
= @gemmy.name | ||
|
||
%p | ||
Indexed versions: | ||
= @gemmy.versions.size | ||
- if @gemmy.versions.any? | ||
= surround "(", ")" do | ||
= [@gemmy.versions.first, (@gemmy.versions.last if @gemmy.versions.many?)].compact.join(" ... ") | ||
• | ||
= link_to "Show on RubyGems.org", "https://rubygems.org/gems/#{@gemmy.name}", target: "_blank" | ||
|
||
%h2 | ||
= "Compatibility with Rails: #{@rails_release.version}:" | ||
|
||
- compats = @gemmy.compats | ||
- rails_release_compats = compats.merge(@rails_release.compats) | ||
- status = compats_status(rails_release_compats) | ||
- label, text = compats_label_and_text(rails_release_compats, @gemmy, @rails_release) | ||
|
||
%section{ class: status } | ||
= render "shared/compat_cell", status: status, label: label, text: text | ||
|
||
%section.more | ||
= link_to "Show compatibility with other Rails versions", gemmy_path(@gemmy) | ||
|
||
%section.details | ||
%h3 | ||
Gem Details | ||
%p= "This section describes the dependencies associated with each version of the #{@gemmy} gem. ❤️" | ||
%table.compat-table.table.table-striped | ||
%thead | ||
%tr | ||
%th= "#{@gemmy} version" | ||
%th Dependencies | ||
%tbody | ||
- @gemmy.dependencies_and_versions.sort_by { |k, v| v }.each do |dependencies, version| | ||
%tr | ||
%td= version | ||
%td= dependencies | ||
|
||
%section.details | ||
%h3 | ||
Compatibility Details | ||
%p | ||
This section is meant to be used for debugging compatibility issues. If you see anything that is unexpected, please share this page with the maintainers. ❤️ | ||
%table.compat-table.table.table-striped | ||
%thead | ||
%tr | ||
%th Status Determined By | ||
%th Status | ||
%th Checked At | ||
%th Dependencies | ||
%tbody | ||
- compats.each do |compat| | ||
%tr | ||
%td= compat.status_determined_by | ||
%td= compat.status | ||
%td= compat.checked_at | ||
%td= compat.dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
%span{ data: { bs_toggle: "tooltip", bs_placement: "bottom", bs_title: text } } | ||
- case status | ||
- when :checking | ||
%i.fas.fa-spinner.fa-pulse | ||
- when :compatible | ||
%i.far.fa-thumbs-up | ||
- else | ||
%i.far.fa-thumbs-down | ||
= label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters