canzea 0.1.108 → 0.1.109

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: f1c154149608246d765d96d0023c8fb0635cca27
4
- data.tar.gz: fd3b9d1b4e737d5c2eacceb781d63c6b267c6869
3
+ metadata.gz: 4ff9a513705220c4c00ad9e961317295b7bed833
4
+ data.tar.gz: 66c21e800e7ecaa2bb3191599776c1a506bc434f
5
5
  SHA512:
6
- metadata.gz: 548a7d2ecd143697731eb0a4e49ab5da4fa7a8d0800edc18bc214e865c8ac54314d881300352e49f2ba37c417c920b65f2d27f5a077d11f63ae058c0447eda39
7
- data.tar.gz: 2cde88c9525282d5337856fe16cd62d26fb9451d95c792b61aecc166e25d07fe2ea6219651e2b81a67305d86c04cecfd3ee94b1bf63936a58e6c377cc3e5bf73
6
+ metadata.gz: 3b5e33c9b1bc8879e1b7895c43621bae83f437a007a1a2f556fc2b92361e678468a6e117a89fd59fc983dadd3c47ae111b01bab79c5ee854037ae1ad7a1e6bbb
7
+ data.tar.gz: 5e724a8e6aca2804986c07f40a8dcd67f33010543f74b42db694f3083a523cfc2730b9a7deb78f2138bc21adba689d1a66be81f8a7860150e05c3219e59f9e74
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.108"
2
+ VERSION = "0.1.109"
3
3
  end
@@ -3,6 +3,10 @@ require "fileutils"
3
3
  require "pathname"
4
4
 
5
5
  class ConfigGitCommit
6
+ def initialize ()
7
+ @log = Logger.new(Canzea::config[:logging_root] + '/plans.log')
8
+ end
9
+
6
10
  def do(gitRoot, sourcePath, template, parameters)
7
11
  begin
8
12
  # if file exists on file system and does not exist in gitRoot, then commit the "oem" file
@@ -12,13 +16,13 @@ class ConfigGitCommit
12
16
  else
13
17
  dest = "#{gitRoot}/config#{sourcePath}"
14
18
  end
15
- puts "Writing to #{dest}"
19
+ log "Writing to #{dest}"
16
20
 
17
21
  if (File.exist?(dest) == false and File.exist?(sourcePath))
18
22
  FileUtils.mkdir_p Pathname.new(dest).dirname
19
23
  FileUtils.cp sourcePath, dest
20
24
 
21
- puts "Recording in repo the default file first: #{sourcePath}"
25
+ log "Recording in repo the default file first: #{sourcePath}"
22
26
  if (Canzea::config[:track_changes_in_git])
23
27
  g = Git.init(gitRoot)
24
28
  g.add(:all=>true)
@@ -27,18 +31,18 @@ class ConfigGitCommit
27
31
  end
28
32
 
29
33
  if template
30
- puts "Processing template #{template}"
34
+ log "Processing template #{template}"
31
35
  FileUtils.mkdir_p Pathname.new(sourcePath).dirname
32
36
  t = Template.new
33
37
  t.processAndWriteToFile template, sourcePath, parameters
34
38
  end
35
39
  FileUtils.mkdir_p Pathname.new(dest).dirname
36
- FileUtils.cp sourcePath, dest
40
+ FileUtils.cp sourcePath, dest, :verbose => true
37
41
 
38
42
  if (Canzea::config[:track_changes_in_git])
39
43
  g = Git.init(gitRoot)
40
44
  g.add(:all=>true)
41
- puts g.status.changed.size() + g.status.added.size()
45
+ log "#{g.status.changed.size() + g.status.added.size()}"
42
46
  if (g.status.changed.size() > 0 or g.status.added.size() > 0)
43
47
  g.commit("Config update #{sourcePath}")
44
48
  end
@@ -50,4 +54,10 @@ class ConfigGitCommit
50
54
  abort()
51
55
  end
52
56
  end
57
+
58
+ def log (msg)
59
+ puts msg
60
+ @log.info(msg)
61
+ end
62
+
53
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.108
4
+ version: 0.1.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies