-
Notifications
You must be signed in to change notification settings - Fork 9
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
Rubocop fixes #23
Rubocop fixes #23
Conversation
@szemek FYI I started working on this. |
@janosrusiczki I added few commits and reduced amount of offences to 4. |
@szemek and now for the hard part 😄 |
@janosrusiczki what do you think about following refactoring for def render(context)
site = context.registers[:site]
config = site.config.fetch('asset_pipeline', {})
# Run Jekyll Asset Pipeline
pipeline, cached = run_pipeline(site, config)
return nil unless pipeline.is_a?(Pipeline)
# Prevent Jekyll from cleaning up saved assets if new pipeline
preserve_assets(site, config, pipeline) unless cached
# Return HTML tag pointing to asset
pipeline.html
end
private
def run_pipeline(site, config)
Pipeline.run(nodelist.first, @markup.strip, site.source, site.dest,
self.class.tag_name, self.class.output_type, config)
end
def preserve_assets(site, config, pipeline)
pipeline.assets.each do |asset|
config = JAPR::DEFAULTS.merge(config)
staging_path = File.expand_path(File.join(site.source,
config['staging_path']))
site.static_files << Jekyll::StaticFile.new(site, staging_path,
asset.output_path,
asset.filename)
end
end |
@szemek It looks good. Let's go ahead and make the change. I got stuck yesterday evening by updating the rake dependency to 12.0 which gives |
Changes Unknown when pulling 17aaf1e on rubocop-fixes into ** on master**. |
Changes Unknown when pulling 6621747 on rubocop-fixes into ** on master**. |
@szemek I'm back after a little sick time. 🤧 Fixed one ABC complexity issue, but now the class is too long. I'm not sure I can fix the last two issues (besides the class length). I will try to fix the Codeclimate issues in the meantime. I have the ambition to have these passing before I build a new gem version. 😄 Edit: Removed the ClassLength cop, deactivated complexity check on Codeclimate. Two issues remain to fix. |
Changes Unknown when pulling 9999d6b on rubocop-fixes into ** on master**. |
Changes Unknown when pulling c795956 on rubocop-fixes into ** on master**. |
Changes Unknown when pulling ba20720 on rubocop-fixes into ** on master**. |
@szemek It looks like I made it, please have a look and give me the green if it's mergeable. |
Changes Unknown when pulling b5f6f34 on rubocop-fixes into ** on master**. |
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.
Looks good to me 👍
Fix Rubocop errors / offenses.