wcc 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/assets/template.d/{mail-plain.erb → mail.plain.erb} +0 -0
- data/bin/wcc-init +0 -0
- data/bin/wcc-upgrade +34 -0
- data/lib/wcc.rb +1 -1
- metadata +6 -4
File without changes
|
data/bin/wcc-init
CHANGED
File without changes
|
data/bin/wcc-upgrade
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
bin_d = Pathname.new(File.expand_path(File.dirname(__FILE__)))
|
8
|
+
cur_d = Pathname.new(Dir.getwd)
|
9
|
+
|
10
|
+
src_d = bin_d.parent + "assets"
|
11
|
+
|
12
|
+
# not beautiful but works
|
13
|
+
def traverse(root, dst_root, path)
|
14
|
+
path.children.each do |p|
|
15
|
+
if p.directory?
|
16
|
+
traverse(root, dst_root, p)
|
17
|
+
else
|
18
|
+
rel = p.relative_path_from(root)
|
19
|
+
src = root + rel
|
20
|
+
dst = dst_root + rel
|
21
|
+
if dst.exist?
|
22
|
+
print "Do you want to overwrite #{dst}? (y/n): "
|
23
|
+
answer = $stdin.gets
|
24
|
+
if answer == "y\n"
|
25
|
+
FileUtils.cp src, dst, :verbose => true
|
26
|
+
end
|
27
|
+
else
|
28
|
+
FileUtils.cp src, dst, :verbose => true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
traverse(src_d, cur_d, src_d)
|
data/lib/wcc.rb
CHANGED
@@ -345,7 +345,7 @@ module WCC
|
|
345
345
|
# first use of Conf initializes it
|
346
346
|
WCC.logger = Logger.new(STDOUT)
|
347
347
|
|
348
|
-
mp_path = File.join(Conf[:template_dir], 'mail
|
348
|
+
mp_path = File.join(Conf[:template_dir], 'mail.plain.erb')
|
349
349
|
mp = File.open(mp_path, 'r') { |f| f.read }
|
350
350
|
@@mail_plain = ERB.new(mp)
|
351
351
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Nicolai
|
@@ -36,6 +36,7 @@ email: chrnicolai@gmail.com
|
|
36
36
|
executables:
|
37
37
|
- wcc
|
38
38
|
- wcc-init
|
39
|
+
- wcc-upgrade
|
39
40
|
extensions: []
|
40
41
|
|
41
42
|
extra_rdoc_files:
|
@@ -45,9 +46,10 @@ files:
|
|
45
46
|
- assets/conf.yml
|
46
47
|
- assets/filter.d/arg-test.rb
|
47
48
|
- assets/filter.d/test.rb
|
48
|
-
- assets/template.d/mail
|
49
|
+
- assets/template.d/mail.plain.erb
|
49
50
|
- bin/wcc
|
50
51
|
- bin/wcc-init
|
52
|
+
- bin/wcc-upgrade
|
51
53
|
- doc/Filters.md
|
52
54
|
- lib/wcc/filter.rb
|
53
55
|
- lib/wcc/mail.rb
|