keystorage 0.3.0 → 0.4.1
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.
- data/VERSION +1 -1
- data/keystorage.gemspec +1 -1
- data/lib/keystorage.rb +3 -0
- data/lib/keystorage/cli.rb +2 -1
- data/lib/keystorage/manager.rb +15 -12
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.1
|
data/keystorage.gemspec
CHANGED
data/lib/keystorage.rb
CHANGED
data/lib/keystorage/cli.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'optparse'
|
2
|
+
require 'keystorage'
|
2
3
|
require 'keystorage/commands'
|
3
4
|
|
4
5
|
module Keystorage
|
5
6
|
class CLI
|
6
7
|
def initialize(argv)
|
7
8
|
@options = Hash.new
|
8
|
-
@options[:file] =
|
9
|
+
@options[:file] = DEFAULT_FILE
|
9
10
|
@argv = argv.clone
|
10
11
|
@opt = OptionParser.new
|
11
12
|
@opt.banner="Usage: keystorage [options] command [command options] args..."
|
data/lib/keystorage/manager.rb
CHANGED
@@ -2,22 +2,25 @@ require 'yaml'
|
|
2
2
|
require 'openssl'
|
3
3
|
|
4
4
|
module Keystorage
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
class << self
|
6
|
+
def list(group=nil,file=nil)
|
7
|
+
Manager.new(file).list(group)
|
8
|
+
end
|
9
|
+
|
10
|
+
def set(group,key,value,file=nil)
|
11
|
+
Manager.new(file).set(group,key,value)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get(group,name,file=nil)
|
15
|
+
Manager.new(file).get(group,name)
|
16
|
+
end
|
15
17
|
end
|
16
18
|
|
17
19
|
class Manager
|
18
20
|
|
19
|
-
def initialize(file)
|
20
|
-
@file =
|
21
|
+
def initialize(file=nil)
|
22
|
+
@file = DEFAULT_FILE
|
23
|
+
@file = file if file
|
21
24
|
end
|
22
25
|
|
23
26
|
def list(group=nil)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keystorage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yoshihiro TAKAHARA
|