uron 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -2
  3. data/README.md +28 -16
  4. data/bin/uron.rb +7 -2
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c3fd3a3d7da61594f5acf17e0543a8b022cdb28
4
- data.tar.gz: f311b5bf137a009b20917816698a3fd2b645cd22
3
+ metadata.gz: 072c0d933a2d856884ac242e14aa43d492a67b0c
4
+ data.tar.gz: 0c6314192d29d6e07b2138f996ff12c068ce3e06
5
5
  SHA512:
6
- metadata.gz: 656a133a04b2eb9b333034e581ff4ebfb7a9347fd28ba724527faf750c619c23cecc384c58ea3ab449c919549bc7e84b5caf7da79af0df4d1822931b76139434
7
- data.tar.gz: 300f29edaa9d2a25c9901e9002ac197eb374ca2992b37e1e69152c1714997df40ceea339b5cbcb15086c421ea0f18efe96af60b4f3b755875f70f227a565ad20
6
+ metadata.gz: b67e1876044aeecf5fa4632d6d38b5cdfbaf45b64ae7dd8ee946ff75c7b59391bf595ef3a4382d2694e311478a2a3fd7a304933c6486d44079da1d105ccf2b57
7
+ data.tar.gz: e5b1b16a386bc3d3d4cfe2f460d79342b742d39cf9d758c2ba4997a067d630384633e55bc0f998fa7cb9f68252367be75968f18b47d04683e6413376dcee74b7
@@ -4,7 +4,5 @@ rvm:
4
4
  - 2.2.5
5
5
  - 2.1.10
6
6
  - 2.0.0
7
- - 1.9.3
8
- - 1.8.7
9
7
  script:
10
8
  - bundle exec rake build test
data/README.md CHANGED
@@ -17,7 +17,7 @@ Currently, uron has not been tested well yet.
17
17
  Requirement
18
18
  -----------
19
19
 
20
- Ruby 1.8.7, 1.9.3 or later.
20
+ Ruby 1.8.7, 1.9.3 or later. (Recommended 2.2 or later.)
21
21
 
22
22
  uron assumes that your system follows the Maildir specification.
23
23
 
@@ -71,23 +71,29 @@ If a block is passed, call the block.
71
71
 
72
72
  Examples:
73
73
 
74
- header :subject => /\A[mailing-list:/, :delivery => "mailing-list"
74
+ ```Ruby
75
+ header :subject => /\A[mailing-list:/, :delivery => "mailing-list"
76
+ ```
75
77
 
76
78
  This means that if the subject of the mail starts with `[mailing-list:`,
77
79
  delivery the mail to `mailing-list` directory (it's relative from your
78
80
  Maildir.)
79
81
 
80
- header :subject => /\A[mailing-list:/ do
81
- delivery "mailing-list"
82
- end
82
+ ```Ruby
83
+ header :subject => /\A[mailing-list:/ do
84
+ delivery "mailing-list"
85
+ end
86
+ ```
83
87
 
84
88
  Same as above.
85
89
 
86
90
  If you want to check multiple headers, simple put them as:
87
91
 
88
- header :subject => /\A[mailing-list:/,
89
- :from => /\Amailing-list-owner\b/,
90
- :delivery => "mailing-list"
92
+ ```Ruby
93
+ header :subject => /\A[mailing-list:/,
94
+ :from => /\Amailing-list-owner\b/,
95
+ :delivery => "mailing-list"
96
+ ```
91
97
 
92
98
  When `subject` and `from` are both matched, the mail will be delivered to `mailling-list` directory.
93
99
 
@@ -102,7 +108,9 @@ The parameter must be relative from your Maildir.
102
108
 
103
109
  Examples:
104
110
 
105
- delivery "mailing-list"
111
+ ```Ruby
112
+ delivery "mailing-list"
113
+ ```
106
114
 
107
115
  #### `transfer`
108
116
 
@@ -111,7 +119,9 @@ specfied by the parameters.
111
119
 
112
120
  Examples:
113
121
 
114
- transfer "some.host.of.example.com", "foo@example.com"
122
+ ```Ruby
123
+ transfer "some.host.of.example.com", "foo@example.com"
124
+ ```
115
125
 
116
126
  #### `invoke`
117
127
 
@@ -123,11 +133,13 @@ Returns the status value of the command.
123
133
 
124
134
  Examples:
125
135
 
126
- if invoke("bsfilter", "-a") == 0
127
- delivery ".spam"
128
- else
129
- false
130
- end
136
+ ```Ruby
137
+ if invoke("bsfilter", "-a") == 0
138
+ delivery ".spam"
139
+ else
140
+ false
141
+ end
142
+ ```
131
143
 
132
144
  #### `logging`
133
145
 
@@ -137,7 +149,7 @@ Takes one String parameter and outout it to the log file.
137
149
  License
138
150
  -------
139
151
 
140
- Copyright (c) 2012,2014 NAKAMURA Usaku usa@garbagecollect.jp
152
+ Copyright (c) 2012 NAKAMURA Usaku usa@garbagecollect.jp
141
153
 
142
154
  Redistribution and use in source and binary forms, with or without
143
155
  modification, are permitted provided that the following conditions are met:
@@ -34,7 +34,7 @@ require "socket"
34
34
  #= uron - a mail delivery agent
35
35
  #
36
36
  class Uron
37
- VERSION = "1.2.0"
37
+ VERSION = "1.3.0"
38
38
 
39
39
  ConfigError = Class.new(RuntimeError)
40
40
 
@@ -307,11 +307,15 @@ if __FILE__ == $0
307
307
  require "optparse"
308
308
 
309
309
  rcfile = "~/.uronrc"
310
+ check_only = false
310
311
 
311
312
  opt = OptionParser.new
312
313
  opt.on('-r RCFILE', '--rc', 'use RCFILE as the ruleset configurations.') do |v|
313
314
  rcfile = v
314
315
  end
316
+ opt.on('-c', '--check', 'check rcfile syntax only.') do
317
+ check_only = true
318
+ end
315
319
  opt.parse!
316
320
  unless ARGV.empty?
317
321
  $stderr.puts "unknown argument(s): #{ARGV.join(' ')}"
@@ -321,7 +325,8 @@ if __FILE__ == $0
321
325
  end
322
326
 
323
327
  begin
324
- exit Uron.run(File.expand_path(rcfile))
328
+ uron = Uron.new(File.expand_path(rcfile))
329
+ exit uron.run unless check_only
325
330
  rescue
326
331
  $stderr.puts "#{$!.class}: #{$!.message}"
327
332
  $stderr.puts $!.backtrace.join("\n\t")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uron
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - U.Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-13 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler