mergem 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.0pdd.yml +3 -0
- data/.github/workflows/actionlint.yml +25 -0
- data/.github/workflows/copyrights.yml +19 -0
- data/.github/workflows/cron.yml +12 -5
- data/.github/workflows/markdown-lint.yml +19 -0
- data/.github/workflows/pdd.yml +11 -3
- data/.github/workflows/rake.yml +9 -4
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/typos.yml +19 -0
- data/.github/workflows/xcop.yml +6 -2
- data/.github/workflows/yamllint.yml +19 -0
- data/.gitignore +8 -5
- data/.rubocop.yml +12 -1
- data/.rultor.yml +6 -1
- data/Gemfile +13 -27
- data/Gemfile.lock +177 -0
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +22 -20
- data/REUSE.toml +35 -0
- data/Rakefile +3 -36
- data/bin/mergem +2 -19
- data/features/cli.feature +2 -0
- data/features/gem_package.feature +2 -0
- data/features/step_definitions/steps.rb +8 -25
- data/features/support/env.rb +2 -19
- data/lib/mergem/askrultor.rb +4 -21
- data/lib/mergem/pulls.rb +3 -20
- data/lib/mergem/repos.rb +4 -21
- data/lib/mergem/version.rb +4 -21
- data/mergem.gemspec +13 -29
- data/test/test__helper.rb +23 -20
- data/test/test_askrultor.rb +5 -22
- data/test/test_pulls.rb +6 -24
- data/test/test_repos.rb +10 -28
- metadata +35 -16
- data/.simplecov +0 -38
data/REUSE.toml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
3
|
+
|
4
|
+
version = 1
|
5
|
+
[[annotations]]
|
6
|
+
path = [
|
7
|
+
".DS_Store",
|
8
|
+
".gitattributes",
|
9
|
+
".gitignore",
|
10
|
+
".pdd",
|
11
|
+
"**.json",
|
12
|
+
"**.md",
|
13
|
+
"**.png",
|
14
|
+
"**.txt",
|
15
|
+
"**/.DS_Store",
|
16
|
+
"**/.gitignore",
|
17
|
+
"**/.pdd",
|
18
|
+
"**/*.csv",
|
19
|
+
"**/*.jpg",
|
20
|
+
"**/*.json",
|
21
|
+
"**/*.md",
|
22
|
+
"**/*.pdf",
|
23
|
+
"**/*.png",
|
24
|
+
"**/*.svg",
|
25
|
+
"**/*.txt",
|
26
|
+
"**/*.vm",
|
27
|
+
"**/CNAME",
|
28
|
+
"**/Gemfile.lock",
|
29
|
+
"Gemfile.lock",
|
30
|
+
"README.md",
|
31
|
+
"renovate.json",
|
32
|
+
]
|
33
|
+
precedence = "override"
|
34
|
+
SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
|
35
|
+
SPDX-License-Identifier = "MIT"
|
data/Rakefile
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'rubygems'
|
22
5
|
require 'rake'
|
@@ -31,7 +14,7 @@ def version
|
|
31
14
|
Gem::Specification.load(Dir['*.gemspec'].first).version
|
32
15
|
end
|
33
16
|
|
34
|
-
task default: %i[clean test features rubocop
|
17
|
+
task default: %i[clean test features rubocop]
|
35
18
|
|
36
19
|
require 'rake/testtask'
|
37
20
|
desc 'Run all unit tests'
|
@@ -55,17 +38,9 @@ require 'rubocop/rake_task'
|
|
55
38
|
desc 'Run RuboCop on all directories'
|
56
39
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
57
40
|
task.fail_on_error = true
|
58
|
-
task.requires << 'rubocop-rspec'
|
59
41
|
task.options = ['--display-cop-names']
|
60
42
|
end
|
61
43
|
|
62
|
-
require 'xcop/rake_task'
|
63
|
-
Xcop::RakeTask.new(:xcop) do |task|
|
64
|
-
task.license = 'LICENSE.txt'
|
65
|
-
task.includes = ['**/*.xml', '**/*.xsl', '**/*.xsd', '**/*.html']
|
66
|
-
task.excludes = ['mergem/**', 'coverage/**']
|
67
|
-
end
|
68
|
-
|
69
44
|
require 'cucumber/rake/task'
|
70
45
|
Cucumber::Rake::Task.new(:features) do
|
71
46
|
Rake::Cleaner.cleanup_files(['coverage'])
|
@@ -73,11 +48,3 @@ end
|
|
73
48
|
Cucumber::Rake::Task.new(:'features:html') do |t|
|
74
49
|
t.profile = 'html_report'
|
75
50
|
end
|
76
|
-
|
77
|
-
task :copyright do
|
78
|
-
sh "grep -q -r '#{Date.today.strftime('%Y')}' \
|
79
|
-
--include '*.rb' \
|
80
|
-
--include '*.txt' \
|
81
|
-
--include 'Rakefile' \
|
82
|
-
."
|
83
|
-
end
|
data/bin/mergem
CHANGED
@@ -1,23 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# Copyright (c) 2022-
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
6
|
-
# in the Software without restriction, including without limitation the rights
|
7
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
# copies of the Software, and to permit persons to whom the Software is
|
9
|
-
# furnished to do so, subject to the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be included in all
|
12
|
-
# copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
17
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
-
# SOFTWARE.
|
2
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
3
|
+
# SPDX-License-Identifier: MIT
|
21
4
|
|
22
5
|
STDOUT.sync = true
|
23
6
|
|
data/features/cli.feature
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'nokogiri'
|
22
5
|
require 'tmpdir'
|
@@ -40,13 +23,13 @@ end
|
|
40
23
|
|
41
24
|
Given(/^I have a "([^"]*)" file with content:$/) do |file, text|
|
42
25
|
FileUtils.mkdir_p(File.dirname(file)) unless File.exist?(file)
|
43
|
-
File.write(file, text.gsub(
|
26
|
+
File.write(file, text.gsub('\\xFF', 0xFF.chr))
|
44
27
|
end
|
45
28
|
|
46
29
|
When(%r{^I run bin/mergem with "([^"]*)"$}) do |arg|
|
47
30
|
home = File.join(File.dirname(__FILE__), '../..')
|
48
31
|
@stdout = `ruby -I#{home}/lib #{home}/bin/mergem #{arg}`
|
49
|
-
@
|
32
|
+
@status = $CHILD_STATUS.exitstatus
|
50
33
|
end
|
51
34
|
|
52
35
|
Then(/^Stdout contains "([^"]*)"$/) do |txt|
|
@@ -58,23 +41,23 @@ Then(/^Stdout is empty$/) do
|
|
58
41
|
end
|
59
42
|
|
60
43
|
Then(/^Exit code is zero$/) do
|
61
|
-
raise "Non-zero exit #{@
|
44
|
+
raise "Non-zero exit #{@status}:\n#{@stdout}" unless @status.zero?
|
62
45
|
end
|
63
46
|
|
64
47
|
Then(/^Exit code is not zero$/) do
|
65
|
-
raise 'Zero exit code' if @
|
48
|
+
raise 'Zero exit code' if @status.zero?
|
66
49
|
end
|
67
50
|
|
68
51
|
When(/^I run bash with "([^"]*)"$/) do |text|
|
69
52
|
FileUtils.copy_entry(@cwd, File.join(@dir, 'mergem'))
|
70
53
|
@stdout = `#{text}`
|
71
|
-
@
|
54
|
+
@status = $CHILD_STATUS.exitstatus
|
72
55
|
end
|
73
56
|
|
74
57
|
When(/^I run bash with:$/) do |text|
|
75
58
|
FileUtils.copy_entry(@cwd, File.join(@dir, 'mergem'))
|
76
59
|
@stdout = `#{text}`
|
77
|
-
@
|
60
|
+
@status = $CHILD_STATUS.exitstatus
|
78
61
|
end
|
79
62
|
|
80
63
|
Given(/^It is Unix$/) do
|
data/features/support/env.rb
CHANGED
@@ -1,21 +1,4 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'simplecov'
|
data/lib/mergem/askrultor.rb
CHANGED
@@ -1,26 +1,9 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
# Ask Rultor to merge a pull request.
|
22
5
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
23
|
-
# Copyright:: Copyright (c) 2022-
|
6
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
24
7
|
# License:: MIT
|
25
8
|
class Mergem::AskRultor
|
26
9
|
def initialize(api, loog)
|
@@ -64,7 +47,7 @@ class Mergem::AskRultor
|
|
64
47
|
end
|
65
48
|
@loog.debug("All #{checks.count} check(s) completed successfully in #{title}")
|
66
49
|
msg = '@rultor please, try to merge'
|
67
|
-
msg += ", since #{checks.count} checks have passed" if checks.
|
50
|
+
msg += ", since #{checks.count} checks have passed" if checks.any?
|
68
51
|
@api.add_comment(repo, num, msg)
|
69
52
|
@loog.info("Comment added to #{title}")
|
70
53
|
true
|
data/lib/mergem/pulls.rb
CHANGED
@@ -1,26 +1,9 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
# Pulls in GitHub API.
|
22
5
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
23
|
-
# Copyright:: Copyright (c) 2022-
|
6
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
24
7
|
# License:: MIT
|
25
8
|
class Mergem::Pulls
|
26
9
|
def initialize(api, loog, repo)
|
data/lib/mergem/repos.rb
CHANGED
@@ -1,26 +1,9 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
# Find all repositories by the locations provided.
|
22
5
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
23
|
-
# Copyright:: Copyright (c) 2022-
|
6
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
24
7
|
# License:: MIT
|
25
8
|
class Mergem::Repos
|
26
9
|
def initialize(api, loog, masks)
|
@@ -44,7 +27,7 @@ class Mergem::Repos
|
|
44
27
|
names << repo
|
45
28
|
end
|
46
29
|
end
|
47
|
-
names.each do |n|
|
30
|
+
names.shuffle.each do |n|
|
48
31
|
r = @api.repository(n)
|
49
32
|
if r[:archived]
|
50
33
|
@loog.debug("Repository #{n} is archived, ignoring")
|
data/lib/mergem/version.rb
CHANGED
@@ -1,27 +1,10 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
# mergem main module.
|
22
5
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
23
|
-
# Copyright:: Copyright (c) 2022-
|
6
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
24
7
|
# License:: MIT
|
25
8
|
module Mergem
|
26
|
-
VERSION = '0.0
|
9
|
+
VERSION = '0.1.0'.freeze
|
27
10
|
end
|
data/mergem.gemspec
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'English'
|
22
5
|
|
@@ -31,21 +14,22 @@ Gem::Specification.new do |s|
|
|
31
14
|
s.version = Mergem::VERSION
|
32
15
|
s.license = 'MIT'
|
33
16
|
s.metadata = { 'rubygems_mfa_required' => 'true' }
|
34
|
-
s.summary = 'GitHub API client
|
17
|
+
s.summary = 'GitHub API client that deals with Pull Requests'
|
35
18
|
s.description = 'tbd...'
|
36
19
|
s.authors = ['Yegor Bugayenko']
|
37
20
|
s.email = 'yegor256@gmail.com'
|
38
|
-
s.homepage = '
|
21
|
+
s.homepage = 'https://github.com/yegor256/mergem'
|
39
22
|
s.files = `git ls-files`.split($RS)
|
40
23
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
41
24
|
s.rdoc_options = ['--charset=UTF-8']
|
42
25
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
43
|
-
s.
|
44
|
-
s.
|
45
|
-
s.
|
46
|
-
s.
|
47
|
-
s.
|
48
|
-
s.
|
49
|
-
s.
|
50
|
-
s.
|
26
|
+
s.add_dependency 'backtrace', '~>0.3'
|
27
|
+
s.add_dependency 'iri', '~>0.5'
|
28
|
+
s.add_dependency 'loog', '~>0.2'
|
29
|
+
s.add_dependency 'nokogiri', '~>1.18'
|
30
|
+
s.add_dependency 'obk', '~>0.3'
|
31
|
+
s.add_dependency 'octokit', '~>10.0'
|
32
|
+
s.add_dependency 'rainbow', '~>3.0'
|
33
|
+
s.add_dependency 'slop', '~>4.4'
|
34
|
+
s.add_dependency 'tacky', '~>0.3'
|
51
35
|
end
|
data/test/test__helper.rb
CHANGED
@@ -1,26 +1,29 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
$stdout.sync = true
|
22
5
|
|
23
6
|
require 'simplecov'
|
24
|
-
|
7
|
+
require 'simplecov-cobertura'
|
8
|
+
unless SimpleCov.running
|
9
|
+
SimpleCov.command_name('test')
|
10
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
11
|
+
[
|
12
|
+
SimpleCov::Formatter::HTMLFormatter,
|
13
|
+
SimpleCov::Formatter::CoberturaFormatter
|
14
|
+
]
|
15
|
+
)
|
16
|
+
SimpleCov.minimum_coverage 35
|
17
|
+
SimpleCov.minimum_coverage_by_file 15
|
18
|
+
SimpleCov.start do
|
19
|
+
add_filter 'test/'
|
20
|
+
add_filter 'vendor/'
|
21
|
+
add_filter 'target/'
|
22
|
+
track_files 'lib/**/*.rb'
|
23
|
+
track_files '*.rb'
|
24
|
+
end
|
25
|
+
end
|
25
26
|
|
26
27
|
require 'minitest/autorun'
|
28
|
+
require 'minitest/reporters'
|
29
|
+
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
|
data/test/test_askrultor.rb
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'minitest/autorun'
|
22
5
|
require 'octokit'
|
@@ -25,16 +8,16 @@ require_relative '../lib/mergem/askrultor'
|
|
25
8
|
|
26
9
|
# Test for AskRultor.
|
27
10
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
28
|
-
# Copyright:: Copyright (c) 2022-
|
11
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
29
12
|
# License:: MIT
|
30
13
|
class TestAskRultor < Minitest::Test
|
31
|
-
def
|
14
|
+
def test_asks_rultor_to_merge_pull_request
|
32
15
|
api = Octokit::Client.new
|
33
16
|
m = Mergem::AskRultor.new(api, Loog::VERBOSE)
|
34
17
|
asked = m.ask('yegor256/mergem', 1)
|
35
18
|
assert(asked)
|
36
19
|
rescue Octokit::TooManyRequests => e
|
37
20
|
puts e.message
|
38
|
-
skip
|
21
|
+
skip('It is OK')
|
39
22
|
end
|
40
23
|
end
|
data/test/test_pulls.rb
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'minitest/autorun'
|
22
5
|
require 'octokit'
|
@@ -25,21 +8,20 @@ require_relative '../lib/mergem/pulls'
|
|
25
8
|
|
26
9
|
# Test for Pulls.
|
27
10
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
28
|
-
# Copyright:: Copyright (c) 2022-
|
11
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
29
12
|
# License:: MIT
|
30
13
|
class TestPulls < Minitest::Test
|
31
|
-
def
|
14
|
+
def test_fetches_pull_requests_from_repository
|
32
15
|
api = Octokit::Client.new
|
33
16
|
m = Mergem::Pulls.new(api, Loog::VERBOSE, 'yegor256/blog')
|
34
17
|
ms = []
|
35
18
|
total = m.each do |pr|
|
36
19
|
ms << "##{pr}"
|
37
20
|
end
|
38
|
-
|
21
|
+
refute_empty(ms)
|
39
22
|
assert_equal(total, ms.count)
|
40
|
-
p ms
|
41
23
|
rescue Octokit::TooManyRequests => e
|
42
24
|
puts e.message
|
43
|
-
skip
|
25
|
+
skip('It is OK')
|
44
26
|
end
|
45
27
|
end
|
data/test/test_repos.rb
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
# Copyright (c) 2022-
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
-
# SOFTWARE.
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
20
3
|
|
21
4
|
require 'minitest/autorun'
|
22
5
|
require 'octokit'
|
@@ -25,30 +8,29 @@ require_relative '../lib/mergem/repos'
|
|
25
8
|
|
26
9
|
# Test for Repos.
|
27
10
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
28
|
-
# Copyright:: Copyright (c) 2022-
|
11
|
+
# Copyright:: Copyright (c) 2022-2025 Yegor Bugayenko
|
29
12
|
# License:: MIT
|
30
|
-
class
|
31
|
-
def
|
13
|
+
class TestRepos < Minitest::Test
|
14
|
+
def test_finds_repositories_from_multiple_sources
|
32
15
|
api = Octokit::Client.new
|
33
16
|
r = Mergem::Repos.new(api, Loog::VERBOSE, ['yegor256/blog', 'polystat/*'])
|
34
17
|
ms = []
|
35
18
|
total = r.each do |repo|
|
36
19
|
ms << repo
|
37
20
|
end
|
38
|
-
|
21
|
+
refute_empty(ms)
|
39
22
|
assert_equal(total, ms.count)
|
40
|
-
p ms
|
41
23
|
rescue Octokit::TooManyRequests => e
|
42
24
|
puts e.message
|
43
|
-
skip
|
25
|
+
skip('It is OK')
|
44
26
|
end
|
45
27
|
|
46
|
-
def
|
28
|
+
def test_ignores_archived_repositories
|
47
29
|
api = Octokit::Client.new
|
48
|
-
r = Mergem::Repos.new(api, Loog::VERBOSE, ['
|
30
|
+
r = Mergem::Repos.new(api, Loog::VERBOSE, ['polystat/j2ast'])
|
49
31
|
assert_equal(0, r.each)
|
50
32
|
rescue Octokit::TooManyRequests => e
|
51
33
|
puts e.message
|
52
|
-
skip
|
34
|
+
skip('It is OK')
|
53
35
|
end
|
54
36
|
end
|