rubeepass 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a69a934556fba614bbb3f0f83205a159551e0ae9
4
- data.tar.gz: 54af2c8c9f97c1237b2b59fbe45efcb167f2cfa0
3
+ metadata.gz: 06a43fa0faa3160590e9aa238e22fa9f42f6de81
4
+ data.tar.gz: 8880d9b9c46f357d830e7163ec399323048c200c
5
5
  SHA512:
6
- metadata.gz: 8b0424517f9678099e2ec80e7cff802b89f02ffbadcbfa6dde0bf871de208db4117067b0aaa96c013288bac89d83008df3fb8db34d137a6cc2dc0824ca2367ea
7
- data.tar.gz: 485e0b12733234359dbc92b29ef0c152cd171805f9ce090b6bd7ea5d8307c9e8e47ae19367f8e4da676e0f833cc2abebf8eb30e54ca30e2fe7309452206305f0
6
+ metadata.gz: f87a9c96a70c4ab1e78be3045e6b97556e1f0001e2c98039072c505c1486b32912339869fb4a0a4d1ea3931513ffdce7eb351bd5ae46eba119f269207d5d0a87
7
+ data.tar.gz: 3c638ce018b51afc98bb1532e0916ab3a6de13b58bc361588134d436119a84164b3b62c6ef36fc3308b8ba6346b7a7fb67e67dd6d180b5e6390767f8f672a2cb
@@ -2,11 +2,11 @@ require "djinni"
2
2
 
3
3
  class ShowWish < Djinni::Wish
4
4
  def aliases
5
- return [ "cat", "show" ]
5
+ return [ "cat", "show", "showall" ]
6
6
  end
7
7
 
8
8
  def description
9
- return "Show group/entry contents"
9
+ "Show group/entry contents (showall includes passwords)"
10
10
  end
11
11
 
12
12
  def execute(args, djinni_env = {})
@@ -20,14 +20,29 @@ class ShowWish < Djinni::Wish
20
20
 
21
21
  if (new_cwd)
22
22
  if (target.empty?)
23
- puts new_cwd
23
+ case djinni_env["djinni_input"]
24
+ when "showall"
25
+ puts new_cwd.details(0, true)
26
+ else
27
+ puts new_cwd
28
+ end
24
29
  elsif (new_cwd.has_group?(target))
25
- puts new_cwd.groups[target]
30
+ case djinni_env["djinni_input"]
31
+ when "showall"
32
+ puts new_cwd.groups[target].details(0, true)
33
+ else
34
+ puts new_cwd.groups[target]
35
+ end
26
36
  elsif (new_cwd.has_entry?(target))
27
37
  new_cwd.entry_titles.select do |entry|
28
38
  target.downcase == entry.downcase
29
39
  end.each do |entry|
30
- puts new_cwd.entries[entry]
40
+ case djinni_env["djinni_input"]
41
+ when "showall"
42
+ puts new_cwd.entries[entry].details(0, true)
43
+ else
44
+ puts new_cwd.entries[entry]
45
+ end
31
46
  end
32
47
  else
33
48
  puts "Group/entry \"#{args}\" doesn't exist!"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubeepass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: '1.3'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.3.3
82
+ version: 1.3.4
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '1.3'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 1.3.3
92
+ version: 1.3.4
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: json_config
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -201,7 +201,6 @@ files:
201
201
  - lib/rubeepass/wish/echo_wish.rb
202
202
  - lib/rubeepass/wish/ls_wish.rb
203
203
  - lib/rubeepass/wish/pwd_wish.rb
204
- - lib/rubeepass/wish/show_all_wish.rb
205
204
  - lib/rubeepass/wish/show_wish.rb
206
205
  - lib/string.rb
207
206
  homepage: https://mjwhitta.github.io/rubeepass
@@ -1,78 +0,0 @@
1
- require "djinni"
2
-
3
- class ShowAllWish < Djinni::Wish
4
- def aliases
5
- return [ "showall" ]
6
- end
7
-
8
- def description
9
- return "Show group/entry contents, including passwords"
10
- end
11
-
12
- def execute(args, djinni_env = {})
13
- keepass = djinni_env["keepass"]
14
- cwd = djinni_env["cwd"]
15
- args = cwd.path if (args.nil? || args.empty?)
16
-
17
- args = keepass.absolute_path(args, cwd.path)
18
- path, target = args.rsplit("/")
19
- new_cwd = keepass.find_group(path)
20
-
21
- if (new_cwd)
22
- if (target.empty?)
23
- puts new_cwd.details(0, true)
24
- elsif (new_cwd.has_group?(target))
25
- puts new_cwd.groups[target].details(0, true)
26
- elsif (new_cwd.has_entry?(target))
27
- new_cwd.entry_titles.select do |entry|
28
- target.downcase == entry.downcase
29
- end.each do |entry|
30
- puts new_cwd.entries[entry].details(0, true)
31
- end
32
- else
33
- puts "Group/entry \"#{args}\" doesn't exist!"
34
- end
35
- else
36
- puts "Group/entry \"#{args}\" doesn't exist!"
37
- end
38
- end
39
-
40
- def tab_complete(input, djinni_env = {})
41
- cwd = djinni_env["cwd"]
42
- input, groups, entries = cwd.fuzzy_find(input)
43
- if (groups.empty? && entries.empty?)
44
- return input.gsub(%r{^#{cwd.path}/?}, "")
45
- end
46
-
47
- path, target = input.rsplit("/")
48
-
49
- if (target.empty?)
50
- if ((groups.length == 1) && entries.empty?)
51
- input = "#{path}/#{groups.first}/"
52
- return input.gsub(%r{^#{cwd.path}/?}, "")
53
- elsif (groups.empty? && (entries.length == 1))
54
- input = "#{path}/#{entries.first}"
55
- return input.gsub(%r{^#{cwd.path}/?}, "")
56
- end
57
- puts
58
- groups.each do |group|
59
- puts "#{group}/"
60
- end
61
- puts entries
62
- return input.gsub(%r{^#{cwd.path}/?}, "")
63
- end
64
-
65
- if (!groups.empty?)
66
- input = "#{path}/#{groups.first}/"
67
- elsif (!entries.empty?)
68
- input = "#{path}/#{entries.first}"
69
- end
70
-
71
- return input.gsub(%r{^#{cwd.path}/?}, "")
72
- end
73
-
74
- def usage
75
- puts "#{aliases.join(", ")} [group|entry]"
76
- puts "\t#{description}."
77
- end
78
- end