lace 0.3.4 → 0.4.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 +8 -8
- data/lib/cmd/list.rb +1 -1
- data/lib/lace/download_strategy.rb +11 -2
- data/lib/lace/package/package.rb +6 -0
- data/lib/lace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmM4ZTMxYjE1NTNmNjM4MWEzZjFlYTNhMTMyMDNjZDc3OGQ3NjYzMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTc1ZTA0YjA0NjViMmU4YjFmNTJkM2VjMGViMzg4M2Q2NzFlMDU0ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzBjYzBkZDc3ZjI4ZjU0NmIxNWRkZDQ1Nzk1ODYwNDFmMGU4MjY3NGJkMTFm
|
10
|
+
MmQ3ZWNmY2I1ODJkYWNmZTNkMWYyNGFhODJlYTBhYjRjOWVmMTMwODI1Yzg2
|
11
|
+
MzljNDBmMWU4YzAwMzI4NGFmNjQ1ZmM4ZDNkNjIwMDkyODhmNzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjQwYjBjN2QyYWY4ZDJhMjc3ZGJjYjdlM2VhNjRjYzU3ZGFlY2Y0MDIyZTdm
|
14
|
+
M2NlZGJlZTU5NjVhMjRlZTExNDcyOTc0MDI1OTdhMGU4ODMzMjgxYmJkNjA3
|
15
|
+
YzUzYWE5NzQwZTZhZDY3ZGU4NmFhOGJmNDllNTdhYmY5NjY3MTY=
|
data/lib/cmd/list.rb
CHANGED
@@ -26,7 +26,7 @@ module Lace extend self
|
|
26
26
|
if installed_packages.length > 0
|
27
27
|
installed_packages.map do |d|
|
28
28
|
package = Package.new(d, false)
|
29
|
-
puts "[#{Tty.green}#{package.is_active? ? "*" : " "}#{Tty.reset}] #{d}"
|
29
|
+
puts "[#{Tty.green}#{package.is_active? ? "*" : " "}#{Tty.reset}] #{d}#{package.is_modified? ? " (has local changes)":""}"
|
30
30
|
end
|
31
31
|
else
|
32
32
|
puts "There are no pkgs installed"
|
@@ -75,6 +75,15 @@ module GitCommands
|
|
75
75
|
quiet_system "git", "--git-dir", git_dir, "status", "-s"
|
76
76
|
end
|
77
77
|
|
78
|
+
def repo_modified?
|
79
|
+
@target_folder.cd do
|
80
|
+
result = `git status --porcelain`
|
81
|
+
result.split("\n").any? do |line|
|
82
|
+
line =~ /^ M/
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
78
87
|
def submodules?
|
79
88
|
@target_folder.join(".gitmodules").exist?
|
80
89
|
end
|
@@ -157,12 +166,12 @@ class GitDownloadStrategy < AbstractDownloadStrategy
|
|
157
166
|
end
|
158
167
|
|
159
168
|
class AbbrevGitDownloadStrategy < GitDownloadStrategy
|
160
|
-
def initialize uri
|
169
|
+
def initialize uri, desired_package_name=nil
|
161
170
|
unless uri.end_with?(".git")
|
162
171
|
uri = "#{uri}.git"
|
163
172
|
end
|
164
173
|
uri = "https://github.com/#{uri}"
|
165
|
-
super uri
|
174
|
+
super uri, desired_package_name
|
166
175
|
end
|
167
176
|
end
|
168
177
|
|
data/lib/lace/package/package.rb
CHANGED
@@ -39,6 +39,12 @@ class Package
|
|
39
39
|
repo_valid?
|
40
40
|
end
|
41
41
|
|
42
|
+
def is_modified?
|
43
|
+
return false unless is_git_repo?
|
44
|
+
@target_folder = @path
|
45
|
+
repo_modified?
|
46
|
+
end
|
47
|
+
|
42
48
|
def is_active?
|
43
49
|
if @facts.has_flavors? && @flavor == false
|
44
50
|
@facts.flavors.any?{|f| Package.new(@name, f).is_active?}
|
data/lib/lace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kai Richard Koenig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Lace lets you manage your dotfiles when using them on multiple machines
|
14
14
|
email: kai@kairichardkoenig.de
|