canzea 0.1.107 → 0.1.108

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
  SHA1:
3
- metadata.gz: ba71b0ca102396c8325d24d2761e61038e9f2075
4
- data.tar.gz: d75380a8618c2bf7ea0d521eedadb981d081d9b6
3
+ metadata.gz: f1c154149608246d765d96d0023c8fb0635cca27
4
+ data.tar.gz: fd3b9d1b4e737d5c2eacceb781d63c6b267c6869
5
5
  SHA512:
6
- metadata.gz: dc87e8f4345afe339347b90814c75f9b77ea10366ed058cb713359086f1a721fb01f4837b34babbcf804a78d279e32ba70145c486b94cb9af97cbd3998e3f0a4
7
- data.tar.gz: 986d5509a51135ffb4fbb527f7aadea5afd4e49c182e2adba26a1095209c44bc199611a6250ad24c396d2b8b134a1b88cb26e258ba562c23ccef58dc8275bc0a
6
+ metadata.gz: 548a7d2ecd143697731eb0a4e49ab5da4fa7a8d0800edc18bc214e865c8ac54314d881300352e49f2ba37c417c920b65f2d27f5a077d11f63ae058c0447eda39
7
+ data.tar.gz: 2cde88c9525282d5337856fe16cd62d26fb9451d95c792b61aecc166e25d07fe2ea6219651e2b81a67305d86c04cecfd3ee94b1bf63936a58e6c377cc3e5bf73
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.107"
2
+ VERSION = "0.1.108"
3
3
  end
@@ -4,43 +4,50 @@ require "pathname"
4
4
 
5
5
  class ConfigGitCommit
6
6
  def do(gitRoot, sourcePath, template, parameters)
7
- # if file exists on file system and does not exist in gitRoot, then commit the "oem" file
7
+ begin
8
+ # if file exists on file system and does not exist in gitRoot, then commit the "oem" file
8
9
 
9
- if (File.exists?(sourcePath))
10
- dest = "#{gitRoot}/config#{Pathname.new(sourcePath).realpath}"
11
- else
12
- dest = "#{gitRoot}/config#{sourcePath}"
13
- end
14
- puts "Writing to #{dest}"
10
+ if (File.exists?(sourcePath))
11
+ dest = "#{gitRoot}/config#{Pathname.new(sourcePath).realpath}"
12
+ else
13
+ dest = "#{gitRoot}/config#{sourcePath}"
14
+ end
15
+ puts "Writing to #{dest}"
16
+
17
+ if (File.exist?(dest) == false and File.exist?(sourcePath))
18
+ FileUtils.mkdir_p Pathname.new(dest).dirname
19
+ FileUtils.cp sourcePath, dest
15
20
 
16
- if (File.exist?(dest) == false and File.exist?(sourcePath))
21
+ puts "Recording in repo the default file first: #{sourcePath}"
22
+ if (Canzea::config[:track_changes_in_git])
23
+ g = Git.init(gitRoot)
24
+ g.add(:all=>true)
25
+ g.commit("Original default #{sourcePath}")
26
+ end
27
+ end
28
+
29
+ if template
30
+ puts "Processing template #{template}"
31
+ FileUtils.mkdir_p Pathname.new(sourcePath).dirname
32
+ t = Template.new
33
+ t.processAndWriteToFile template, sourcePath, parameters
34
+ end
17
35
  FileUtils.mkdir_p Pathname.new(dest).dirname
18
36
  FileUtils.cp sourcePath, dest
19
37
 
20
- puts "Recording in repo the default file first: #{sourcePath}"
21
38
  if (Canzea::config[:track_changes_in_git])
22
39
  g = Git.init(gitRoot)
23
40
  g.add(:all=>true)
24
- g.commit("Original default #{sourcePath}")
25
- end
26
- end
27
-
28
- if template
29
- puts "Processing template #{template}"
30
- FileUtils.mkdir_p Pathname.new(sourcePath).dirname
31
- t = Template.new
32
- t.processAndWriteToFile template, sourcePath, parameters
33
- end
34
- FileUtils.mkdir_p Pathname.new(dest).dirname
35
- FileUtils.cp sourcePath, dest
36
-
37
- if (Canzea::config[:track_changes_in_git])
38
- g = Git.init(gitRoot)
39
- g.add(:all=>true)
40
- puts g.status.changed.size() + g.status.added.size()
41
- if (g.status.changed.size() > 0 or g.status.added.size() > 0)
42
- g.commit("Config update #{sourcePath}")
41
+ puts g.status.changed.size() + g.status.added.size()
42
+ if (g.status.changed.size() > 0 or g.status.added.size() > 0)
43
+ g.commit("Config update #{sourcePath}")
44
+ end
43
45
  end
46
+ rescue => exception
47
+ @log.error("ConfigGitCommit Failed")
48
+ @log.error(exception.to_s)
49
+ @log.error(exception.backtrace)
50
+ abort()
44
51
  end
45
52
  end
46
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.107
4
+ version: 0.1.108
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-28 00:00:00.000000000 Z
11
+ date: 2017-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler