keybox 1.0.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.
@@ -0,0 +1,74 @@
1
+ require 'keybox/uuid'
2
+ context "UUID class" do
3
+ specify "should have 16 bytes" do
4
+ uuid = Keybox::UUID.new
5
+ uuid.bytes.size.should == 16
6
+ end
7
+
8
+ specify "as an array should have 16 members" do
9
+ uuid = Keybox::UUID.new
10
+ uuid.to_a.size.should == 16
11
+ end
12
+
13
+ specify "array elements should have values between 0 and 256 " do
14
+ uuid = Keybox::UUID.new
15
+ uuid.to_a.each do |b|
16
+ b.should_satisfy { |s| s.between?(0,256) }
17
+ end
18
+ end
19
+
20
+ specify "as a string should match regex" do
21
+ regex = Keybox::UUID::REGEX
22
+ uuid = Keybox::UUID.new
23
+ uuid.to_s.should_match(regex)
24
+ end
25
+
26
+ specify "initialized with a string should give a valid uuid" do
27
+ s = "0123456789abcdef"
28
+ s_a = s.unpack("C*")
29
+ s_uuid = sprintf(Keybox::UUID::FORMAT,*s_a)
30
+ uuid = Keybox::UUID.new(s)
31
+ uuid.to_s.should == s_uuid
32
+ end
33
+
34
+ specify "initialized with a string in the format of a uuid is valid " do
35
+ s = "c8b5a23a-2507-4834-ab19-60f2cb2a5271"
36
+ uuid = Keybox::UUID.new(s)
37
+ uuid.to_s.should == s
38
+ end
39
+
40
+ specify "not enough bytes should throw an expeption" do
41
+ s = "0123456789"
42
+ lambda { Keybox::UUID.new(s) }.should_raise ArgumentError
43
+ end
44
+
45
+ specify "invalid uuid string should throw an exception" do
46
+ s = "z8b5a23a-2507-4834-ab19-60f2cb2a5271"
47
+ lambda { Keybox::UUID.new(s) }.should_raise ArgumentError
48
+ end
49
+
50
+ specify "initialing with a non-string raises an exception" do
51
+ lambda { Keybox::UUID.new(42) }.should_raise ArgumentError
52
+ end
53
+
54
+ specify "should equal another keybox created with same data" do
55
+ s = "c8b5a23a-2507-4834-ab19-60f2cb2a5271"
56
+ one = Keybox::UUID.new(s)
57
+ two = Keybox::UUID.new(s)
58
+ one.should == two
59
+ end
60
+
61
+ specify "should equal a string that is the same uuid" do
62
+ s = "c8b5a23a-2507-4834-ab19-60f2cb2a5271"
63
+ one = Keybox::UUID.new(s)
64
+ one.should == s
65
+ end
66
+
67
+ specify "should not equal some other uuid or random string" do
68
+ s = "c8b5a23a-2507-4834-ab19-60f2cb2a5271"
69
+ one = Keybox::UUID.new(s)
70
+ one.should_not_eql Keybox::UUID.new
71
+ one.should_not_eql "i love ruby"
72
+ one.should_not_eql 4
73
+ end
74
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.0
3
+ specification_version: 1
4
+ name: keybox
5
+ version: !ruby/object:Gem::Version
6
+ version: 1.0.0
7
+ date: 2007-01-14 00:00:00 -07:00
8
+ summary: Keybox is a set of command line applications and ruby libraries for secure password storage and password generation.
9
+ require_paths:
10
+ - lib
11
+ - lib
12
+ email: jeremy@hinegardner.org
13
+ homepage: http://keybox.rubyforge.org
14
+ rubyforge_project: keybox
15
+ description: Keybox is a set of command line applications and ruby libraries for secure password storage and password generation.
16
+ autorequire:
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: true
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ - - ">"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.0
25
+ version:
26
+ platform: ruby
27
+ signing_key:
28
+ cert_chain:
29
+ post_install_message: Try `keybox --help` for more information
30
+ authors:
31
+ - Jeremy Hinegardner
32
+ files:
33
+ - data/chargrams.txt
34
+ - spec/kpg_app_spec.rb
35
+ - spec/convert_csv_spec.rb
36
+ - spec/storage_record_spec.rb
37
+ - spec/storage_container_spec.rb
38
+ - spec/uuid_spec.rb
39
+ - spec/base_app_spec.rb
40
+ - spec/entry_spec.rb
41
+ - spec/keybox_app_spec.rb
42
+ - spec/string_generator_spec.rb
43
+ - spec/password_hash_spec.rb
44
+ - spec/randomizer_spec.rb
45
+ - README
46
+ - CHANGES
47
+ - COPYING
48
+ - lib/keybox.rb
49
+ - lib/keybox/cipher.rb
50
+ - lib/keybox/term_io.rb
51
+ - lib/keybox/error.rb
52
+ - lib/keybox/randomizer.rb
53
+ - lib/keybox/uuid.rb
54
+ - lib/keybox/digest.rb
55
+ - lib/keybox/convert.rb
56
+ - lib/keybox/entry.rb
57
+ - lib/keybox/string_generator.rb
58
+ - lib/keybox/password_hash.rb
59
+ - lib/keybox/storage.rb
60
+ - lib/keybox/storage/container.rb
61
+ - lib/keybox/storage/record.rb
62
+ - lib/keybox/convert/csv.rb
63
+ - lib/keybox/application/base.rb
64
+ - lib/keybox/application/password_generator.rb
65
+ - lib/keybox/application/password_safe.rb
66
+ - bin/keybox
67
+ - bin/kpg
68
+ test_files: []
69
+
70
+ rdoc_options:
71
+ - --line-numbers
72
+ - --inline-source
73
+ extra_rdoc_files: []
74
+
75
+ executables:
76
+ - keybox
77
+ - kpg
78
+ extensions: []
79
+
80
+ requirements: []
81
+
82
+ dependencies: []
83
+