authorized_keys 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/authorized_keys.gemspec +7 -7
- data/lib/authorized_keys/key.rb +10 -1
- data/spec/authorized_keys/file_spec.rb +1 -1
- data/spec/authorized_keys/key_spec.rb +11 -1
- metadata +44 -16
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/authorized_keys.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{authorized_keys}
|
8
|
-
s.version = "1.0
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = ["Bodaniel Jeanes"]
|
12
|
+
s.date = %q{2011-10-22}
|
13
13
|
s.description = %q{Library to manage authorized_keys files}
|
14
14
|
s.email = %q{me@bjeanes.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -39,9 +39,9 @@ Gem::Specification.new do |s|
|
|
39
39
|
"spec/support/fixtures.rb"
|
40
40
|
]
|
41
41
|
s.homepage = %q{http://github.com/bjeanes/authorized_keys}
|
42
|
-
s.licenses = [
|
43
|
-
s.require_paths = [
|
44
|
-
s.rubygems_version = %q{1.
|
42
|
+
s.licenses = ["MIT"]
|
43
|
+
s.require_paths = ["lib"]
|
44
|
+
s.rubygems_version = %q{1.5.2}
|
45
45
|
s.summary = %q{Library to manage authorized_keys files}
|
46
46
|
|
47
47
|
if s.respond_to? :specification_version then
|
data/lib/authorized_keys/key.rb
CHANGED
@@ -1,13 +1,22 @@
|
|
1
1
|
require "authorized_keys"
|
2
2
|
|
3
3
|
module AuthorizedKeys
|
4
|
+
class AuthorizedKeys::BadKeyError < StandardError
|
5
|
+
attr_accessor :key
|
6
|
+
|
7
|
+
def initialize(key)
|
8
|
+
super("Bad key")
|
9
|
+
self.key = key
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
4
13
|
class Key
|
5
14
|
attr_accessor :options, :content, :comment
|
6
15
|
|
7
16
|
def initialize(key_string)
|
8
17
|
options, self.content, self.comment = *Components.extract(key_string)
|
9
18
|
|
10
|
-
raise
|
19
|
+
raise BadKeyError.new(key_string) unless self.content
|
11
20
|
|
12
21
|
self.options = options.split(/,/)
|
13
22
|
end
|
@@ -56,7 +56,7 @@ describe AuthorizedKeys::File do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "raises an exception for a bad key" do
|
59
|
-
lambda { subject.add("foo bar") }.should raise_error "Bad key"
|
59
|
+
lambda { subject.add("foo bar") }.should raise_error(AuthorizedKeys::BadKeyError, "Bad key")
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -39,7 +39,17 @@ describe AuthorizedKeys::Key do
|
|
39
39
|
|
40
40
|
context "with bad key content" do
|
41
41
|
let(:content) { "blah" }
|
42
|
-
it { lambda { subject }.should raise_error("Bad key") }
|
42
|
+
it { lambda { subject }.should raise_error(AuthorizedKeys::BadKeyError, "Bad key") }
|
43
|
+
|
44
|
+
describe AuthorizedKeys::BadKeyError do
|
45
|
+
it "has a reference to the key content" do
|
46
|
+
begin
|
47
|
+
subject
|
48
|
+
rescue => error
|
49
|
+
error.key.should == key
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
43
53
|
end
|
44
54
|
end
|
45
55
|
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authorized_keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3461773182973075480
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 1.1.0
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Bodaniel Jeanes
|
@@ -10,52 +15,71 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-
|
18
|
+
date: 2011-10-22 00:00:00 -05:00
|
19
|
+
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: rspec
|
17
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
18
25
|
none: false
|
19
26
|
requirements:
|
20
27
|
- - ~>
|
21
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3822069367455444496
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 3
|
33
|
+
- 0
|
22
34
|
version: 2.3.0
|
23
35
|
type: :development
|
24
|
-
|
25
|
-
version_requirements: *id001
|
36
|
+
requirement: *id001
|
26
37
|
- !ruby/object:Gem::Dependency
|
27
38
|
name: bundler
|
28
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
29
41
|
none: false
|
30
42
|
requirements:
|
31
43
|
- - ~>
|
32
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 2387456872237229630
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
- 0
|
33
50
|
version: 1.0.0
|
34
51
|
type: :development
|
35
|
-
|
36
|
-
version_requirements: *id002
|
52
|
+
requirement: *id002
|
37
53
|
- !ruby/object:Gem::Dependency
|
38
54
|
name: jeweler
|
39
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
40
57
|
none: false
|
41
58
|
requirements:
|
42
59
|
- - ~>
|
43
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 2734506097672312217
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 6
|
65
|
+
- 4
|
44
66
|
version: 1.6.4
|
45
67
|
type: :development
|
46
|
-
|
47
|
-
version_requirements: *id003
|
68
|
+
requirement: *id003
|
48
69
|
- !ruby/object:Gem::Dependency
|
49
70
|
name: rcov
|
50
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
51
73
|
none: false
|
52
74
|
requirements:
|
53
75
|
- - ">="
|
54
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 2002549777813010636
|
78
|
+
segments:
|
79
|
+
- 0
|
55
80
|
version: "0"
|
56
81
|
type: :development
|
57
|
-
|
58
|
-
version_requirements: *id004
|
82
|
+
requirement: *id004
|
59
83
|
description: Library to manage authorized_keys files
|
60
84
|
email: me@bjeanes.com
|
61
85
|
executables: []
|
@@ -86,6 +110,7 @@ files:
|
|
86
110
|
- spec/fixtures/keys/4.pub
|
87
111
|
- spec/spec_helper.rb
|
88
112
|
- spec/support/fixtures.rb
|
113
|
+
has_rdoc: true
|
89
114
|
homepage: http://github.com/bjeanes/authorized_keys
|
90
115
|
licenses:
|
91
116
|
- MIT
|
@@ -99,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
124
|
requirements:
|
100
125
|
- - ">="
|
101
126
|
- !ruby/object:Gem::Version
|
102
|
-
hash:
|
127
|
+
hash: 2002549777813010636
|
103
128
|
segments:
|
104
129
|
- 0
|
105
130
|
version: "0"
|
@@ -108,11 +133,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
133
|
requirements:
|
109
134
|
- - ">="
|
110
135
|
- !ruby/object:Gem::Version
|
136
|
+
hash: 2002549777813010636
|
137
|
+
segments:
|
138
|
+
- 0
|
111
139
|
version: "0"
|
112
140
|
requirements: []
|
113
141
|
|
114
142
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.
|
143
|
+
rubygems_version: 1.5.2
|
116
144
|
signing_key:
|
117
145
|
specification_version: 3
|
118
146
|
summary: Library to manage authorized_keys files
|