ruby-secret_service 0.0.7 → 0.0.8

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2Q5YTE5ZmZmNGU2Mjg3ZTc0MDhlZjM5ZDg4ODUyZjJjNDVjOGJmMA==
4
+ OTZmYjAxZmIyMGM2M2M3YzlkOTAzZWVjNTgwODE1YjNhZDAzNjQyZQ==
5
5
  data.tar.gz: !binary |-
6
- NmRmZTcyY2IyMjA4YzM1MTc1MzI2OGE0NDFiMWVhNGI0NTI1MzM1MQ==
6
+ NDBlMTY2MzBkNDdkZjU5OWJkYjEyMzhiZDU3MDZmZGYxMTAxYjAwYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mjk1YzlmYzZmMTkwYTEyN2RlYTdmZjdjMjhjN2UxOGJlM2QzMWMxMjdlODU1
10
- MTlmNmFhZTRlYTBmZTI4ODc0MzlmYmEwNDk5NzVjNTkxNTU1MTgwZjk0MDIz
11
- ZDZhMzAwNmE3NzUzYWNhNzYyODQ2Mjc0OGIzZGMxZjVhZWVlYzY=
9
+ MWQ1M2Q3ZGQ3Y2M0ZGMwZTE3ZjBmY2ZhMjJmYmQzZmQyMDNlMGUwYzlhZWZj
10
+ ZGMyMTFlMjAzMjU2YzYyMWZmOTQ1ODg4YjRhMTFiMGExNzQ0MGRhMTc0ZjZk
11
+ ODcwZDQ2NjUxMmI1ZGI4MjBjYzhiMTYzZWI4YmMxNjQ0NzcwY2Q=
12
12
  data.tar.gz: !binary |-
13
- MTdlZWE1MDYxOGQ2N2U4MGQzYjkzNzgwNThjOWEzY2IxZjMwYjM0YzAzMmRl
14
- NGUzODM0NTllMGI3MDYwOTM2OTBlYjBiMTNkN2Q4MTA3ZWM2NWY0NTExNTcx
15
- MGVlMzljY2IzYmNlOWE5ZWU2MzViODE5ZGIwMTk4Mzk5NmI2OTE=
13
+ ZGJlOWNmNWQ5OTIwZDNkMWYzNTk1OWFlYWFiMjFlZjYwYTQyYWUyZDQ3ODY4
14
+ NzJlZjhmMDI0OTNiNjIzOGI0OTEyOGNlMDliNDM3NDA5N2I5OGRlNGVlOTE2
15
+ ZDM5NTgxODJkZGE0OWQyOWM3Yzc2MmNkYWEwMWEyNTRlMTU5ODA=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-secret_service (0.0.7)
4
+ ruby-secret_service (0.0.8)
5
5
  ruby-dbus
6
6
 
7
7
  GEM
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
@@ -63,8 +63,8 @@ class SecretService
63
63
  @proxy.Get(IFACE[:service], 'Collections')
64
64
  end
65
65
 
66
- def create_collection name, properties=nil
67
- properties ||= {"#{SS_PREFIX}Collection.Label" => name}
66
+ def create_collection name, properties={}
67
+ properties["#{SS_PREFIX}Collection.Label"] = name
68
68
 
69
69
  coll, prompt_path = @proxy.CreateCollection properties, ""
70
70
  prompt!(prompt_path) if prompt_path != "/"
@@ -69,8 +69,18 @@ class Collection
69
69
  Item.new(self, new_item_path)
70
70
  end
71
71
 
72
+ def get_item name
73
+ (unlocked_items({"name" => name})[0])
74
+ end
75
+
72
76
  def get_secret name
73
- (unlocked_items({"name" => name})[0]).get_secret
77
+ get_item(name).get_secret
78
+ end
79
+
80
+ def all_items
81
+ @proxy.Get(IFACE[:collection], Items).map { |item_path|
82
+ SecretService::Item.new(self, item_path)
83
+ }
74
84
  end
75
85
 
76
86
  def secret_encode secret_string
@@ -63,6 +63,12 @@ class Item
63
63
  secret_decode(@proxy.GetSecret(session[1]))
64
64
  end
65
65
 
66
+ def delete
67
+ prompt = @proxy.Delete
68
+ return true if prompt_path == "/"
69
+ @collection.service.prompt!(prompt_path)
70
+ end
71
+
66
72
  # http://standards.freedesktop.org/secret-service/ch14.html#type-Secret
67
73
  def secret_decode secret_arr
68
74
  secret_struct = secret_arr[0]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-secret_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Maher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-16 00:00:00.000000000 Z
11
+ date: 2013-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: woof_util