keepass-static 0.0.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3009a729cdcc6c13b83413811def15366d7daded
4
- data.tar.gz: d2dbe4ee56af3e84b5e1b7583289c86de042c949
3
+ metadata.gz: 295d21332112f6feee908c4b604811752ce74dd0
4
+ data.tar.gz: 2cad01d8698aea8a3633e4bfc1dcb2e4a9b80cc2
5
5
  SHA512:
6
- metadata.gz: 2ce87630789088f628ca5c6f64a7538481140f8ae964e3da71cb0128b63b5343fdeb6d05f25370e6c31a27d6c9efefb23881361e17511c38786182d1011c775f
7
- data.tar.gz: 9707e0c5bdedcfcd7327bc463dbe328d62f951be04ffdbb17fe57e6f54b46453bf1ae7709fdfc749767e01aba8d097b3aa70a8d90fb8f7b583ef01697f042b0a
6
+ metadata.gz: a75259538d361d03b529a051673cd72ef491f4a5d24259763f8dc9384cf1407675aa80dc0dbcec03d3fff39c9f2a5410cfe3b7327e5346c2a9cf2226337c12e1
7
+ data.tar.gz: 833463af8d3b72cf1818fd7af3df973f2bff8c3d5cf8b8642417f0124f4f056d5a7ae69a2a023eadb229442dfdc727937e44bcb888d048f291a080dca089852c
Binary file
Binary file
Binary file
Binary file
@@ -3,16 +3,17 @@ module Keepass
3
3
  class Database
4
4
  def group(name)
5
5
  gr = groups.select { |g| g.name == name }
6
- fail "Error: found multiple groups with name #{name}" if gr.length > 1
6
+ raise "Error: found multiple groups with name #{name}" if gr.length > 1
7
7
  gr[0]
8
8
  end
9
9
 
10
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
11
+ ent = if name.nil?
12
+ simple_select title
13
+ else
14
+ double_select title, name
15
+ end
16
+
16
17
  ent[0]
17
18
  end
18
19
 
@@ -20,14 +21,18 @@ module Keepass
20
21
 
21
22
  def simple_select(title)
22
23
  ent = entries.select { |e| e.title == title }
23
- fail "Error: found multiple entries with title #{title}" if ent.length > 1
24
+
25
+ if ent.length > 1
26
+ raise "Error: found multiple entries with title #{title}"
27
+ end
28
+
24
29
  ent
25
30
  end
26
31
 
27
32
  def double_select(title, name)
28
33
  ent = group(name).entries.select { |e| e.title == title }
29
34
  if ent.length > 1
30
- fail "Error: found multiple entries with title #{title} for "\
35
+ raise "Error: found multiple entries with title #{title} for "\
31
36
  "group #{name}"
32
37
  end
33
38
  return ent
@@ -1,2 +1,6 @@
1
- require_relative 'keepass'
1
+ require_relative 'keepass-util'
2
+
3
+ ver = ruby_version
4
+
5
+ require_relative "#{ver[:major]}.#{ver[:minor]}/keepass"
2
6
  require_relative 'keepass-methods'
@@ -0,0 +1,9 @@
1
+ def ruby_version
2
+ arr = RUBY_VERSION.split '.'
3
+
4
+ {
5
+ major: arr[0].to_i,
6
+ minor: arr[1].to_i,
7
+ tiny: arr[2].to_i
8
+ }
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keepass-static
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Rusu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Ruby bindings to libkpass as static built native extensions '
14
14
  email: saltwaterc@gmail.com
@@ -16,10 +16,13 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - lib/2.1/keepass.bundle
20
+ - lib/2.1/keepass.so
21
+ - lib/2.3/keepass.bundle
22
+ - lib/2.3/keepass.so
19
23
  - lib/keepass-methods.rb
20
24
  - lib/keepass-static.rb
21
- - lib/keepass.bundle
22
- - lib/keepass.so
25
+ - lib/keepass-util.rb
23
26
  homepage: https://github.com/SaltwaterC/keepass-static
24
27
  licenses:
25
28
  - MIT
@@ -40,9 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
43
  version: '0'
41
44
  requirements: []
42
45
  rubyforge_project:
43
- rubygems_version: 2.4.8
46
+ rubygems_version: 2.6.6
44
47
  signing_key:
45
48
  specification_version: 4
46
49
  summary: Ruby bindings to libkpass as static built native extensions
47
50
  test_files: []
48
- has_rdoc:
data/lib/keepass.bundle DELETED
Binary file
data/lib/keepass.so DELETED
Binary file