label_weaver 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f84d950482825eab6d7306ec2ea04c3434ab0c79cb1ae0b7a836b6ff6fe4208
4
- data.tar.gz: 56c21daba6bfd11e1d774efc734ddb03c8867fece5a63181934aef561823cf40
3
+ metadata.gz: 290288a3de5f82f2011f9dbd603e6b9f8ee369bb64ffdc77c544004f4dc6e5e8
4
+ data.tar.gz: 9377d8b8a5a46c8630a9d0f3ba6e38189ff68dd1679b84cc6b4a2bdc1058c11a
5
5
  SHA512:
6
- metadata.gz: b2fb78c636d8a63f7617dffe8511b422906b63109a97074cf6f27002b94fc22c49ae8a3b8ee102e72cd0ce782e22bbab3b2c33590919aad1bd125b1c9e2069ac
7
- data.tar.gz: 71e54ccbd1de7f76252287427741a1bcbe1af97bfad6904b21c130d226534ec63d86eca5916dbfe18b62fdb1004c64803fd1273feb7e8a64b1605924c0e2e756
6
+ metadata.gz: 8b12f4ed0bb7cef83d3066680a623ba9d8ef03b67ea643b684ba985aee57e7d1502b573519d242942dc01f1af91a422c79ae605eada47d4510265c874924e9c8
7
+ data.tar.gz: 1cf1ff573c45a3972e46dce59bca1f432aec28e7f275ce15c0dcd98401f0f75b54063aae5db24763339a275b0329eab77ae2b022e53fc6b09ed9b81a702282fd
data/label_weaver.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "label_weaver"
5
- spec.version = "0.0.8"
5
+ spec.version = "0.0.10"
6
6
  spec.authors = ["Stefan Exner"]
7
7
  spec.email = ["stex@stex.codes"]
8
8
  spec.homepage = "https://gitlab.com/lopo-tech/label_weaver"
@@ -42,8 +42,8 @@ module LabelWeaver
42
42
  # If the file is forced, we need to delete the existing file if it exists.
43
43
  FileUtils.rm_f(project_file) if project_file.exist?
44
44
  elsif Util.file_exists?(project_file)
45
- if repo.timestamp_for(repository_file) > project_file.mtime
46
- logger.warn "File '#{relative_filename}' has a newer version in the remote repository (#{repo.timestamp_for(repository_file)} vs #{project_file.mtime})."
45
+ if repo.timestamp_for(repository_file) > Util.mtime(project_file)
46
+ logger.warn "File '#{relative_filename}' has a newer version in the remote repository (#{repo.timestamp_for(repository_file)} vs #{Util.mtime(project_file)})."
47
47
  end
48
48
 
49
49
  logger.debug "Skipping '#{relative_filename}'..."
@@ -43,7 +43,7 @@ module LabelWeaver
43
43
  remove_empty_tree(project_file.dirname)
44
44
  elsif Util.file_exists?(project_file)
45
45
  if Util.digest(project_file) != Util.digest(repository_file)
46
- logger.debug "File '#{relative_filename}' is kept as it was changed in the whitelabel project (r: #{repo.timestamp_for(repository_file)} vs w: #{project_file.mtime})."
46
+ logger.debug "File '#{relative_filename}' is kept as it was changed in the whitelabel project (r: #{repo.timestamp_for(repository_file)} vs w: #{Util.mtime(project_file)})."
47
47
  else
48
48
  logger.debug "Deleting file '#{relative_filename}'..."
49
49
  project_file.unlink
@@ -20,7 +20,7 @@ module LabelWeaver
20
20
  @repository_path = repository_path
21
21
  @repository_url = repository_url
22
22
  @branch = branch
23
- @excluded_upstream_files = excluded_upstream_files + %w[. ..]
23
+ @excluded_upstream_files = excluded_upstream_files + %w[. .. .git/**]
24
24
  @forced_upstream_files = forced_upstream_files
25
25
  @logger = logger
26
26
  end
@@ -14,5 +14,14 @@ module LabelWeaver
14
14
  file.symlink? || file.exist?
15
15
  end
16
16
  module_function :file_exists?
17
+
18
+ def mtime(file)
19
+ if file.symlink? && !file.exist?
20
+ 0
21
+ else
22
+ file.mtime
23
+ end
24
+ end
25
+ module_function :mtime
17
26
  end
18
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: label_weaver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Exner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-01 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cogger