-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update the gems to the latest version - stage 1 * require faraday/rack to fix rack adapter issue * params removed form cancel and restart spec * rubocop stage1 * rubocop stage2 * faraday-rack up to 2.0 * Default API endpoint switched * activesupport 7.0
- Loading branch information
Showing
157 changed files
with
3,468 additions
and
2,899 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require: rubocop-performance | ||
require: rubocop-rspec | ||
|
||
Documentation: | ||
Enabled: false | ||
Metrics/ClassLength: | ||
Enabled: false | ||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
Metrics/LineLength: | ||
Enabled: false | ||
Metrics/MethodLength: | ||
Max: 40 | ||
Style/AsciiComments: | ||
Enabled: false | ||
Metrics/AbcSize: | ||
Enabled: false | ||
Style/GuardClause: | ||
Enabled: false | ||
Style/FormatStringToken: | ||
Enabled: false | ||
Lint/AssignmentInCondition: | ||
Enabled: false | ||
Style/IfUnlessModifier: | ||
Enabled: false | ||
Naming/MemoizedInstanceVariableName: | ||
EnforcedStyleForLeadingUnderscores: required | ||
Style/MultilineBlockChain: | ||
Enabled: false | ||
Lint/ConstantDefinitionInBlock: | ||
Enabled: false | ||
Naming/VariableNumber: | ||
Enabled: false | ||
Metrics/BlockLength: | ||
Enabled: false | ||
Lint/ImplicitStringConcatenation: | ||
Enabled: false | ||
Metrics/MethodLength: | ||
Enabled: false | ||
Style/StructInheritance: | ||
Enabled: false | ||
Lint/RescueException: | ||
Enabled: false | ||
Lint/SuppressedException: | ||
Enabled: false | ||
Naming/MemoizedInstanceVariableName: | ||
Enabled: false | ||
Style/SymbolProc: | ||
Enabled: false | ||
RSpec/MultipleMemoizedHelpers: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
gemspec | ||
|
||
gem 'gh', git: 'https://github.com/travis-ci/gh', branch: 'prd-ruby-upgrade-dev' | ||
gem 'rake' | ||
gem 'activesupport', '~> 7.0.6' | ||
|
||
group :development, :test do | ||
gem 'rubocop' | ||
gem 'rubocop-performance' | ||
gem 'rubocop-rspec' | ||
gem 'simplecov-console' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
# encoding: utf-8 | ||
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.unshift File.expand_path('lib', __dir__) | ||
windows = RUBY_PLATFORM =~ /mswin|mingw/ | ||
|
||
require 'bundler/gem_tasks' | ||
|
||
desc "run specs" | ||
task(:spec) { ruby "-S rspec spec#{" -c" unless windows}" } | ||
desc 'run specs' | ||
task(:spec) { ruby "-S rspec spec#{' -c' unless windows}" } | ||
|
||
desc "generate gemspec, update readme" | ||
task :update => :completion do | ||
desc 'generate gemspec, update readme' | ||
task update: :completion do | ||
require 'travis/version' | ||
content = File.read('travis.gemspec') | ||
|
||
# fetch data | ||
fields = { | ||
:authors => sort_by_commits_alpha(`git shortlog -sn`.b, /[^\d\s].*/).uniq, | ||
:email => sort_by_commits_alpha(`git shortlog -sne`.b, /[^<]+@[^>]+/).uniq, | ||
:files => `git ls-files`.b.split("\n").reject { |f| f =~ /^(\.|Gemfile)/ } | ||
authors: sort_by_commits_alpha(`git shortlog -sn`.b, /[^\d\s].*/).uniq, | ||
email: sort_by_commits_alpha(`git shortlog -sne`.b, /[^<]+@[^>]+/).uniq, | ||
files: `git ls-files`.b.split("\n").reject { |f| f =~ /^(\.|Gemfile)/ } | ||
} | ||
|
||
# :( | ||
fields[:email].delete("[email protected]") | ||
fields[:email].delete('[email protected]') | ||
|
||
# insert data | ||
fields.each do |field, values| | ||
|
@@ -31,20 +32,21 @@ task :update => :completion do | |
end | ||
|
||
# set version | ||
content.sub! /(s\.version.*=\s+).*/, "\\1\"#{Travis::VERSION}\"" | ||
content.sub!(/(s\.version.*=\s+).*/, "\\1\"#{Travis::VERSION}\"") | ||
|
||
# escape unicode | ||
content.gsub!(/./) { |c| c.bytesize > 1 ? "\\u{#{c.codepoints.first.to_s(16)}}" : c } | ||
|
||
File.open('travis.gemspec', 'w') { |f| f << content } | ||
|
||
readme = File.read('README.md').b | ||
readme.gsub! /^(\s+\$ travis version\n\s+).*$/, "\\1#{Travis::VERSION}" | ||
readme.gsub! /(gem install travis -v )\S+/, "\\1#{Travis::VERSION}" | ||
readme.gsub! /^\*\*#{Regexp.escape(Travis::VERSION)}\*\* \(not yet released?\)\n/i, "**#{Travis::VERSION}** (#{Time.now.strftime("%B %-d, %Y")})\n" | ||
readme.gsub!(/^(\s+\$ travis version\n\s+).*$/, "\\1#{Travis::VERSION}") | ||
readme.gsub!(/(gem install travis -v )\S+/, "\\1#{Travis::VERSION}") | ||
readme.gsub!(/^\*\*#{Regexp.escape(Travis::VERSION)}\*\* \(not yet released?\)\n/i, | ||
"**#{Travis::VERSION}** (#{Time.now.strftime('%B %-d, %Y')})\n") | ||
|
||
Travis::CLI.commands.each do |c| | ||
readme.sub! /^( \* \[\`#{c.command_name}\`\]\(##{c.command_name}\)).*$/, "\\1 - #{c.description}" | ||
readme.sub!(/^( \* \[`#{c.command_name}`\]\(##{c.command_name}\)).*$/, "\\1 - #{c.description}") | ||
end | ||
|
||
File.write('README.md', readme) | ||
|
@@ -58,13 +60,13 @@ end | |
task 'travis.gemspec' => :update | ||
task 'README.md' => :update | ||
|
||
task :gemspec => :update | ||
task :default => :spec | ||
task :default => :gemspec unless windows or RUBY_VERSION < '2.0' | ||
task :test => :spec | ||
task gemspec: :update | ||
task default: :spec | ||
task default: :gemspec unless windows || (RUBY_VERSION < '2.0') | ||
task test: :spec | ||
|
||
def sort_by_commits_alpha(shortlog_output, patt) | ||
shortlog_output.split("\n").sort do |a,b| | ||
shortlog_output.split("\n").sort do |a, b| | ||
a_comm, a_name = a.strip.split(/\t/) | ||
b_comm, b_name = b.strip.split(/\t/) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'travis' | ||
repos = Travis::Repository.find_all(owner_name: 'travis-ci') | ||
repos.each { |repo| puts "#{repo.slug} #{repo.last_build_state}" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'travis' | ||
|
||
Travis.listen do |listener| | ||
listener.on("job:started") { |e| puts "job started for #{e.repository.slug}" } | ||
listener.on("job:finished") { |e| puts "job finished for #{e.repository.slug}" } | ||
end | ||
listener.on('job:started') { |e| puts "job started for #{e.repository.slug}" } | ||
listener.on('job:finished') { |e| puts "job finished for #{e.repository.slug}" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
module Travis | ||
autoload :Client, 'travis/client' | ||
autoload :CLI, 'travis/cli' | ||
autoload :Pro, 'travis/pro' | ||
autoload :Version, 'travis/version' | ||
|
||
include Client::Namespace.new(Client::ORG_URI) | ||
include Client::Namespace.new(Client::COM_URI) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'travis' | ||
require 'travis/client/auto_login' | ||
Travis::Client::AutoLogin.new(Travis).authenticate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.