humpass 0.2.3 → 0.3.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89f4cbb976a83ee77b0b036abebbefcfd9a51bd0
4
- data.tar.gz: 22807c2513180f0746b86f20ad3e2fea3d968f58
3
+ metadata.gz: 8943546f925cbf21e0616e9476c37151ab791272
4
+ data.tar.gz: bb7f50fe7dfbe2748fa2715428c588cd17b8bd6b
5
5
  SHA512:
6
- metadata.gz: '04962e051d487eaf5ff33598f2543480274ce45aa340700566bee6bd0488d5ada114bfae13dee53d9c904d509944c8321d0f6d8c4820d57633d84fe1dbbae14e'
7
- data.tar.gz: 0754a06219bc73112ce1d84b65dfb2c105e2313087be8e1b4c21b4af7dd4e852a24a75f7a69c1cb932255d4ff034d06de52205515b83772061ea62755279d919
6
+ metadata.gz: 9a5d0c5f6495fd70fd9b8e650cd46abe55b7953a317e275b2d0152a96cec81d1da24cf6ccdc06f1394016f98ac40565ad2e010f2c89c9f7dab95a50583a8de46
7
+ data.tar.gz: ec9f34aeaa0a7ba0d8cd37e3c1bb4ee59f0d34ea32ff48374236a72cc57d0f2b58dc265dbdb91015041cb6d16e13bfd08d507e56cb534464a54cc1cff05d120b
data/exe/humpass CHANGED
@@ -17,10 +17,15 @@ OptionParser.new do |opts|
17
17
  options[:database_path] = path
18
18
  end
19
19
 
20
- opts.on("-c","--createpass [PLACE]", "Generates a password for a place") do |place|
20
+ opts.on("-c","--createpass [PLACE]", "Generates a random password for a place") do |place|
21
21
  options[:place] = place
22
22
  end
23
23
 
24
+ opts.on("-s","--setpass [PLACE,PASSWORD]", Array, "Generates a random password for a place") do |place, pass|
25
+ options[:set_place] = place
26
+ options[:set_pass] = pass
27
+ end
28
+
24
29
  opts.on("-g","--getepass [PLACE]", "Gets password from place") do |place|
25
30
  options[:get_pass] = place
26
31
  end
@@ -53,6 +58,11 @@ if options.has_key?(:place)
53
58
  print "#{options[:place]}: #{Humpass.generate_password(options[:place])}\n"
54
59
  end
55
60
 
61
+ if options.has_key?(:set_place)
62
+ Clipboard.copy(Humpass.set_password(options[:set_place], options[:set_pass]))
63
+ print "Password for #{options[:set_place]} is in clipboard.\n"
64
+ end
65
+
56
66
  if options.has_key?(:get_pass)
57
67
  password = Humpass.get_password(options[:get_pass])
58
68
  if password.class.eql?(NilClass)
data/lib/humpass.rb CHANGED
@@ -16,6 +16,11 @@ module Humpass
16
16
  password
17
17
  end
18
18
 
19
+ def self.set_password(place, password)
20
+ Humpass.data_structure.add_password(place, password)
21
+ password
22
+ end
23
+
19
24
  def self.get_password(place)
20
25
  Humpass.data_structure.get_password(place)
21
26
  end
@@ -30,6 +35,6 @@ module Humpass
30
35
  end
31
36
 
32
37
  # Humpass.configure do |config|
33
- # config.master_password = '1234567890'
34
- # config.database_path = './humpass.dat'
38
+ # config.master_password = 'Takalinda1985'
39
+ # config.database_path = '~/Google\ Drive/humpass.dat'
35
40
  # end
@@ -1,3 +1,3 @@
1
1
  module Humpass
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humpass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Hamdan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-13 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler