teapot 3.5.1 → 3.5.3

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: 97ace82267f885a0c08463e11c4d287fb8f3925305fcb8fd054ea6ae3ed1f959
4
- data.tar.gz: f365dd8ae5ed06725236fe7eb5723251c3441bb30069fd41bd9f081b817a9ef4
3
+ metadata.gz: 07b32fe7cada8717c48838a537d67f16847a2dbe649e7642a36c23c94bcade3f
4
+ data.tar.gz: 4b8a7bdccf99fd72286e3e39b9c81e276ad7d4cec13328d4cc19db5c0db46224
5
5
  SHA512:
6
- metadata.gz: e97038ad00666d18ca716fce16f641180988b5ec5f71a162e38c68d9c69e843399a8bbf6adb75c46e7470980aff08df4be9c8ca4aabe6b157360da43a9a65269
7
- data.tar.gz: 70772f52abb1b14cb4141cbf0f383be68a4716acd8a4ee1b4b26b60d2aa2a684752a834c5268365e37dbdce95933e8309ee77ec04d41900ede455c982b186236
6
+ metadata.gz: cc50bb10bfbd6c2055c1c0c1582b21bddf2a5cec6f5f3c0b0e8bba604969c329f24405726cf2dd947531cf527efeb92f54b0c2236aa8513b3376c6832a302a08
7
+ data.tar.gz: 39cfa9e57f70cac8d1fd719b30c6049f39158e7c8b31a43fee4fd57231c617cc5bf5434c468a124a673d45e6640d45ab3a380a051d194ad43e37c4fc18880053
checksums.yaml.gz.sig CHANGED
Binary file
@@ -122,7 +122,15 @@ module Teapot
122
122
  # We should prompt for username/password if required...
123
123
  return Rugged::Credentials::SshKeyFromAgent.new(username: username)
124
124
  end
125
-
125
+
126
+ def modified?(repository)
127
+ repository.status.each do |path, status|
128
+ return true if status != [:ignored]
129
+ end
130
+
131
+ return false
132
+ end
133
+
126
134
  def clone_or_pull_package(context, configuration, package, package_lock, logger)
127
135
  logger.info "Processing #{package}..." #.color(:cyan)
128
136
 
@@ -150,7 +158,7 @@ module Teapot
150
158
  repository = Rugged::Repository.new(destination_path.to_s)
151
159
 
152
160
  # Are there uncommitted changes in the work tree?
153
- if repository.to_enum(:status).any?
161
+ if modified?(repository)
154
162
  raise FetchError.new(package, "Uncommited local modifications")
155
163
  end
156
164
 
@@ -35,26 +35,33 @@ module Teapot
35
35
  end
36
36
  end
37
37
 
38
+ def repository_for(package)
39
+ Rugged::Repository.new(package.path.to_s)
40
+ rescue Rugged::RepositoryError
41
+ # In some cases, a repository might not exist yet, so just skip the package.
42
+ nil
43
+ end
44
+
38
45
  def process(selection)
39
46
  context = selection.context
40
47
  terminal = self.terminal
41
48
 
42
49
  selection.resolved.each do |package|
43
- repository = Rugged::Repository.new(package.path.to_s)
44
-
45
- changes = {}
46
- repository.status do |file, status|
47
- unless status == [:ignored]
48
- changes[file] = status
50
+ if repository = repository_for(package)
51
+ changes = {}
52
+ repository.status do |file, status|
53
+ unless status == [:ignored]
54
+ changes[file] = status
55
+ end
56
+ end
57
+
58
+ next if changes.empty?
59
+
60
+ terminal.puts "Package #{package.name} (from #{package.path}):"
61
+
62
+ changes.each do |file, statuses|
63
+ terminal.puts "\t#{file} (#{statuses})", style: statuses.last
49
64
  end
50
- end
51
-
52
- next if changes.empty?
53
-
54
- terminal.puts "Package #{package.name} (from #{package.path}):"
55
-
56
- changes.each do |file, statuses|
57
- terminal.puts "\t#{file} (#{statuses})", style: statuses.last
58
65
  end
59
66
  end
60
67
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Teapot
22
- VERSION = "3.5.1"
22
+ VERSION = "3.5.3"
23
23
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teapot
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 3.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2023-04-05 00:00:00.000000000 Z
40
+ date: 2023-04-23 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: build
metadata.gz.sig CHANGED
Binary file