keepass-static 0.0.4
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
- data/lib/keepass-methods.rb +38 -0
- data/lib/keepass-static.rb +2 -0
- data/lib/keepass.bundle +0 -0
- data/lib/keepass.so +0 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3009a729cdcc6c13b83413811def15366d7daded
|
4
|
+
data.tar.gz: d2dbe4ee56af3e84b5e1b7583289c86de042c949
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2ce87630789088f628ca5c6f64a7538481140f8ae964e3da71cb0128b63b5343fdeb6d05f25370e6c31a27d6c9efefb23881361e17511c38786182d1011c775f
|
7
|
+
data.tar.gz: 9707e0c5bdedcfcd7327bc463dbe328d62f951be04ffdbb17fe57e6f54b46453bf1ae7709fdfc749767e01aba8d097b3aa70a8d90fb8f7b583ef01697f042b0a
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Keepass
|
2
|
+
# KeePass Database class
|
3
|
+
class Database
|
4
|
+
def group(name)
|
5
|
+
gr = groups.select { |g| g.name == name }
|
6
|
+
fail "Error: found multiple groups with name #{name}" if gr.length > 1
|
7
|
+
gr[0]
|
8
|
+
end
|
9
|
+
|
10
|
+
def entry(title, name = nil)
|
11
|
+
if name.nil?
|
12
|
+
ent = simple_select title
|
13
|
+
else
|
14
|
+
ent = double_select title, name
|
15
|
+
end
|
16
|
+
ent[0]
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def simple_select(title)
|
22
|
+
ent = entries.select { |e| e.title == title }
|
23
|
+
fail "Error: found multiple entries with title #{title}" if ent.length > 1
|
24
|
+
ent
|
25
|
+
end
|
26
|
+
|
27
|
+
def double_select(title, name)
|
28
|
+
ent = group(name).entries.select { |e| e.title == title }
|
29
|
+
if ent.length > 1
|
30
|
+
fail "Error: found multiple entries with title #{title} for "\
|
31
|
+
"group #{name}"
|
32
|
+
end
|
33
|
+
return ent
|
34
|
+
rescue NoMethodError # if the group doesn't exist
|
35
|
+
return []
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/keepass.bundle
ADDED
Binary file
|
data/lib/keepass.so
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: keepass-static
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stefan Rusu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: 'Ruby bindings to libkpass as static built native extensions '
|
14
|
+
email: saltwaterc@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/keepass-methods.rb
|
20
|
+
- lib/keepass-static.rb
|
21
|
+
- lib/keepass.bundle
|
22
|
+
- lib/keepass.so
|
23
|
+
homepage: https://github.com/SaltwaterC/keepass-static
|
24
|
+
licenses:
|
25
|
+
- MIT
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 2.4.8
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: Ruby bindings to libkpass as static built native extensions
|
47
|
+
test_files: []
|
48
|
+
has_rdoc:
|