omah-plugin-sqlite 0.1.0
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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/omah-plugin-sqlite.rb +39 -0
- metadata +88 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bcd3d9dd6d46470f136fc2042cc236c8bfabf46a
|
4
|
+
data.tar.gz: 81b8c25f5f598bbc90dd7f6ac93f5fbd8553692d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 77732f1a7b402ab7ea8452a469fd551187d501cafb174f49f794c75445b7e9d5b442a8f513b714f107e724c21633f43b66d3a7020cde87f4416ae8f2dc4b2992
|
7
|
+
data.tar.gz: 646dd6657419e58869a00d8c1ada08ca202284902ea9e53292362f64ee44a5e08e154a3108fdaed5c6931bb66041392140bc9a2657c719210ad915673c3b12ea
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: omah-plugin-sqlite.rb
|
4
|
+
|
5
|
+
require 'sqlite3'
|
6
|
+
|
7
|
+
class OmahPluginSqlite
|
8
|
+
|
9
|
+
def initialize(settings: {}, variables: {})
|
10
|
+
|
11
|
+
dbfile = settings[:dbfile]
|
12
|
+
|
13
|
+
unless File.exists? dbfile then
|
14
|
+
|
15
|
+
@db = SQLite3::Database.new dbfile
|
16
|
+
|
17
|
+
# Create a database
|
18
|
+
rows = @db.execute <<-SQL
|
19
|
+
create table headers (
|
20
|
+
uid integer primary key,
|
21
|
+
from_x varchar(50),
|
22
|
+
to_x varchar(50),
|
23
|
+
subject varchar(140),
|
24
|
+
date timestamp
|
25
|
+
|
26
|
+
);
|
27
|
+
SQL
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def on_newmessage(h)
|
34
|
+
|
35
|
+
@db.execute("INSERT INTO headers (uid, from_x, to_x, subject, date)
|
36
|
+
VALUES (?, ?, ?, ?, ?)", %i(uid from to subject date).map{|x| h[x]})
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omah-plugin-sqlite
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTE1MTEyMDE2MTM1MloXDTE2MTExOTE2MTM1MlowSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
+
ggEBAPHmXC1Mvy+ciMCL/NJlBT5mdgLqhf3mLfFNfgWB+QTMCm903+Bat8/DBLe5
|
19
|
+
1G6C+X6WB9noUyP5kGzZl1mHCHqCXFa0EtKtrT6qWasOzJvm/O0PigaKeJAR50x6
|
20
|
+
97Y8PFgDkieqaRc/Bme6C4tr2DA4xlxeo0qMvXkzDwrxuun9Pwp3ZKlTheskij29
|
21
|
+
BSsYcoL6fQfHA6h8GKc/hF08BLNPaL32suNiLt6espB8/tI6Ns9+8m/wLQQA6vgC
|
22
|
+
08AcfK8NyvpZmxetK7vnoLyvxdLJ/JxnnF2g3IgqfRUOa8sjzqoiVESca0xsD6Jk
|
23
|
+
rtwSp50NjZjqeeJa7M8dXrjkAj0CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUluovuzAazP6CSc89vMpV8y/HbS8wJgYDVR0RBB8w
|
25
|
+
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAerz5XvLo
|
27
|
+
/xb5C1LihCtglLR98ypXm6Qb/MaE1BufhleDIPXhpED7Udml1kVeFF5Tn0AOPp+A
|
28
|
+
OueoxfYd1KtQBheIC1WFHHGqTk1VhnNlGg/oiaXvNwdkPklwaofva7BWSXcI2YCl
|
29
|
+
OKHrJROj2IXC09JyyjUHNQO0r9WdoobvMvpZtdjH37mH0di6KVNO3NYuqGCIUbFy
|
30
|
+
GhjL0kq2nDcNi2WGnmgzXY0ExZ6v6U5h3Mdygf7nE4qWlyUcABSkarifBLtDoLqf
|
31
|
+
XLd73plHKkyDpP+udBZAVx4he+NB84YuuwUrP5sBpAPI3xJR3D5h6+Xn1LUSv1hE
|
32
|
+
TKYUpNlSwLyuTg==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: omah
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0.6'
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.6.12
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0.6'
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.6.12
|
56
|
+
description:
|
57
|
+
email: james@r0bertson.co.uk
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- lib/omah-plugin-sqlite.rb
|
63
|
+
homepage: https://github.com/jrobertson/omah-plugin-sqlite
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
metadata: {}
|
67
|
+
post_install_message:
|
68
|
+
rdoc_options: []
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 2.4.8
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: This Omah (Offline Mail Helper) gem plugin saves new email message headers
|
87
|
+
to a SQLite database.
|
88
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|