omah_search 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_search.rb +34 -0
- metadata +108 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c53301f944538a93efdc09e66f8358f94392493a
|
4
|
+
data.tar.gz: 659624930cff0dad0ac99d44e130ec6fe202195b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 28101579e202b303b295b767b081f0e67fe26d9d673fc4947accd199c925d1fec46e29bd76348901df1656f289662b52210feb3314b869923ba0ff8f24986d60
|
7
|
+
data.tar.gz: ab2a9ca8a9e43fa342333202fed4deb0cdb8c239e273e3afd72e8c8d08a51d268daed772658df6df67fd55a626e2cf322e4cc4565ecf627c71100166095aa75e
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/lib/omah_search.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: omah_search.rb
|
4
|
+
|
5
|
+
require "sqlite3"
|
6
|
+
require 'dynarex'
|
7
|
+
|
8
|
+
|
9
|
+
class OmahSearch
|
10
|
+
|
11
|
+
def initialize(db_file='headers.db')
|
12
|
+
|
13
|
+
@db = SQLite3::Database.new db_file
|
14
|
+
@db.results_as_hash = true
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def search(keyword)
|
19
|
+
|
20
|
+
r = @db.query( "select date, from_x, to_x, subject from headers " +
|
21
|
+
"where from_x like '%#{keyword}%' " +
|
22
|
+
"or subject like '%#{keyword}%' order by id desc limit 10" )
|
23
|
+
|
24
|
+
dx = Dynarex.new
|
25
|
+
a = r.to_a.map {|row| row[0].slice!(/T[^T]+$/); row}
|
26
|
+
|
27
|
+
dx.import a
|
28
|
+
table = dx.to_table
|
29
|
+
table.labels = %w(date from to subject )
|
30
|
+
table.markdown = true
|
31
|
+
table
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omah_search
|
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
|
+
8ixkARkWAmV1MB4XDTE2MDcxMjIxNDY1M1oXDTE3MDcxMjIxNDY1M1owSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
+
ggEBAN+YUo9jyNyR7Bn8RWN+iQ8B09j2uqgOQrlAjV/uN+YqcsoyyNgrgHiz5X6F
|
19
|
+
AwlJbipLpORtKYDR5jmLQU8Tq0EZfTpOY061MXUkHZu9NxQPk5aEAhnL2FQqwnCS
|
20
|
+
9cz914aOuvARQlgKfStQ0H8RO2uw8wEVdAomI07pJsS95QktWMiFNxWMQd//ly1A
|
21
|
+
8RqjouB8X4XtWei60Ps1u5go0rEysjLTsi8QjDS78Dh/ePnV2SYoqkY+6yulqJAY
|
22
|
+
On4KMCBDxgHYI4PaezRG7Hd81M8DEeweVt7MwwN/KZeRFTPG1tJ83iSqmd5G5uEw
|
23
|
+
NIy3xJjsdjlS6wiqnb/JaPcbAiUCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUMkqXP41ZZeWl7aKz6pY7wWoECRAwJgYDVR0RBB8w
|
25
|
+
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAqI7FlY4U
|
27
|
+
E8q4MFL06KnnvNv1RINtDYgrS25FPNHmwETW/bhYLRSN9q9r1OHsR3NgkDLQVGKV
|
28
|
+
VGssOl+3u4JiUK6ZDGewrSFaajzHbiq53v33WoBPLo1pS9Zlokb5EkK50urT0aJQ
|
29
|
+
XLnsL4VZHzyKuMc5Ui5GCM2creeLXzpy9+Lgxq/7sMCpurVD1qRVf5ieaIqepEOU
|
30
|
+
jGbbII0xwS01ph5MQmwgfjm5nwNbtmockfHsS7FvJZQBoW+Hcw7a1ocJGMebwnnK
|
31
|
+
z09kLQzLRi8385RDh2u1niQgWzcsGz1kVmKs+NzaFjvUYUY3GA1bP7wGLoMA4MkO
|
32
|
+
8HkKDVgvtq+gmg==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: sqlite3
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.3'
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.3.11
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '1.3'
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.3.11
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: dynarex
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.7'
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 1.7.8
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '1.7'
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.7.8
|
76
|
+
description:
|
77
|
+
email: james@r0bertson.co.uk
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- lib/omah_search.rb
|
83
|
+
homepage: https://github.com/jrobertson/omah_search
|
84
|
+
licenses:
|
85
|
+
- MIT
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.5.1
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: Searches the email headers from the Offine Mail Helper (OMAH) database generated
|
107
|
+
by the omah-plugin-sqlite.
|
108
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|