-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Add inline assets option #107
Conversation
views/layout.erb
Outdated
@@ -6,7 +6,6 @@ | |||
<script src='<%= assets_path('application.js') %>' type='text/javascript'></script> | |||
<link href='<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css' /> | |||
<link rel="shortcut icon" type="image/png" href="<%= assets_path("favicon_#{coverage_css_class(result.source_files.covered_percent)}.png") %>" /> | |||
<link rel="icon" type="image/png" href="<%= assets_path('favicon.png') %>" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
favicon.png doesn't exist so this never did anything anyway
bf139b4
to
fb4ff84
Compare
@@ -18,11 +18,15 @@ module Formatter | |||
class HTMLFormatter | |||
def initialize | |||
@branchable_result = SimpleCov.branch_coverage? | |||
@inline_assets = !ENV["SIMPLECOV_INLINE_ASSETS"].nil? | |||
@public_assets_dir = File.join(File.dirname(__FILE__), "../public/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved @public_assets_dir here to fix ABC rubocop complaints
".css" => "text/css", | ||
}[File.extname(name)] | ||
|
||
base64_content = Base64.strict_encode64 File.open(path).read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put a require "base64"
on top of the file? I got a NameError
when I tried to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, sorry i missed this comment
better 3 years late than never I guess?
@frankh Thanks for your work on this. This feature helps me as well. |
Would love to see this merged! Can't view the html reports on buildkite unless they're inlined. |
Any chance of seeing this merged? We have the same issue with Buildkite. |
Is there a reason this is not getting merged in? Would love to see this feature too - same issue with CI as above |
This allows simplecov to generate a single `index.html` file and not have to generate an assets folder
2ade4e7
to
4648225
Compare
@see simplecov-ruby/simplecov-html#107 まだリリースされていないため、コミットハッシュ指定で依存解決するようにした
This allows simplecov to generate a single
index.html
file and not have to generate an assets folder if the env varSIMPLECOV_INLINE_ASSETS
is definedResolves #33
Based on the implementation by @eins78 eins78@939548d