wcc 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -0
- data/assets/conf.yml +29 -0
- data/assets/filter.d/arg-test.rb +9 -0
- data/assets/filter.d/test.rb +4 -0
- data/assets/template.d/mail-plain.erb +7 -0
- data/bin/wcc-init +32 -0
- data/lib/wcc/mail.rb +2 -2
- metadata +13 -6
data/README.md
CHANGED
@@ -18,6 +18,18 @@ You need Ruby (preferably version 1.8.7) and Rubygems installed
|
|
18
18
|
|
19
19
|
(If you *don't* use [rvm](http://beginrescueend.com/) you should add a 'sudo'.)
|
20
20
|
|
21
|
+
Then you should pick an (empty!) directory for the configuration files (as 'conf.yml') for wcc
|
22
|
+
let's call it '/my/conf' for now. You do a
|
23
|
+
|
24
|
+
cd /my/conf
|
25
|
+
|
26
|
+
and then
|
27
|
+
|
28
|
+
wcc-init
|
29
|
+
|
30
|
+
At this time you should run the ´wcc´ command only in this directory since wcc reads it's
|
31
|
+
configuration by default from './conf.yml'.
|
32
|
+
|
21
33
|
Usage
|
22
34
|
-----
|
23
35
|
|
data/assets/conf.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# web-change-checker
|
2
|
+
|
3
|
+
conf:
|
4
|
+
from_addr: root@localhost
|
5
|
+
# cache_dir: /var/tmp/wcc
|
6
|
+
# tag: wcc
|
7
|
+
# use_syslog: yes
|
8
|
+
# filterd: ./filter.d
|
9
|
+
# templated: ./template.d
|
10
|
+
# email:
|
11
|
+
# smtp:
|
12
|
+
# host: localhost
|
13
|
+
# port: 25
|
14
|
+
|
15
|
+
sites:
|
16
|
+
- url: http://google.com/
|
17
|
+
emails:
|
18
|
+
- mail@example.com
|
19
|
+
- mail2@example.com
|
20
|
+
filters:
|
21
|
+
- test
|
22
|
+
- arg-test: {number: 5}
|
23
|
+
- url: https://my.secret.place/
|
24
|
+
emails:
|
25
|
+
- me@my.place
|
26
|
+
auth: {type: basic, username: me, password: secret}
|
27
|
+
- url: http://your.cms.com/
|
28
|
+
#emails: ...
|
29
|
+
cookie: file.cookie
|
data/bin/wcc-init
ADDED
@@ -0,0 +1,32 @@
|
|
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
|
+
#def traverse(path)
|
13
|
+
# path.children.each do |p|
|
14
|
+
# if p.directory?
|
15
|
+
# traverse(p)
|
16
|
+
# else
|
17
|
+
# puts p
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
#end
|
21
|
+
|
22
|
+
#traverse(src_d)
|
23
|
+
|
24
|
+
puts "Copying all files from '#{src_d}' to '#{cur_d}'..."
|
25
|
+
print "This will overwrite all existing files in destination directory if any - Continue? (y/n): "
|
26
|
+
answer = $stdin.gets
|
27
|
+
case answer
|
28
|
+
when "y\n"
|
29
|
+
FileUtils.cp_r src_d.to_s+'/.', cur_d.to_s, :verbose => true
|
30
|
+
else
|
31
|
+
puts "You didn't answer with 'y', done nothing."
|
32
|
+
end
|
data/lib/wcc/mail.rb
CHANGED
@@ -8,7 +8,7 @@ module WCC
|
|
8
8
|
@email = email.strip
|
9
9
|
end
|
10
10
|
|
11
|
-
# Extract the 'name' out of an mail address
|
11
|
+
# Extract the 'name' out of an mail address
|
12
12
|
# "Me <me@example.org>" -> "Me"
|
13
13
|
# "me2@example.org" -> "me2"
|
14
14
|
#
|
@@ -21,7 +21,7 @@ module WCC
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
# Return the real mail address
|
24
|
+
# Return the real mail address
|
25
25
|
# "Me <me@example.org>" -> "me@example.org"
|
26
26
|
# "me2@example.org" -> "me2@example.org"
|
27
27
|
#
|
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: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Nicolai
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: htmlentities
|
@@ -35,12 +35,19 @@ description: wcc tracks changes of websites and notifies you by email.
|
|
35
35
|
email: chrnicolai@gmail.com
|
36
36
|
executables:
|
37
37
|
- wcc
|
38
|
+
- wcc-init
|
38
39
|
extensions: []
|
39
40
|
|
40
|
-
extra_rdoc_files:
|
41
|
-
|
41
|
+
extra_rdoc_files:
|
42
|
+
- doc/Filters.md
|
43
|
+
- README.md
|
42
44
|
files:
|
45
|
+
- assets/conf.yml
|
46
|
+
- assets/filter.d/arg-test.rb
|
47
|
+
- assets/filter.d/test.rb
|
48
|
+
- assets/template.d/mail-plain.erb
|
43
49
|
- bin/wcc
|
50
|
+
- bin/wcc-init
|
44
51
|
- doc/Filters.md
|
45
52
|
- lib/wcc/filter.rb
|
46
53
|
- lib/wcc/mail.rb
|