geoloclog 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3b63bb338af6b63c8b1194f2b0777b3cf6cc9c42
4
+ data.tar.gz: bcce73ca8e2f37afd4877190c54fddbd085cced2
5
+ SHA512:
6
+ metadata.gz: a41a98e4d098a1e8bbf2e3068fdca2eafdcdd01930f3aaa4d79c066984e4bdf0eaa1513a054b4a3a572ebf9b773061d6fdb00d9fbd21fb1120fd7c4944223ad0
7
+ data.tar.gz: 3ef85e938984e499039bb43ef5630b3c60c77185e161cd06e942686c1f56d317ca4abc712df8384947e4fd29f1ca1956a61b3c2dfab0bf8bd53fe693aa22a3b5
@@ -0,0 +1 @@
1
+ ,�kH���w�ox^L
Binary file
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: geoloclog.rb
4
+
5
+
6
+ require 'glw'
7
+ require 'dynarex-daily'
8
+
9
+
10
+ class GeoLocLog
11
+
12
+ def initialize(file=nil, wait: 60, labels: nil, dbfile: 'glw.db',
13
+ timeout: 10)
14
+
15
+ @filename = 'geoloclog.xml'
16
+ @labels = labels ? YAML.load(RXFHelper.read(labels).first) : {}
17
+
18
+ @dx = if file then
19
+ DynarexDaily.new file
20
+ else
21
+ dx = DynarexDaily.new 'geoloc[title, date]/location(place, label, ' +
22
+ 'entered, lastseen, address, coords)', filename: @filename
23
+ dx
24
+ end
25
+
26
+ @glw = Glw.new dbfile, timeout: timeout
27
+
28
+ end
29
+
30
+ def add(lat, lon)
31
+
32
+ h = @glw.locate lat, lon
33
+
34
+ record = {
35
+ place: h[:route],
36
+ label: @labels[h[:route]].to_s,
37
+ entered: Time.now,
38
+ lastseen: Time.now,
39
+ address: h[:address],
40
+ coords: [lat, lon].join(', ')
41
+ }
42
+
43
+ @dx.create record
44
+ @dx.save @filename
45
+
46
+ end
47
+
48
+ def last_location()
49
+ @dx.all.any? ? @dx.all.first : nil
50
+ end
51
+
52
+ alias location last_location
53
+
54
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: geoloclog
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
+ 8ixkARkWAmV1MB4XDTE3MTAxNTE2NTAwNVoXDTE4MTAxNTE2NTAwNVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAN8fc4Pjb0MwVNpelOK5nzcjuCD3Z+ixmC+UKz3crddDQSu9PwVpqexjsViS
19
+ rfwy8G+/k0Xe2KM3IV9QwxWmkc20OdVKjfmVNf5VffVV+KBnZ9hdtjxE0ZXsUzzz
20
+ vo/tXDYaJ2YRxpUidwJY36RkCFLhOZexgznDlGkCwujyPoIFZL83i86LyPEoOsl4
21
+ gFylfZlUI7exxRvqqB408lwY2wzsdY67dkZB+829E1qI6VZ4dppA786y0Ckltrr9
22
+ m5q9JM6uSZvYs2TiQgCt0G9T2wmHuxF8Q2hBLGKvz6WnAhUTVocXAwH84VEch3oN
23
+ 6yxr6nw0CjSWNB8fMzafJ4+QOuMCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUciP4c6652SqD5DfZ4n5m+1UcRPowJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAvwZiUue9
27
+ Mh2oaPaQspsBwnzt46sgXGux9PYZ6gV/NbYfMaxY9HQeFGXidIGxq2IpF0BUxgsW
28
+ pBoxadQOt2h/cuzeefPPAXk8+1M9ULV8s+Xd7CtC1Fj0n8syBb8YLKUNm93hitIK
29
+ TjIphOMDtaIiDLkg4jwjqqI4F3oOHyCitSE7ijQr34vebL+hgDYsB3lV4E0grVGb
30
+ UKAZ5UuI8mUtBRX1Z6betGXQALndNQtPC3EqqEKLZu2pqaP8CYq5e51kNrFG1n92
31
+ SL1FXwF5xFozplx6l2vkiZwth/kKCNXmuPYccz1ZTGkC9EO+d5w/RZO/av2SG6TI
32
+ PtgIvir8YvFdtA==
33
+ -----END CERTIFICATE-----
34
+ date: 2017-10-15 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: glw
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.7'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.7.26
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.7'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.7.26
56
+ - !ruby/object:Gem::Dependency
57
+ name: dynarex-daily
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.26
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.26
76
+ description:
77
+ email: james@jamesrobertson.eu
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - lib/geoloclog.rb
83
+ homepage: https://github.com/jrobertson/geoloclog
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.6.13
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: Logs geolocated placenames as well as coordinates in reverse chronological
107
+ order.
108
+ test_files: []
Binary file