rfix 1.1.1.pre → 1.2.2.pre.174
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +38 -0
- data/Gemfile.lock +1 -1
- data/lib/rfix/branches/head.rb +2 -0
- data/lib/rfix/branches/main.rb +1 -0
- data/lib/rfix/branches/name.rb +3 -1
- data/lib/rfix/branches/reference.rb +2 -0
- data/lib/rfix/branches/upstream.rb +2 -0
- data/lib/rfix/log.rb +2 -2
- data/lib/rfix/rake/paths.rb +2 -2
- data/lib/rfix/repository.rb +3 -0
- data/lib/rfix/tracked.rb +2 -6
- data/lib/rfix/version.rb +1 -1
- data/rfix.gemspec +3 -1
- data/tasks/execute.rake +38 -0
- data/tasks/libgit2.rake +33 -0
- data/tasks/simple.rake +4 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21eca1cf7b672049156a68d5b78b205fe3a51356fd005cea3ca7de90b35f8504
|
4
|
+
data.tar.gz: 01631f5a207dcd3018d55dd7df84d44e4b90985be602270ed242bcba2cc704ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dcd829c42c554bdf92c0474a397129b66edaa33974554996d0d5bc1b8fc7738510cbffff43c13359b2844e8730693b600f5038c59d54351c14d14dac1a1399a
|
7
|
+
data.tar.gz: 1f0ea8c9615cfa02cf7022af7514633a9331d42a35d58e759f9d5c8010f2e25d2b976b0dd984aa50045f6f1a7f933bf800b88ff577e1fbfb86cd8518f1e625ac
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: pre-release
|
3
|
+
on: [push]
|
4
|
+
env:
|
5
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
6
|
+
GITHUB_API_TOKEN: ${{secrets.API_KEY}}
|
7
|
+
jobs:
|
8
|
+
setup:
|
9
|
+
container: ruby:2.7
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
|
14
|
+
- run: apt-get update -y
|
15
|
+
- run: apt-get install -y bash git libffi-dev build-essential wget cmake
|
16
|
+
|
17
|
+
- run: gem install bundler
|
18
|
+
- run: bundle config build.rugged --use-system-libraries
|
19
|
+
- run: bundle config build.ffi --use-system-libraries
|
20
|
+
- run: gem install rake rspec colorize
|
21
|
+
- run: rake libgit2:install
|
22
|
+
|
23
|
+
- run: bundle install --path vendor/bundle
|
24
|
+
- run: rake execute:local execute:origin execute:lint execute:branch
|
25
|
+
|
26
|
+
- run: git config user.email "linus@oleander.io"
|
27
|
+
- run: git config user.name "Linus Oleander"
|
28
|
+
|
29
|
+
- name: Publish to RubyGems
|
30
|
+
run: |
|
31
|
+
mkdir -p $HOME/.gem
|
32
|
+
touch $HOME/.gem/credentials
|
33
|
+
chmod 0600 $HOME/.gem/credentials
|
34
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
35
|
+
gem build *.gemspec
|
36
|
+
gem push *.gem
|
37
|
+
env:
|
38
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.RUBYGEMS_API_KEY}}"
|
data/Gemfile.lock
CHANGED
data/lib/rfix/branches/head.rb
CHANGED
data/lib/rfix/branches/main.rb
CHANGED
data/lib/rfix/branches/name.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require_relative "base"
|
2
|
+
|
1
3
|
module Rfix
|
2
4
|
class Branch::Name < Branch::Base
|
3
5
|
attr_reader :name
|
@@ -10,7 +12,7 @@ module Rfix
|
|
10
12
|
unless branch = with.branches[name]
|
11
13
|
raise Branch::UnknownBranchError.new("Could not find branch {{error:#{name}}}")
|
12
14
|
end
|
13
|
-
|
15
|
+
|
14
16
|
with.lookup(with.merge_base(branch.target_id, with.head.target_id))
|
15
17
|
rescue Rugged::ReferenceError
|
16
18
|
raise Branch::UnknownBranchError.new("Could not find branch {{error:#{name}}}")
|
data/lib/rfix/log.rb
CHANGED
data/lib/rfix/rake/paths.rb
CHANGED
@@ -8,11 +8,11 @@ end
|
|
8
8
|
module Bundle
|
9
9
|
INSTALL = "bundle:install".freeze
|
10
10
|
ADD = "bundle:git:add".freeze
|
11
|
-
CONFIG = File.join(__dir__, "../../../.rubocop.yml")
|
12
11
|
TAG = "rally-point".freeze
|
13
12
|
REBUILD = "bundle:rebuild".freeze
|
14
13
|
BUILD = "bundle:build".freeze
|
15
|
-
ROOT =
|
14
|
+
ROOT = Dir.getwd
|
15
|
+
CONFIG = File.join(ROOT, ".rubocop.yml")
|
16
16
|
DIR = File.join(ROOT, "spec/fixtures")
|
17
17
|
TMP = File.join(ROOT, "tmp")
|
18
18
|
|
data/lib/rfix/repository.rb
CHANGED
data/lib/rfix/tracked.rb
CHANGED
@@ -5,6 +5,7 @@ class Rfix::Tracked < Rfix::File
|
|
5
5
|
|
6
6
|
def include?(line)
|
7
7
|
set = diff.each_line.to_a.map{ |l| l.new_lineno }.reject { |l| l == -1 }.to_set
|
8
|
+
say_debug "Does {{yellow:#{set}}} contain {{red:#{line}}}"
|
8
9
|
set.include?(line)
|
9
10
|
end
|
10
11
|
|
@@ -52,14 +53,10 @@ class Rfix::Tracked < Rfix::File
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def diff
|
55
|
-
upstream.
|
56
|
+
upstream.diff_workdir({
|
56
57
|
include_untracked_content: true,
|
57
|
-
# ignore_whitespace_change: true,
|
58
58
|
recurse_untracked_dirs: true,
|
59
|
-
disable_pathspec_match: false,
|
60
|
-
# ignore_whitespace_eol: false,
|
61
59
|
include_untracked: true,
|
62
|
-
# ignore_whitespace: true,
|
63
60
|
ignore_submodules: true,
|
64
61
|
include_ignored: false,
|
65
62
|
context_lines: 0,
|
@@ -67,7 +64,6 @@ class Rfix::Tracked < Rfix::File
|
|
67
64
|
}).tap do |diff|
|
68
65
|
diff.find_similar!(
|
69
66
|
renames_from_rewrites: true,
|
70
|
-
# ignore_whitespace: true,
|
71
67
|
renames: true,
|
72
68
|
copies: true
|
73
69
|
)
|
data/lib/rfix/version.rb
CHANGED
data/rfix.gemspec
CHANGED
@@ -11,9 +11,11 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
if ENV["TRAVIS"]
|
13
13
|
spec.version = "#{Rfix::VERSION}-#{ENV.fetch('TRAVIS_BUILD_NUMBER')}"
|
14
|
+
elsif ENV["GITHUB_RUN_ID"]
|
15
|
+
spec.version = "#{Rfix::VERSION}-#{ENV.fetch('GITHUB_RUN_ID')}"
|
14
16
|
else
|
15
17
|
# rubocop:disable Gemspec/DuplicatedAssignment
|
16
|
-
spec.version = Rfix::VERSION
|
18
|
+
spec.version = [Rfix::VERSION, "pre"].join
|
17
19
|
# rubocop:enable Gemspec/DuplicatedAssignment
|
18
20
|
end
|
19
21
|
|
data/tasks/execute.rake
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "rake/clean"
|
2
|
+
require "tmpdir"
|
3
|
+
require "pathname"
|
4
|
+
|
5
|
+
repo_path = Pathname.new(Dir.mktmpdir)
|
6
|
+
|
7
|
+
CLEAN.include(repo_path)
|
8
|
+
|
9
|
+
namespace :execute do
|
10
|
+
task local: [repo_path, :install] do
|
11
|
+
chdir(repo_path) do
|
12
|
+
sh "rfix local"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
task branch: [repo_path, :install] do
|
17
|
+
chdir(repo_path) do
|
18
|
+
sh "rfix branch master"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
task origin: [repo_path, :install] do
|
23
|
+
chdir(repo_path) do
|
24
|
+
sh "rfix origin"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
task lint: [repo_path, :install] do
|
29
|
+
chdir(repo_path) do
|
30
|
+
sh "rfix lint"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
file repo_path => :rebuild do
|
35
|
+
sh "git clone spec/fixtures/complex.bundle #{repo_path} --branch master"
|
36
|
+
sh "git --work-tree=#{repo_path} branch --set-upstream-to origin/master"
|
37
|
+
end
|
38
|
+
end
|
data/tasks/libgit2.rake
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require "rake/clean"
|
2
|
+
require "tmpdir"
|
3
|
+
require "pathname"
|
4
|
+
|
5
|
+
root_path = Pathname.new(Dir.mktmpdir)
|
6
|
+
# root_path = Pathname.new(__dir__).join("../tmp")
|
7
|
+
libgit2_gz_path = root_path.join("v1.0.1.tar.gz")
|
8
|
+
libgit2_path = root_path.join("libgit2-1.0.1")
|
9
|
+
|
10
|
+
CLEAN.include(root_path)
|
11
|
+
|
12
|
+
namespace :libgit2 do
|
13
|
+
task build: libgit2_path do
|
14
|
+
chdir(libgit2_path) do
|
15
|
+
sh "cmake ."
|
16
|
+
sh "make"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
task install: :build do
|
21
|
+
chdir(libgit2_path) do
|
22
|
+
sh "make install"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
file libgit2_gz_path do
|
27
|
+
sh "wget -O #{libgit2_gz_path} https://github.com/libgit2/libgit2/archive/v1.0.1.tar.gz"
|
28
|
+
end
|
29
|
+
|
30
|
+
file libgit2_path => libgit2_gz_path do
|
31
|
+
sh "tar xzf #{libgit2_gz_path} -C #{root_path}"
|
32
|
+
end
|
33
|
+
end
|
data/tasks/simple.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2.pre.174
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -205,6 +205,7 @@ executables:
|
|
205
205
|
extensions: []
|
206
206
|
extra_rdoc_files: []
|
207
207
|
files:
|
208
|
+
- ".github/workflows/main.yml"
|
208
209
|
- ".gitignore"
|
209
210
|
- ".rspec"
|
210
211
|
- ".rubocop.yml"
|
@@ -289,6 +290,8 @@ files:
|
|
289
290
|
- tasks/bump.rake
|
290
291
|
- tasks/bundle.rake
|
291
292
|
- tasks/complex.rake
|
293
|
+
- tasks/execute.rake
|
294
|
+
- tasks/libgit2.rake
|
292
295
|
- tasks/simple.rake
|
293
296
|
- tasks/travis.rake
|
294
297
|
- tasks/vendor.rake
|
@@ -322,7 +325,7 @@ licenses:
|
|
322
325
|
- MIT
|
323
326
|
metadata:
|
324
327
|
homepage_uri: https://github.com/oleander/rfix-rb
|
325
|
-
post_install_message:
|
328
|
+
post_install_message:
|
326
329
|
rdoc_options: []
|
327
330
|
require_paths:
|
328
331
|
- lib
|
@@ -340,7 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
343
|
requirements:
|
341
344
|
- git, v2.0+
|
342
345
|
rubygems_version: 3.0.3
|
343
|
-
signing_key:
|
346
|
+
signing_key:
|
344
347
|
specification_version: 4
|
345
348
|
summary: RuboCop CLI that only lints and auto-fixes code you committed by utilizing
|
346
349
|
`git-log` and `git-diff`
|