1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 12:50:24 +01:00

make rubocop ruby version match pages ruby version

This commit is contained in:
Mike Linksvayer 2017-01-18 13:31:19 -08:00
parent 8a2dff3f74
commit f08ace3feb
13 changed files with 26 additions and 3 deletions

View File

@ -1,5 +1,5 @@
AllCops: AllCops:
TargetRubyVersion: 2.1 TargetRubyVersion: 2.3
Exclude: Exclude:
- _site/**/* - _site/**/*
- vendor/**/* - vendor/**/*

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org' source 'https://rubygems.org'
require 'json' require 'json'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'html-proofer' require 'html-proofer'
require 'rspec/core/rake_task' require 'rspec/core/rake_task'

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
# Checks if a given license meets the approval criteria to be added to choosealicense.com # Checks if a given license meets the approval criteria to be added to choosealicense.com
# See https://github.com/github/choosealicense.com/blob/gh-pages/CONTRIBUTING.md#adding-a-license # See https://github.com/github/choosealicense.com/blob/gh-pages/CONTRIBUTING.md#adding-a-license
# Usage: script/check-approval [SPDX LICENSE ID] # Usage: script/check-approval [SPDX LICENSE ID]

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
# Usage: script/generate-docs # Usage: script/generate-docs
# Reads in the fields, meta, and rules YAML files and produces markdown output # Reads in the fields, meta, and rules YAML files and produces markdown output
# suitable for documenting in the project's README # suitable for documenting in the project's README

View File

@ -1,14 +1,14 @@
# frozen_string_literal: true
require 'json' require 'json'
require 'open-uri' require 'open-uri'
require 'spec_helper' require 'spec_helper'
require 'yaml' require 'yaml'
describe 'ci ruby version' do describe 'ruby version' do
pages_versions = JSON.parse(open('https://pages.github.com/versions.json').read) pages_versions = JSON.parse(open('https://pages.github.com/versions.json').read)
pages_ruby_version = pages_versions['ruby'] pages_ruby_version = pages_versions['ruby']
ci_config_file = '.travis.yml' ci_config_file = '.travis.yml'
ci_config = YAML.load_file(ci_config_file) ci_config = YAML.load_file(ci_config_file)
ci_ruby_version = ci_config['rvm'][0] ci_ruby_version = ci_config['rvm'][0]
@ -18,4 +18,16 @@ describe 'ci ruby version' do
expect(ci_ruby_version).to eql(pages_ruby_version), msg expect(ci_ruby_version).to eql(pages_ruby_version), msg
end end
end end
rubocop_config_file = '.rubocop.yml'
rubocop_config = YAML.load_file(rubocop_config_file)
rubocop_ruby_version = rubocop_config['AllCops']['TargetRubyVersion']
pages_ruby_version_minor = pages_ruby_version.match('^(\d+)\.(\d+)')[0]
context "in #{rubocop_config_file} and pages ruby minor version" do
it 'match' do
msg = "#{rubocop_ruby_version} != #{pages_ruby_version_minor}; please add a commit bumping in #{rubocop_config_file}"
expect(rubocop_ruby_version.to_s).to eql(pages_ruby_version_minor), msg
end
end
end end

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'byte order marks' do describe 'byte order marks' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'license fillable fields' do describe 'license fillable fields' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'license meta' do describe 'license meta' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'license rules' do describe 'license rules' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'shown licenses' do describe 'shown licenses' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe 'licenses' do describe 'licenses' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'jekyll' require 'jekyll'
require 'open-uri' require 'open-uri'
require 'json' require 'json'