diff options
| author | mo <mo.khan@gmail.com> | 2018-06-14 12:20:55 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2018-06-14 12:20:55 -0600 |
| commit | d309a3c74cd6569fa619bdcdeeb3ab421c890a90 (patch) | |
| tree | f8fd821c68a1d458272d0fccd665d9b4bd403a0a /lib | |
| parent | 796e99cd1ae0e2b5dd72b22f38be41451bffa84b (diff) | |
add spec to read the kdbx database.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/trunk.rb | 3 | ||||
| -rw-r--r-- | lib/trunk/cli.rb | 7 | ||||
| -rw-r--r-- | lib/trunk/kdbx.rb | 12 |
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/trunk.rb b/lib/trunk.rb index a217793..dd9197e 100644 --- a/lib/trunk.rb +++ b/lib/trunk.rb @@ -5,12 +5,13 @@ require 'thor' require 'yaml' require "trunk/cli" +require "trunk/kdbx" require "trunk/serializers/base_64" require "trunk/serializers/composite" require "trunk/serializers/crypto" require "trunk/storage" -require "trunk/yaml_storage" require "trunk/version" +require "trunk/yaml_storage" module Trunk end diff --git a/lib/trunk/cli.rb b/lib/trunk/cli.rb index 9539d5f..dc01bc0 100644 --- a/lib/trunk/cli.rb +++ b/lib/trunk/cli.rb @@ -27,6 +27,13 @@ module Trunk [database_path, private_key_path].each { |x| FileUtils.chmod(0600, x) } end + desc "import KDBX", "import a kdbx database" + def import(file) + Trunk::KDBX.new(file).each do |item| + puts item.inspect + end + end + private def storage diff --git a/lib/trunk/kdbx.rb b/lib/trunk/kdbx.rb new file mode 100644 index 0000000..5d631ed --- /dev/null +++ b/lib/trunk/kdbx.rb @@ -0,0 +1,12 @@ +module Trunk + class KDBX + include Enumerable + + def initialize(file, password:) + @file = file + end + + def each(&block) + end + end +end |
