pakman 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pakman/copier.rb +3 -3
- data/lib/pakman/erb/template.rb +2 -1
- data/lib/pakman/erb/templater.rb +4 -4
- data/lib/pakman/fetcher.rb +7 -7
- data/lib/pakman/manifest.rb +3 -3
- data/lib/pakman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84b0207602956da8a61d6ac6475638043b76a580
|
4
|
+
data.tar.gz: 8a636a9f82a459e9b76a1e915034645d930f2fc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecc8b14552bc878f573580983a1aaf6359625f907d27789b95b3c582c413e4d0f68ebc9e5991405a371a2a63e05e8a6df8d7dd48d7907b54d98267668637218b
|
7
|
+
data.tar.gz: 58120f4afcd9891a30c521426d8c7cc9752542e8313e41f973a25013fa21ef3003765d8cafdc7a91251b52c550b742a5a7b0fefa6d93780e3307e2e348a4ab78
|
data/lib/pakman/copier.rb
CHANGED
@@ -13,7 +13,7 @@ class Copier
|
|
13
13
|
|
14
14
|
pakname = Pakman.pakname_from_file( manifestsrc )
|
15
15
|
|
16
|
-
|
16
|
+
logger.info "Copying template pack '#{pakname}'"
|
17
17
|
|
18
18
|
## todo: after depreciate change back to just load_file
|
19
19
|
manifest = Manifest.load_file_v2( manifestsrc )
|
@@ -30,11 +30,11 @@ class Copier
|
|
30
30
|
logger.debug "destfull=>#{destfull}<"
|
31
31
|
logger.debug "destpath=>#{destpath}<"
|
32
32
|
|
33
|
-
|
33
|
+
logger.info " Copying to #{dest} from #{source}..."
|
34
34
|
FileUtils.copy( source, destfull )
|
35
35
|
end
|
36
36
|
|
37
|
-
|
37
|
+
logger.info "Done (in #{Time.now-start} s)."
|
38
38
|
end # method copy_pak
|
39
39
|
|
40
40
|
end # class Copier
|
data/lib/pakman/erb/template.rb
CHANGED
@@ -5,7 +5,8 @@ module Pakman
|
|
5
5
|
class ErbTemplate
|
6
6
|
|
7
7
|
def self.from_file( path )
|
8
|
-
|
8
|
+
## todo/fix: update logutils - (auto-)add ("static") logger helper/mixin too!!!!!
|
9
|
+
LogKernel::Logger[ self ].info " Loading template (from file) >#{path}<..."
|
9
10
|
text = File.open( path, 'r:bom|utf-8' ).read ## note: assume utf8
|
10
11
|
self.new( text, path: path ) ## note: pass along path as an option
|
11
12
|
end
|
data/lib/pakman/erb/templater.rb
CHANGED
@@ -17,7 +17,7 @@ class Templater
|
|
17
17
|
|
18
18
|
pakname = Pakman.pakname_from_file( manifestsrc )
|
19
19
|
|
20
|
-
|
20
|
+
logger.info "Merging template pack '#{pakname}'"
|
21
21
|
|
22
22
|
# todo: rename to load_file once depreated API got removed
|
23
23
|
manifest = Manifest.load_file_v2( manifestsrc )
|
@@ -39,20 +39,20 @@ class Templater
|
|
39
39
|
logger.debug "destpath=>#{destpath}<"
|
40
40
|
|
41
41
|
if source =~ /\.erb\.|.erb$/
|
42
|
-
|
42
|
+
logger.info " Merging to #{dest}..."
|
43
43
|
|
44
44
|
out = File.new( destfull, 'w+:utf-8' ) ## note: use utf8 (by default)
|
45
45
|
out << ErbTemplate.from_file( source ).render( binding )
|
46
46
|
out.flush
|
47
47
|
out.close
|
48
48
|
else
|
49
|
-
|
49
|
+
logger.info " Copying to #{dest} from #{source}..."
|
50
50
|
|
51
51
|
FileUtils.copy( source, destfull )
|
52
52
|
end
|
53
53
|
end # each entry in manifest
|
54
54
|
|
55
|
-
|
55
|
+
logger.info "Done (in #{Time.now-start} s)."
|
56
56
|
end # method merge_pak
|
57
57
|
|
58
58
|
end # class Templater
|
data/lib/pakman/fetcher.rb
CHANGED
@@ -30,14 +30,14 @@ class Fetcher
|
|
30
30
|
|
31
31
|
FileUtils.makedirs( pakpath ) unless File.directory?( pakpath )
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
logger.info "Fetching template pack '#{pakname}'"
|
34
|
+
logger.info " from '#{dlbase}'"
|
35
|
+
logger.info " saving to '#{pakpath}'"
|
36
36
|
|
37
37
|
# step 1: download manifest
|
38
38
|
manifestdest = "#{pakpath}/#{filename}"
|
39
39
|
|
40
|
-
|
40
|
+
logger.info " Downloading manifest '#{filename}'..."
|
41
41
|
|
42
42
|
fetch_file( manifestsrc, manifestdest )
|
43
43
|
|
@@ -59,14 +59,14 @@ class Fetcher
|
|
59
59
|
sourcefull = "#{dlbase}/#{source}"
|
60
60
|
|
61
61
|
if source =~ /\.erb\.|.erb$/
|
62
|
-
|
62
|
+
logger.info " Downloading template '#{source}'..."
|
63
63
|
else
|
64
|
-
|
64
|
+
logger.info " Downloading file '#{source}'..."
|
65
65
|
end
|
66
66
|
|
67
67
|
fetch_file( sourcefull, destfull )
|
68
68
|
end
|
69
|
-
|
69
|
+
logger.info "Done (in #{Time.now-start} s)."
|
70
70
|
end # method fetch_pak
|
71
71
|
|
72
72
|
private
|
data/lib/pakman/manifest.rb
CHANGED
@@ -12,7 +12,7 @@ class Manifest
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.load_file_core( old_logger_do_not_use, path )
|
15
|
-
puts "***
|
15
|
+
puts "*** deprecated API call [Pakman::Manifest.load_file_core] - do NOT pass in logger; no longer required/needed; logger arg will get removed"
|
16
16
|
|
17
17
|
obj = self.new
|
18
18
|
obj.load_file_core_worker( path )
|
@@ -20,7 +20,7 @@ class Manifest
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.load_file( old_logger_do_not_use, path )
|
23
|
-
puts "***
|
23
|
+
puts "*** deprecated API call [Pakman::Manifest.load_file] - do NOT pass in logger; no longer required/needed; logger arg will get removed"
|
24
24
|
|
25
25
|
obj = self.new
|
26
26
|
obj.load_file_worker( path )
|
@@ -73,7 +73,7 @@ class Manifest
|
|
73
73
|
def load_file_worker( path )
|
74
74
|
filename = path
|
75
75
|
|
76
|
-
|
76
|
+
logger.info " Loading template manifest #{filename}..."
|
77
77
|
load_file_core_worker( filename )
|
78
78
|
|
79
79
|
# post-processing
|
data/lib/pakman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pakman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fetcher
|