eac_git 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d73549410f4839f94dd14de3eba6c184467a96e9e984b59bf4db1f3b95993f68
4
- data.tar.gz: 424c428bd4d3c6b47fae518ede0c1e9aa6fbba78d3431833008d368c645da0fe
3
+ metadata.gz: 28dd90f9f4093cb73e60e731a5f759177d9e960784b540be3d8c0516c432a6fa
4
+ data.tar.gz: 81b8d1a37d8faa5729ed508edea4038444b988aed0e54996a998fd3ae4ff7bf7
5
5
  SHA512:
6
- metadata.gz: 10e25c6d1b5364ea1015c59642815823b5c35752e7ef1c0bc59a434a3a2229c3fb124a75d5a1b2ebdf2d729bc45379e6b0f78dd0df79454ef4739e71dff007ce
7
- data.tar.gz: ea40762796eb6152094a124bc44b54784b4c4efaeb9580a095266182a7544350990b9cd95bafbea2723c17e296730f6898bfeb78f81d30f844f8e0c5b9d1be3d
6
+ metadata.gz: 0f8d0081d1cb643126c51692008197cdad248e127441dac1dd8c273a12d2f81ed0245daa1928d06126ea2b685bd837aa5b98eab757bdd4a8430de78fafeb5286
7
+ data.tar.gz: 91b807fe713fae5dfe3aab764a140e079f4c4ec0a364f18ebd50a3066fbab3445f31c7b11c722913e08a7f91e21003d0d34abaf5254ebf9c0b23e923b12e10bf
@@ -6,7 +6,7 @@ require 'eac_ruby_utils/core_ext'
6
6
  module EacGit
7
7
  # A Git repository in local filesystem.
8
8
  class Local
9
- require_sub __FILE__
9
+ require_sub __FILE__, include_modules: true
10
10
 
11
11
  common_constructor :root_path do
12
12
  self.root_path = root_path.to_pathname
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ostruct'
5
+
6
+ module EacGit
7
+ class Local
8
+ module DirtyFiles
9
+ STATUS_LINE_PATTERN = /\A(.)(.)\s(.+)\z/.freeze
10
+
11
+ def dirty?
12
+ dirty_files.any?
13
+ end
14
+
15
+ def dirty_file?(path)
16
+ absolute_path = path.to_pathname.expand_path(root_path)
17
+ dirty_files.any? do |df|
18
+ df.absolute_path == absolute_path
19
+ end
20
+ end
21
+
22
+ def dirty_files
23
+ command('status', '--porcelain', '--untracked-files').execute!.each_line.map do |line|
24
+ parse_status_line(line.gsub(/\n\z/, ''))
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def parse_status_line(line)
31
+ STATUS_LINE_PATTERN.if_match(line) do |m|
32
+ ::OpenStruct.new(index: m[1], worktree: m[2], path: m[3].to_pathname,
33
+ absolute_path: m[3].to_pathname.expand_path(root_path))
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacGit
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -1 +1 @@
1
- vendor/git-subrepo/lib/git-subrepo.d/../../ext/bashplus/lib/bash+.bash
1
+ ../../ext/bashplus/lib/bash+.bash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2020-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -73,6 +73,7 @@ files:
73
73
  - lib/eac_git.rb
74
74
  - lib/eac_git/executables.rb
75
75
  - lib/eac_git/local.rb
76
+ - lib/eac_git/local/dirty_files.rb
76
77
  - lib/eac_git/local/subrepo.rb
77
78
  - lib/eac_git/local/subrepo/config.rb
78
79
  - lib/eac_git/remote.rb
@@ -282,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
283
  - !ruby/object:Gem::Version
283
284
  version: '0'
284
285
  requirements: []
285
- rubyforge_project:
286
- rubygems_version: 2.7.7
286
+ rubygems_version: 3.0.6
287
287
  signing_key:
288
288
  specification_version: 4
289
289
  summary: Put here de description.