eac_git 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_git/local.rb +1 -1
- data/lib/eac_git/local/dirty_files.rb +38 -0
- data/lib/eac_git/version.rb +1 -1
- data/vendor/git-subrepo/lib/git-subrepo.d/bash+.bash +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28dd90f9f4093cb73e60e731a5f759177d9e960784b540be3d8c0516c432a6fa
|
4
|
+
data.tar.gz: 81b8d1a37d8faa5729ed508edea4038444b988aed0e54996a998fd3ae4ff7bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f8d0081d1cb643126c51692008197cdad248e127441dac1dd8c273a12d2f81ed0245daa1928d06126ea2b685bd837aa5b98eab757bdd4a8430de78fafeb5286
|
7
|
+
data.tar.gz: 91b807fe713fae5dfe3aab764a140e079f4c4ec0a364f18ebd50a3066fbab3445f31c7b11c722913e08a7f91e21003d0d34abaf5254ebf9c0b23e923b12e10bf
|
data/lib/eac_git/local.rb
CHANGED
@@ -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
|
data/lib/eac_git/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
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.
|
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-
|
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
|
-
|
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.
|