Merge pull request #5765 from jekyll/bump-rubocop
Merge pull request 5765
This commit is contained in:
		
						commit
						057365a578
					
				|  | @ -22,6 +22,8 @@ Metrics/BlockLength: | |||
|   Exclude: | ||||
|     - test/**/*.rb | ||||
|     - lib/jekyll/configuration.rb | ||||
|     - rake/*.rake | ||||
|     - jekyll.gemspec | ||||
| Metrics/ClassLength: | ||||
|   Exclude: | ||||
|     - !ruby/regexp /features\/.*.rb$/ | ||||
|  | @ -32,6 +34,8 @@ Metrics/CyclomaticComplexity: | |||
| Metrics/LineLength: | ||||
|   Exclude: | ||||
|     - !ruby/regexp /features\/.*.rb/ | ||||
|     - Rakefile | ||||
|     - rake/*.rake | ||||
|   Max: 90 | ||||
|   Severity: warning | ||||
| Metrics/MethodLength: | ||||
|  |  | |||
							
								
								
									
										2
									
								
								Gemfile
								
								
								
								
							
							
						
						
									
										2
									
								
								Gemfile
								
								
								
								
							|  | @ -25,7 +25,7 @@ group :test do | |||
|   gem "nokogiri" | ||||
|   gem "rspec" | ||||
|   gem "rspec-mocks" | ||||
|   gem "rubocop", "~> 0.44.1" | ||||
|   gem "rubocop", "~> 0.46" | ||||
|   gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) | ||||
| 
 | ||||
|   gem "jruby-openssl" if RUBY_ENGINE == "jruby" | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ | |||
| namespace :docs do | ||||
|   desc "Release #{docs_name} v#{version}" | ||||
|   task :release => :build do | ||||
|     unless `git branch` =~ /^\* master$/ | ||||
|     unless `git branch` =~ %r!^\* master$! | ||||
|       puts "You must be on the master branch to release!" | ||||
|       exit! | ||||
|     end | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ | |||
| 
 | ||||
| desc "Release #{name} v#{version}" | ||||
| task :release => :build do | ||||
|   unless `git branch` =~ /^\* master$/ | ||||
|   unless `git branch` =~ %r!^\* master$! | ||||
|     puts "You must be on the master branch to release!" | ||||
|     exit! | ||||
|   end | ||||
|  |  | |||
|  | @ -13,7 +13,7 @@ namespace :site do | |||
|     require "jekyll" | ||||
| 
 | ||||
|     browser_launched = false | ||||
|     Jekyll::Hooks.register :site, :post_write do |site| | ||||
|     Jekyll::Hooks.register :site, :post_write do |_site| | ||||
|       next if browser_launched | ||||
|       browser_launched = true | ||||
|       Jekyll.logger.info "Opening in browser..." | ||||
|  | @ -26,7 +26,7 @@ namespace :site do | |||
|       "source"      => File.expand_path(docs_folder), | ||||
|       "destination" => File.expand_path("#{docs_folder}/_site"), | ||||
|       "watch"       => true, | ||||
|       "serving"     => true | ||||
|       "serving"     => true, | ||||
|     } | ||||
|     Jekyll::Commands::Build.process(options) | ||||
|     Jekyll::Commands::Serve.process(options) | ||||
|  | @ -38,7 +38,7 @@ namespace :site do | |||
|     Jekyll::Commands::Build.process({ | ||||
|       "profile"     => true, | ||||
|       "source"      => File.expand_path(docs_folder), | ||||
|       "destination" => File.expand_path("#{docs_folder}/_site") | ||||
|       "destination" => File.expand_path("#{docs_folder}/_site"), | ||||
|     }) | ||||
|   end | ||||
|   task :build => :generate | ||||
|  | @ -48,7 +48,7 @@ namespace :site do | |||
|     Dir.chdir("#{docs_folder}/_sass") do | ||||
|       sh 'curl "https://necolas.github.io/normalize.css/latest/normalize.css" -o "normalize.scss"' | ||||
|       sh 'sass "normalize.scss":"_normalize.scss" --style compressed' | ||||
|       rm ['normalize.scss', Dir.glob('*.map')].flatten | ||||
|       rm ["normalize.scss", Dir.glob("*.map")].flatten | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|  | @ -60,40 +60,40 @@ namespace :site do | |||
| 
 | ||||
|   desc "Create a nicely formatted history page for the jekyll site based on the repo history." | ||||
|   task :history do | ||||
|     siteify_file('History.markdown', { "title" => "History" }) | ||||
|     siteify_file("History.markdown", { "title" => "History" }) | ||||
|   end | ||||
| 
 | ||||
|   desc "Copy the Code of Conduct" | ||||
|   task :conduct do | ||||
|     front_matter = { | ||||
|       "redirect_from" => "/conduct/index.html", | ||||
|       "editable"      => false | ||||
|       "editable"      => false, | ||||
|     } | ||||
|     siteify_file('CONDUCT.markdown', front_matter) | ||||
|     siteify_file("CONDUCT.markdown", front_matter) | ||||
|   end | ||||
| 
 | ||||
|   desc "Copy the contributing file" | ||||
|   task :contributing do | ||||
|     siteify_file('.github/CONTRIBUTING.markdown', "title" => "Contributing") | ||||
|     siteify_file(".github/CONTRIBUTING.markdown", "title" => "Contributing") | ||||
|   end | ||||
| 
 | ||||
|   desc "Write the site latest_version.txt file" | ||||
|   task :version_file do | ||||
|     File.open("#{docs_folder}/latest_version.txt", 'wb') { |f| f.puts(version) } unless version =~ /(beta|rc|alpha)/i | ||||
|     File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) } unless version =~ %r!(beta|rc|alpha)!i | ||||
|   end | ||||
| 
 | ||||
|   namespace :releases do | ||||
|     desc "Create new release post" | ||||
|     task :new, :version do |t, args| | ||||
|     task :new, :version do |_t, args| | ||||
|       raise "Specify a version: rake site:releases:new['1.2.3']" unless args.version | ||||
|       today = Time.new.strftime('%Y-%m-%d') | ||||
|       today = Time.new.strftime("%Y-%m-%d") | ||||
|       release = args.version.to_s | ||||
|       filename = "#{docs_folder}/_posts/#{today}-jekyll-#{release.split('.').join('-')}-released.markdown" | ||||
|       filename = "#{docs_folder}/_posts/#{today}-jekyll-#{release.split(".").join("-")}-released.markdown" | ||||
| 
 | ||||
|       File.open(filename, "wb") do |post| | ||||
|         post.puts("---") | ||||
|         post.puts("title: 'Jekyll #{release} Released'") | ||||
|         post.puts("date: #{Time.new.strftime('%Y-%m-%d %H:%M:%S %z')}") | ||||
|         post.puts("date: #{Time.new.strftime("%Y-%m-%d %H:%M:%S %z")}") | ||||
|         post.puts("author: ") | ||||
|         post.puts("version: #{release}") | ||||
|         post.puts("categories: [release]") | ||||
|  |  | |||
|  | @ -2,7 +2,6 @@ module Jekyll | |||
|   class Dummy < Generator | ||||
|     priority :high | ||||
| 
 | ||||
|     def generate(site) | ||||
|     end | ||||
|     def generate(site) end | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue