rubeepass 0.3.6 → 0.3.7

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rpass +1 -0
  3. data/lib/rubeepass.rb +23 -18
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5dafbd55f19d4fbb3ff08d9224a66d4ea9dc4cc
4
- data.tar.gz: 956f75f95cc170c856896384dfb17a5c706d40a5
3
+ metadata.gz: 2ad974e27286aa2e613e6bfe2e487f6b24401133
4
+ data.tar.gz: 1ddf8983150a4470e4e71c6fc7c9625e5bc64c59
5
5
  SHA512:
6
- metadata.gz: 72102e72541d90bf45b9bcdb833423c008bce6e2866bef7ad40c57a3e6977e53a1a2b120ccd1bacb33a181032a72e5ba6d8181d02220cc6ac82dc70e9386a58c
7
- data.tar.gz: e339c1817ef105c746c6eeb65b5cfea0749e9c997012b6804c6bbf307d318910cce883903e3868f47d759d543fe13f1b72e870fcc929ac48caad6170c8156042
6
+ metadata.gz: 7865dfba1ae5a9929cbe3b66364058a711e32dfa98c85e376cc08e7e7dd20abbcd5b1d55bb575b46acc2b215edfdf238ae5bac011b89f45ee4945ff4086dcc5b
7
+ data.tar.gz: 93a8a8ed4b402606c0b78ab84917aa640130f187455b5214b45597ca3d6b022984975f766c40239b5e389a68adbb32f08e99ab03bfd9d050e052130ecd20d678
data/bin/rpass CHANGED
@@ -275,6 +275,7 @@ begin
275
275
  end
276
276
  # rescue SystemExit => e
277
277
  ensure
278
+ keepass.clear_clipboard
278
279
  keepass.wait_to_exit
279
280
  end
280
281
  exit RPassExit::GOOD
data/lib/rubeepass.rb CHANGED
@@ -66,21 +66,20 @@ class RubeePass
66
66
  @thread.kill if (@thread)
67
67
  @thread = Thread.new do
68
68
  sleep time
69
- copy_to_clipboard("")
69
+ copy_to_clipboard("", false)
70
70
  end
71
71
  end
72
72
 
73
- def copy_to_clipboard(string)
73
+ def copy_to_clipboard(string, err = true)
74
74
  string = "" if (string.nil?)
75
75
  if (OS::Underlying.windows?)
76
- puts "Your OS is not currently supported!"
76
+ puts "Your OS is not currently supported!" if (err)
77
77
  return
78
78
  end
79
79
 
80
80
  echo = ScoobyDoo.where_are_you("echo")
81
81
 
82
82
  if (OS.mac?)
83
- string = "" if (string.nil?)
84
83
  pbcopy = ScoobyDoo.where_are_you("pbcopy")
85
84
  rn = ScoobyDoo.where_are_you("reattach-to-user-namespace")
86
85
 
@@ -93,29 +92,35 @@ class RubeePass
93
92
  if (cp)
94
93
  system("#{echo} -n #{string.shellescape} | #{cp}")
95
94
  else
96
- puts "Please install reattach-to-user-namespace!"
95
+ if (err)
96
+ puts "Please install reattach-to-user-namespace!"
97
+ end
97
98
  return
98
99
  end
99
100
  elsif (OS.posix?)
100
- string = " \x7F" if (string.empty?)
101
101
  xclip = ScoobyDoo.where_are_you("xclip")
102
102
  xsel = ScoobyDoo.where_are_you("xsel")
103
103
 
104
- cp = nil
105
- if (xclip)
106
- cp = "xclip -i -selection clipboard"
107
- elsif (xsel)
108
- cp = "xsel -i --clipboard"
109
- end
104
+ ["clipboard", "primary", "secondary"].each do |sel|
105
+ cp = nil
106
+ if (xclip)
107
+ # string = " \x7F" if (string.empty?)
108
+ cp = "xclip -i -selection #{sel}"
109
+ elsif (xsel)
110
+ cp = "xsel -i --#{sel}"
111
+ end
110
112
 
111
- if (cp)
112
- system("#{echo} -n #{string.shellescape} | #{cp}")
113
- else
114
- puts "Please install either xclip or xsel!"
115
- return
113
+ if (cp)
114
+ system("#{echo} -n #{string.shellescape} | #{cp}")
115
+ else
116
+ if (err)
117
+ puts "Please install either xclip or xsel!"
118
+ end
119
+ return
120
+ end
116
121
  end
117
122
  else
118
- puts "Your OS is not currently supported!"
123
+ puts "Your OS is not currently supported!" if (err)
119
124
  return
120
125
  end
121
126
  end
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.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-06 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest