pws 0.1.1 → 0.1.2

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. data/VERSION +1 -1
  2. data/bin/pws +8 -4
  3. data/pws.gemspec +2 -2
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/bin/pws CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # pws
4
+ # see http://rbjl.net/41-tutorial-build-your-own-password-safe-with-ruby for more information
5
+
3
6
  require 'rubygems' if RUBY_VERSION[2] == ?8
4
7
 
5
8
  require 'openssl'
@@ -10,7 +13,7 @@ require 'zucker/kernel'
10
13
  require 'zucker/version'
11
14
 
12
15
  class PasswordSafe
13
- VERSION = "0.1.0".freeze
16
+ VERSION = "0.1.2".freeze
14
17
 
15
18
  Entry = Struct.new :description, :password
16
19
 
@@ -102,8 +105,9 @@ class PasswordSafe
102
105
 
103
106
  # Adds a password entry with a fresh generated random password
104
107
  def generate( key, description = nil, length = 128, chars = (32..126).map(&:chr) )
105
- add key, (1..length).map{ chars.sample }.join
108
+ add key, nil, (1..length).map{ chars[rand chars.size] }.join # possible in 1.9: chars.sample
106
109
  end
110
+ alias_for :generate, :gen
107
111
 
108
112
  # Prevents accidental displaying, e.g. in irb
109
113
  def to_s
@@ -195,7 +199,7 @@ class PasswordSafe
195
199
  end
196
200
 
197
201
  # Command line action
198
- #if standalone? # using zucker/kernel (instead of __FILE__ == $0)
202
+ if standalone? # using zucker/kernel (instead of __FILE__ == $0)
199
203
  if $*.empty?
200
204
  action = :show
201
205
  args = []
@@ -240,6 +244,6 @@ end
240
244
  rescue PasswordSafe::NoAccess => e
241
245
  warn e.message
242
246
  end
243
- #end
247
+ end
244
248
 
245
249
  # J-_-L
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pws}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jan Lelis"]
12
- s.date = %q{2010-11-01}
12
+ s.date = %q{2010-11-02}
13
13
  s.default_executable = %q{pws}
14
14
  s.email = %q{mail@janlelis.de}
15
15
  s.executables = ["pws"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pws
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jan Lelis
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-01 00:00:00 +01:00
18
+ date: 2010-11-02 00:00:00 +01:00
19
19
  default_executable: pws
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency