rubocop: Remove unnecessary line breaks
This commit is contained in:
parent
38ce5741c9
commit
ce38dbe3e7
@ -6,68 +6,6 @@
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 7
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLines:
|
||||
Exclude:
|
||||
- '_plugins/autocrossref.rb'
|
||||
- '_plugins/githubify.rb'
|
||||
- '_plugins/inline-template.rb'
|
||||
- '_plugins/liquid-die.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLinesAroundArguments:
|
||||
Exclude:
|
||||
- '_contrib/bco-htmlproof'
|
||||
|
||||
# Offense count: 8
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: empty_lines, no_empty_lines
|
||||
Layout/EmptyLinesAroundBlockBody:
|
||||
Exclude:
|
||||
- '_contrib/comparelinks.rb'
|
||||
- '_plugins/autocrossref.rb'
|
||||
- '_plugins/glossary.rb'
|
||||
- '_plugins/wallets.rb'
|
||||
|
||||
# Offense count: 16
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
|
||||
Layout/EmptyLinesAroundClassBody:
|
||||
Exclude:
|
||||
- '_plugins/autocrossref.rb'
|
||||
- '_plugins/contributors.rb'
|
||||
- '_plugins/events.rb'
|
||||
- '_plugins/githubify.rb'
|
||||
- '_plugins/glossary.rb'
|
||||
- '_plugins/inline-template.rb'
|
||||
- '_plugins/liquid-die.rb'
|
||||
- '_plugins/liquid-warn.rb'
|
||||
- '_plugins/releases.rb'
|
||||
- '_plugins/translate.rb'
|
||||
|
||||
# Offense count: 9
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLinesAroundMethodBody:
|
||||
Exclude:
|
||||
- '_contrib/comparelinks.rb'
|
||||
- '_plugins/contributors.rb'
|
||||
- '_plugins/events.rb'
|
||||
- '_plugins/glossary.rb'
|
||||
- '_plugins/redirects.rb'
|
||||
- '_plugins/releases.rb'
|
||||
- '_plugins/wallets.rb'
|
||||
|
||||
# Offense count: 32
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
|
||||
|
||||
@ -14,7 +14,6 @@ HTML::Proofer.new(
|
||||
## To test, uncomment the array below and comment out ./_site and :disable_external
|
||||
#[ "/foo/bar#baz", "/foo/bar", "#", "#wallet", "/foo.css", "/bar.png", "/zh_TW/bitcoin-for-businesses" ],
|
||||
path_to_check,
|
||||
|
||||
{
|
||||
## Disable external link checking by default to avoid spurious
|
||||
## Travis CI failures. TODO: take an argument to optionally
|
||||
|
||||
@ -27,7 +27,6 @@ if !File.exist?('_config.yml')
|
||||
end
|
||||
|
||||
def fetchlinks()
|
||||
|
||||
# Fetch new list of links
|
||||
links = {}
|
||||
dirs = Dir.glob(WORKDIR + "/_site/**/*.html").each { |file|
|
||||
@ -48,11 +47,9 @@ def fetchlinks()
|
||||
}
|
||||
|
||||
return links
|
||||
|
||||
end
|
||||
|
||||
Dir.mktmpdir{|workdir|
|
||||
|
||||
WORKDIR=workdir.gsub("\n",'')
|
||||
|
||||
# Copy current repository to a temporary directory
|
||||
@ -63,7 +60,6 @@ Dir.mktmpdir{|workdir|
|
||||
newlinks = {}
|
||||
|
||||
Dir.chdir(WORKDIR) do
|
||||
|
||||
`git checkout #{srcbr}`
|
||||
`jekyll`
|
||||
oldlinks = fetchlinks()
|
||||
@ -71,7 +67,6 @@ Dir.mktmpdir{|workdir|
|
||||
`git checkout #{dstbr}`
|
||||
`jekyll`
|
||||
newlinks = fetchlinks()
|
||||
|
||||
end
|
||||
|
||||
# Find added links, removed links
|
||||
@ -97,5 +92,4 @@ Dir.mktmpdir{|workdir|
|
||||
diff = diff + "## links removed\n\n" + diffrmlinks.join("\n") + "\n\n"
|
||||
end
|
||||
print diff
|
||||
|
||||
}
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
require 'yaml'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class AlertPage < Page
|
||||
def initialize(site, base, lang, srcdir, src, dstdir, dst, date)
|
||||
@site = site
|
||||
@ -86,5 +85,4 @@ module Jekyll
|
||||
#need to fallback to english when no translation is available.
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -14,7 +14,6 @@ require 'yaml'
|
||||
require 'ffi-icu'
|
||||
|
||||
module Jekyll
|
||||
|
||||
module AlphabForImpl
|
||||
def render(context)
|
||||
#Load translations
|
||||
@ -81,7 +80,6 @@ module Jekyll
|
||||
'endalphab_for'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('alphab_for', Jekyll::AlphabForTag)
|
||||
|
||||
@ -21,11 +21,9 @@
|
||||
## <!--[-->`src/qt/paymentrequest.proto`<!--]-->
|
||||
|
||||
module Jekyll
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class AutoCrossRefBlock < Liquid::Block
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
end
|
||||
@ -63,13 +61,11 @@ require 'yaml'
|
||||
site['crossref_loaded'] = true
|
||||
end
|
||||
|
||||
|
||||
## Sort terms by reverse length, so longest matches get linked
|
||||
## first (e.g. "block chain" before "block"). Otherwise short
|
||||
## terms would get linked first and there'd be nothing for long
|
||||
## terms to link to.
|
||||
site['crossref'].sort_by { |k, v| -k.length }.each { |term|
|
||||
|
||||
term[1] = term[0] if term[1].nil? || term[1].empty?
|
||||
|
||||
term[0] = Regexp.escape(term[0])
|
||||
@ -115,11 +111,9 @@ require 'yaml'
|
||||
end
|
||||
|
||||
module Jekyll
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class AutoCrossRefBlockDisabled < Liquid::Block
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
end
|
||||
@ -132,8 +126,6 @@ require 'yaml'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#Do nothing if plugin is disabled
|
||||
if !ENV['ENABLED_PLUGINS'].nil? and ENV['ENABLED_PLUGINS'].index('autocrossref').nil?
|
||||
print 'Autocrossref disabled' + "\n"
|
||||
|
||||
@ -9,9 +9,7 @@ require 'open-uri'
|
||||
require 'json'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class CategoryGenerator < Generator
|
||||
|
||||
def contributors(repo, aliases)
|
||||
contributors = []
|
||||
# Call GitHub API with 100 results per page
|
||||
@ -144,9 +142,6 @@ module Jekyll
|
||||
site.sitecontributors = Marshal.load(file)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -13,9 +13,7 @@ require 'yaml'
|
||||
require 'cgi'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class EventPageGenerator < Generator
|
||||
|
||||
def conferences
|
||||
conferences = []
|
||||
# Loop in _events.yml
|
||||
@ -95,9 +93,6 @@ module Jekyll
|
||||
site.conferences = Marshal.load(file)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -10,11 +10,9 @@
|
||||
## {% endgithubify %}
|
||||
|
||||
module Jekyll
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class GitHubifyBlock < Liquid::Block
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
@repository_url = text.strip()
|
||||
@ -43,14 +41,11 @@ require 'yaml'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
## Code to run if plugin is disabled
|
||||
module Jekyll
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class GitHubifyBlockDisabled < Liquid::Block
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
end
|
||||
|
||||
@ -5,9 +5,7 @@ require 'yaml'
|
||||
require 'json'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class GlossaryPage < Page
|
||||
|
||||
def initialize(site, base, lang, srcdir, src, output_directory)
|
||||
@site = site
|
||||
@base = base
|
||||
@ -105,13 +103,11 @@ module Jekyll
|
||||
site.config["devsearches"]["Glossary"][lang].sort_by!{|hash|
|
||||
hash.to_s.downcase.gsub(/"=>.*/,'')
|
||||
}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
class GlossaryPageGenerator < Generator
|
||||
def generate(site)
|
||||
|
||||
#Do nothing if plugin is disabled
|
||||
if !ENV['ENABLED_PLUGINS'].nil? and ENV['ENABLED_PLUGINS'].index('glossary').nil?
|
||||
print 'Glossary disabled' + "\n"
|
||||
@ -141,7 +137,6 @@ module Jekyll
|
||||
|
||||
if cat == "Glossary"
|
||||
items.each {| lang, list |
|
||||
|
||||
list.each {| el |
|
||||
flat = el.flatten
|
||||
devsearches_json.push({
|
||||
@ -176,5 +171,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -9,11 +9,9 @@
|
||||
# {{ page.title | htmlescape }}
|
||||
|
||||
module Entities
|
||||
|
||||
def htmlescape(input)
|
||||
input.gsub(/['&\"<>]/, { "'" => ''', '&' => '&', '"' => '"', '<' => '<', '>' => '>' })
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter self
|
||||
|
||||
end
|
||||
|
||||
@ -10,11 +10,9 @@
|
||||
## {% enditemplate %}
|
||||
|
||||
module Jekyll
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class InlineTemplateBlock < Liquid::Block
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
@template_name = '_templates/' + text.gsub(' ','') + '.inline'
|
||||
@ -32,11 +30,9 @@ require 'yaml'
|
||||
end
|
||||
|
||||
module Jekyll
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class InlineTemplateBlockDisabled < Liquid::Block
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
end
|
||||
@ -50,8 +46,6 @@ require 'yaml'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#Do nothing if plugin is disabled
|
||||
## Note: tested 2015-04-12 and the site actually compiles 5 seconds
|
||||
## *faster* with this enabled, so hardcoding it to enabled for now
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
## {% endif %}
|
||||
|
||||
module Jekyll
|
||||
|
||||
class LiquidDie < Liquid::Tag
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
@error = text
|
||||
@ -27,5 +25,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Liquid::Template.register_tag('die', Jekyll::LiquidDie)
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
## {% endif %}
|
||||
|
||||
module Jekyll
|
||||
|
||||
class LiquidWarn < Liquid::Tag
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
super
|
||||
@warning = text
|
||||
|
||||
@ -8,7 +8,6 @@ require 'yaml'
|
||||
require 'cgi'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class PageRedirect < Page
|
||||
def initialize(site, base, srcdir, src, dst)
|
||||
@site = site
|
||||
@ -25,7 +24,6 @@ module Jekyll
|
||||
|
||||
class RedirectPageGenerator < Generator
|
||||
def generate(site)
|
||||
|
||||
#Do nothing if plugin is disabled
|
||||
if !ENV['ENABLED_PLUGINS'].nil? and ENV['ENABLED_PLUGINS'].index('redirects').nil?
|
||||
print 'Redirects disabled' + "\n"
|
||||
@ -46,5 +44,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -15,9 +15,7 @@
|
||||
require 'yaml'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class ReleasePage < Page
|
||||
|
||||
def initialize(site, base, lang, srcdir, src, output_directory)
|
||||
@site = site
|
||||
@base = base
|
||||
@ -68,12 +66,10 @@ module Jekyll
|
||||
end
|
||||
return x
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class ReleasePageGenerator < Generator
|
||||
def generate(site)
|
||||
|
||||
#Do nothing if plugin is disabled
|
||||
if !ENV['ENABLED_PLUGINS'].nil? and ENV['ENABLED_PLUGINS'].index('releases').nil?
|
||||
print 'Releases disabled' + "\n"
|
||||
@ -95,5 +91,4 @@ module Jekyll
|
||||
#need to fallback to english when no translation is available.
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -8,7 +8,6 @@ require 'yaml'
|
||||
require 'cgi'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class SitemapFile < StaticFile
|
||||
def write(dest)
|
||||
# do nothing
|
||||
@ -106,5 +105,4 @@ module Jekyll
|
||||
site.static_files << SitemapFile.new(site, site.source, '', 'sitemap.xml')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -9,7 +9,6 @@ require 'yaml'
|
||||
require 'cgi'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class TranslatePage < Page
|
||||
def initialize(site, base, lang, srcdir, src, dstdir, dst)
|
||||
@site = site
|
||||
@ -62,5 +61,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -21,9 +21,7 @@ require 'yaml'
|
||||
require 'cgi'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class TranslateTag < Liquid::Tag
|
||||
|
||||
def initialize(tag_name, id, tokens)
|
||||
super
|
||||
@id = id
|
||||
@ -110,7 +108,6 @@ module Jekyll
|
||||
text
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('translate', Jekyll::TranslateTag)
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
require 'yaml'
|
||||
|
||||
module Jekyll
|
||||
|
||||
class WalletPage < Page
|
||||
def initialize(site, base, dir, wallet, platform, os, title, lang)
|
||||
@site = site
|
||||
@ -105,7 +104,6 @@ module Jekyll
|
||||
# platforms and OSes
|
||||
walletPlatforms.each do |platform|
|
||||
platform['os'].each do |os|
|
||||
|
||||
# This allows generation only of valid wallet pages
|
||||
if platform['name']
|
||||
if platform['name'] == os['name']
|
||||
@ -126,13 +124,10 @@ module Jekyll
|
||||
|
||||
site.pages << WalletPage.new(site, site.source, File.join(lang, walletsDir, dir), wallet, platform, os, fullTitle, lang)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user