passman 0.0.2 → 0.0.3

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: 3fd80581c44a6b45f671dee954c907546c1d0070
4
- data.tar.gz: a6b7bb2c53cc7f49dbd46d780c2e8eeb98c1a569
3
+ metadata.gz: f08fec036c4bb2ed94e95cadda7138b52218b61b
4
+ data.tar.gz: 56ebe4b05bbbee2acd6fc14130f009806152c94c
5
5
  SHA512:
6
- metadata.gz: f8843144a6727eb8d50eeddedcd98d5527da66f79ec892970acce16374b16036b655948d6a63f8ff60539c5b131b0194c72791d22b18c7f9993f65568c99b12c
7
- data.tar.gz: ad5c45e1a5e9d802d73ee20a55689cb359bcadfec480b39c7624924ac792b2ab3aaa6daa48e51a1e64f83093bffe3d5cc5ffac54bd71bb0378e6a668b494d9a7
6
+ metadata.gz: edc9ae439715dca460f4b83d049585274c1d2ddbc0ca44c834a0547766ba5c5c8e44040a59c06a05c9e8467fa7c87cf5aef4c9b28350114a355f35664265bb5b
7
+ data.tar.gz: 7e2b43738e7a3798d4d866245938f6129f19cdfe25b966da452aab4648296ca2186da70e06b0b3496e22a774950508e581e7746bd2b4d390214eccce0f81e149
data/README.md CHANGED
@@ -57,6 +57,13 @@ You can delete your accounts:
57
57
  passman -d Twitter
58
58
  ```
59
59
 
60
+ For any password generated, you can combine the parameter -c to copy it in your clipboard, this way it won't be stored in your terminal history.
61
+
62
+ ```
63
+ passman -g -code
64
+ #=> Password copied to clipboard!
65
+ ```
66
+
60
67
  ## Contributing
61
68
 
62
69
  1. Fork it
data/bin/passman CHANGED
@@ -4,6 +4,7 @@ require 'passman'
4
4
  require 'optparse'
5
5
  require 'colorize'
6
6
  require 'io/console'
7
+ require 'clipboard'
7
8
 
8
9
  options = { length: 32 }
9
10
 
@@ -43,6 +44,10 @@ begin
43
44
  options[:generate] = true
44
45
  end
45
46
 
47
+ opts.on('-c', '--clipboard', 'Copies the password to the clipboard when you generate it or when you retreive it') do
48
+ options[:clipboard] = true
49
+ end
50
+
46
51
  opts.on('-l', '--list', 'List your saved keys') do |length|
47
52
  options[:list] = length
48
53
  end
@@ -70,14 +75,18 @@ begin
70
75
  password = options[:password]
71
76
  else
72
77
  password = manager.generate_password(options[:length])
73
- puts "Password generated: #{password}".colorize(:yellow)
78
+ if options[:clipboard]
79
+ Clipboard.copy(password)
80
+ puts 'Password copied to clipboard!'.colorize(:yellow)
81
+ else
82
+ puts "Password generated: #{password}".colorize(:yellow)
83
+ end
74
84
  end
75
85
 
76
86
  if manager.exist?(options[:account])
77
87
  print 'There is a username already stored. Do you want to overwrite it? [Y/n] '
78
88
  overwrite = gets
79
- exit unless overwrite == 'Y'
80
- puts ''
89
+ exit unless overwrite.chomp == 'Y'
81
90
  end
82
91
 
83
92
  print 'Insert your symmetric-key:'
@@ -103,7 +112,14 @@ begin
103
112
 
104
113
  elsif options[:generate]
105
114
 
106
- puts manager.generate_password(options[:length])
115
+ password = manager.generate_password(options[:length])
116
+
117
+ if options[:clipboard]
118
+ Clipboard.copy(password)
119
+ puts 'Password copied to clipboard!'.colorize(:yellow)
120
+ else
121
+ puts "Password generated: #{password}".colorize(:yellow)
122
+ end
107
123
 
108
124
  elsif options[:retreive]
109
125
 
@@ -1,3 +1,3 @@
1
1
  module Passman
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
data/passman.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec)/})
21
21
 
22
22
  spec.add_dependency 'colorize', '~> 0.7', '>= 0.7.5'
23
+ spec.add_dependency 'clipboard', '~> 1.1', '>= 1.1.0'
23
24
 
24
25
  spec.add_development_dependency 'bundler', '>= 1.3.0', '< 2.0'
25
26
  spec.add_development_dependency 'byebug' if RUBY_VERSION >= '2.0.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Bezdjian
@@ -30,6 +30,26 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.7.5
33
+ - !ruby/object:Gem::Dependency
34
+ name: clipboard
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.1.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.1'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.1.0
33
53
  - !ruby/object:Gem::Dependency
34
54
  name: bundler
35
55
  requirement: !ruby/object:Gem::Requirement