key-db 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. data/lib/hashkeydb.rb +8 -3
  2. metadata +2 -2
data/lib/hashkeydb.rb CHANGED
@@ -19,10 +19,15 @@ class HashKeyDB
19
19
  end
20
20
  end
21
21
  end
22
- def keys
22
+ def access type
23
23
  File.open(@filename).each_line do |line|
24
- @key = line.split('/')
25
- puts @key[0]
24
+ @keys_and_vals = line.split('/')
25
+ if type == "keys"
26
+ index = 0
27
+ elsif type == "vals"
28
+ index = 1
29
+ end
30
+ puts @keys_and_vals[index]
26
31
  end
27
32
  end
28
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: key-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-05-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: A database acessible via keys, now with a 'keys' function
14
+ description: A database acessible via keys, now with a 'access' function
15
15
  email: slmnwise@gmail.com
16
16
  executables: []
17
17
  extensions: []