between_meals 0.0.9 → 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: 4187ff23bfead830c0060f80b680700c3a704ab519e66c7781ef58812bf15a1f
4
- data.tar.gz: 9894dbd0357a7742a1ad20e22306814014199e53587dd24b7952d31c0602a4ee
3
+ metadata.gz: 14a2f47358db13a1a9c1fbf6c038fc6c13f9c45a972a42b72abc6c592e41aa86
4
+ data.tar.gz: 2be633f930866b32923a3e22a2eb2ccc30aa3e29d748d3ab71b3af49cc650410
5
5
  SHA512:
6
- metadata.gz: dbcba7682efd6869b714586ef98c78d7bc66fb08d7f006068ad2c346d46f543f0805be0b1efabd253b6218fc7fd55c6ed2aba093cf571c92fa155a6a8e35b6a5
7
- data.tar.gz: 3d77520b0ba7818363d05ee6e739d7bf5b895d1873660550991cacbd18d075e70ada620553a95818c0f55f59e746bfd1c3114da3fc6fc42f4e40bbfd0c384f09
6
+ metadata.gz: 1886e90d8bfaf9488f1dc919e8031aa334b98df14de5a51f7d1a86cad5dd11769cb2460427da2a9cca806537012ff765a43f31394da99e83218c2b2884fa885b
7
+ data.tar.gz: aa03b1ec64dea20775f6d9554caef8d295b826db5279e1bda6ecb944e9cf32a3e586370ddccc4c06550e94ad60ebd528c710c08c1869a6ce360cd3bcbbaf6527
data/README.md CHANGED
@@ -23,3 +23,6 @@ functions.
23
23
  * Mixlib::ShellOut
24
24
  * Rugged
25
25
 
26
+ ## License
27
+
28
+ See the `LICENSE` file in this repo.
@@ -71,6 +71,19 @@ module BetweenMeals
71
71
  files.each do |f|
72
72
  # a symlink will never have trailing '/', add one.
73
73
  f[:path] += '/' if f[:path] == lrp['link']
74
+
75
+ # If a metadata file in the path of a symlink target directory has a
76
+ # deleted status, check if a metadata file exists in the symlink
77
+ # source directory. If so, mark it as modified to prevent deletion.
78
+ symlink_source_dir = File.join(@repo_dir, lrp['source'])
79
+ if (f[:path] == File.join(lrp['link'], 'metadata.rb') ||
80
+ f[:path] == File.join(lrp['link'], 'metadata.json')) &&
81
+ f[:status] == :deleted &&
82
+ (File.file?(File.join(symlink_source_dir, 'metadata.rb')) ||
83
+ File.file?(File.join(symlink_source_dir, 'metadata.json')))
84
+ f[:status] = :modified
85
+ end
86
+
74
87
  next unless f[:path].start_with?(lrp['source'])
75
88
 
76
89
  # This make a deep dup of the file hash
@@ -33,13 +33,20 @@ module BetweenMeals
33
33
  c = Mixlib::ShellOut.new(
34
34
  cmd,
35
35
  :cwd => cwd,
36
+ :env => {
37
+ # macOS needs /usr/local/bin as hg cannot be installed in /bin or
38
+ # /usr/bin
39
+ 'PATH' => '/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin',
40
+ },
36
41
  )
37
- # macOS needs /usr/local/bin as hg cannot be installed in /bin or /usr/bin
38
- c.environment = {
39
- 'PATH' => '/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin',
40
- }
41
42
  c.run_command
42
- c.error!
43
+ if c.error?
44
+ # Let's make sure the error goes to the logs
45
+ @logger.error("#{@bin} failed: #{c.format_for_exception}")
46
+ # if our logger is STDOUT, we'll double log when we throw
47
+ # the exception, but that's OK
48
+ c.error!
49
+ end
43
50
  c
44
51
  end
45
52
  end
@@ -65,9 +65,9 @@ module BetweenMeals
65
65
 
66
66
  def update
67
67
  @cmd.pull.stdout
68
- rescue StandardError
68
+ rescue StandardError => e
69
69
  @logger.error('Something went wrong with hg!')
70
- @logger.error(cmd.stdout)
70
+ @logger.error(e)
71
71
  raise
72
72
  end
73
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: between_meals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Dibowitz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-14 00:00:00.000000000 Z
12
+ date: 2019-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.7.6
171
+ rubygems_version: 2.7.6.2
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Between Meals