rfix 1.1.1.pre → 1.2.2.pre.174

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fd96e76cafc6a288cb5df13b2480059aa408abefab74c4fa10932d67d5f955f
4
- data.tar.gz: e4a96eb5322a6782fe3dc2983c59789f60226a61c6b79e7e88c3805137e1cf67
3
+ metadata.gz: 21eca1cf7b672049156a68d5b78b205fe3a51356fd005cea3ca7de90b35f8504
4
+ data.tar.gz: 01631f5a207dcd3018d55dd7df84d44e4b90985be602270ed242bcba2cc704ed
5
5
  SHA512:
6
- metadata.gz: 064f9537855fc01eeb0a584db2627518d6e49de21f6a057682ec18730afff08ea2abc8d1a61a5d47a812b442be711f6afca41c0cd88f381f7cd447ca8a7c03f4
7
- data.tar.gz: 04d6c3383940faccfb95696b77fa97eaf5483b1c3c9dd579b022d2d4018e23857c081dc66aae6f3626f47fc13e22486c3e5acaaedfd8d80be68cc073383466e3
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}}"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rfix (1.1.1.pre)
4
+ rfix (1.2.2pre)
5
5
  cri (~> 2.15.10)
6
6
  listen (~> 3.0)
7
7
  rainbow (~> 3.0)
@@ -1,3 +1,5 @@
1
+ require_relative "base"
2
+
1
3
  module Rfix
2
4
  class Branch::Head < Branch::Base
3
5
  def resolve(with:)
@@ -1,4 +1,5 @@
1
1
  require "rugged"
2
+ require_relative "base"
2
3
 
3
4
  module Rfix
4
5
  class Branch::Main < Branch::Base
@@ -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}}}")
@@ -1,3 +1,5 @@
1
+ require_relative "base"
2
+
1
3
  module Rfix
2
4
  class Branch::Reference < Branch::Base
3
5
  attr_reader :reference
@@ -1,3 +1,5 @@
1
+ require_relative "base"
2
+
1
3
  module Rfix
2
4
  class Branch::Upstream < Branch::Base
3
5
  def resolve(with:)
@@ -31,9 +31,9 @@ module Rfix::Log
31
31
  end
32
32
 
33
33
  def say_debug(message)
34
- if debug? or test?
34
+ # if debug? or test?
35
35
  prt("{{i}} #{strip(message)}", to: $stderr)
36
- end
36
+ # end
37
37
  end
38
38
 
39
39
  def say_abort(message)
@@ -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 = File.expand_path(File.join(__dir__, "../../.."))
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
 
@@ -47,10 +47,13 @@ class Rfix::Repository
47
47
  end
48
48
 
49
49
  def include?(path, line)
50
+ say_debug "Checking #{path}:#{line}"
51
+
50
52
  if file = @files.get(path)
51
53
  return file.include?(line)
52
54
  end
53
55
 
56
+ say_debug "\tSkip file (return false)"
54
57
  return false
55
58
  end
56
59
 
@@ -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.diff(head, {
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
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rfix
4
- VERSION = "1.1.1.pre"
4
+ VERSION = "1.2.2"
5
5
  end
@@ -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
 
@@ -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
@@ -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
@@ -42,6 +42,10 @@ namespace :bundle do
42
42
 
43
43
  sh "git init"
44
44
  sh "git add .gitignore"
45
+
46
+ sh "git config user.email 'you@example.com'"
47
+ sh "git config user.name 'Your Name'"
48
+
45
49
  sh "git commit -m 'A Commit Message'"
46
50
 
47
51
  sh "git config push.default current"
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.1.1.pre
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-21 00:00:00.000000000 Z
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`