Skip to content
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

Lint use of private access modifier #97

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/jekyll/generators/compile_js.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def generate(site)
end
end

private def add_webmention_types
private

def add_webmention_types
js_types = []
Jekyll::WebmentionIO.types.each do |type|
js_types.push "'#{type}': '#{type.to_singular}'"
Expand All @@ -76,27 +78,27 @@ def generate(site)
@javascript << types_js.sub(/TYPES/, js_types.join(","))
end

private def concatenate_asset_files
def concatenate_asset_files
source = File.expand_path("../assets/", __dir__)
Dir["#{source}/*.js"].each do |file|
handler = File.open(file, "rb")
@javascript << File.read(handler)
end
end

private def uglify
def uglify
uglify_config = {
:harmony => true,
}
@javascript = Uglifier.new(uglify_config).compile(@javascript)
end

private def create_js_file
def create_js_file
Dir.mkdir(@source_file_destination) unless File.exist?(@source_file_destination)
File.open("#{@source_file_destination}/#{@file_name}", "w") { |f| f.write(@javascript) }
end

private def deploy_js_file
def deploy_js_file
js_file = Jekyll::WebmentionIO::JavaScriptFile.new(@site, @source_file_destination, "", @file_name)
@site.static_files << js_file
end
Expand Down