postfix_status_line 0.1.5 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acb7606470d80a2813ba8d50eaae1daf882731b0
4
- data.tar.gz: caa4474fdd96b24c0f1bc16e9572a84424023934
3
+ metadata.gz: c74111143a620177a8d42e331fb6db8bec991624
4
+ data.tar.gz: e670baf832cc96497443b113de38211cb72c3b22
5
5
  SHA512:
6
- metadata.gz: 6360bdf590686caea775f8ff732e65d2d2ea35e7a808bbdf2a2db3d39eaa6cac032f040c9074b3c5ad3275e60849e43cdc27622bb9ea58757b5b59176d90ca36
7
- data.tar.gz: f5025a3ff875b364ccd48d8deee65fe0bdc59f620ef1265cea3522f405ff5eef45a53051eb10dde869aa25188723ddbe0333834ffd2e2682f7f3fe36cf460317
6
+ metadata.gz: 83090fc2af2f238d61de9eb71f428d6266dfdd518aeeecddcb0e10a8bae60c5a9f365672e610bcafcb9bcc0a747d29c69ac7bec72b73f88a5f2f0520b30c1b96
7
+ data.tar.gz: 6354c6cad36dcfb88e06e4d5eb8b2c84e82ce93becbf937557530983672d970c036675789e69eba473f4d28dd69fb82487ddb7f93d599d19d55c095d15b546c6
data/README.md CHANGED
@@ -38,7 +38,7 @@ PostfixStatusLine.parse(status_line)
38
38
  # "relay" => "gateway-f1.isp.att.net[204.127.217.16]:25",
39
39
  # "status" => "sent",
40
40
  # "status_detail" => "(250 ok ; id=20120227140036M0700qer4ne)",
41
- # "time" => 1424995357,
41
+ # "time" => "Feb 8 09:02:37",
42
42
  # "to" => "<*******@bellsouth.net>",
43
43
  # "domain" => "bellsouth.net"
44
44
  # }
@@ -1,8 +1,8 @@
1
1
  #include "postfix_status_line_core.h"
2
2
 
3
- static char *split(char **orig_str, char *delim, size_t delim_len) {
3
+ static char *split(char **orig_str, const char *delim, size_t delim_len) {
4
4
  char *str = *orig_str;
5
- char *ptr = strstr(str, delim);
5
+ char *ptr = strstr((const char *) str, delim);
6
6
 
7
7
  if (ptr == NULL) {
8
8
  return NULL;
@@ -187,23 +187,6 @@ static void split_line2(char *str, int mask, VALUE hash) {
187
187
  }
188
188
  }
189
189
 
190
- static void put_time(char *str, VALUE hash) {
191
- time_t now = time(NULL);
192
- struct tm *t = localtime(&now);
193
-
194
- if (strptime(str, "%b %d %H:%M:%S", t) == NULL) {
195
- return;
196
- }
197
-
198
- time_t epoch = mktime(t);
199
-
200
- if (epoch == -1) {
201
- return;
202
- }
203
-
204
- rb_hash_aset(hash, rb_str_new2("time"), LONG2NUM(epoch));
205
- }
206
-
207
190
  static VALUE rb_postfix_status_line_parse(VALUE self, VALUE v_str, VALUE v_mask) {
208
191
  Check_Type(v_str, T_STRING);
209
192
 
@@ -232,7 +215,7 @@ static VALUE rb_postfix_status_line_parse(VALUE self, VALUE v_str, VALUE v_mask)
232
215
  }
233
216
 
234
217
  VALUE hash = rb_hash_new();
235
- put_time(tm, hash);
218
+ rb_hash_aset(hash, rb_str_new2("time"), rb_str_new2(tm));
236
219
  rb_hash_aset(hash, rb_str_new2("hostname"), rb_str_new2(hostname));
237
220
  rb_hash_aset(hash, rb_str_new2("process"), rb_str_new2(process));
238
221
  rb_hash_aset(hash, rb_str_new2("queue_id"), rb_str_new2(queue_id));
@@ -1,3 +1,3 @@
1
1
  module PostfixStatusLine
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postfix_status_line
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara