ssh-fingerprint 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: 807dc7e1092a935c29db68bd7daa86cc1ef8edab
4
- data.tar.gz: 12a51e67e562b7829df0dcddba3f91f506e02c7a
3
+ metadata.gz: 85c9823862f233e0ef85c9334b5fea423dc6ee66
4
+ data.tar.gz: b7ca344fda02d9e748ee156466c4802588516641
5
5
  SHA512:
6
- metadata.gz: f48b8536a42b094fa20e66ba54079665f1c90c42c4a668a5b6f8d86ee7a561bdb89f69f73ce0628cac45ab762efc411411576f8d645fc083e9d4c01a69af547b
7
- data.tar.gz: 609a283fdbe2bb359453014d7d85457e78f0fa68c4f392742303c89dbea0e59f8ae857ea37da0149d70f04276d7e799bfc8762560a2d519a5c9261d184b4d576
6
+ metadata.gz: f6881f0f0106770f3a7daae45e8a9d40d6d4f6cf37ccc82fdcbe7f303be6e13c60aa151c50c33dcbd0f37607e48ecca7656b9e86e99269e2c4afc4c6206e24b2
7
+ data.tar.gz: 1d4ad84ba6a497478f350deff07a6f199d4f47d9062ff5dd5bab926a36e8e45bbe13f8484b72757454816a769efd198e67b79e44eb244b5e7e2ce64bbf4bebc5
@@ -1,13 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ssh-fingerprint (0.0.2)
4
+ ssh-fingerprint (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ coveralls (0.7.0)
10
+ multi_json (~> 1.3)
11
+ rest-client
12
+ simplecov (>= 0.7)
13
+ term-ansicolor
14
+ thor
9
15
  diff-lcs (1.2.5)
16
+ docile (1.1.2)
17
+ mime-types (2.0)
18
+ multi_json (1.8.4)
10
19
  rake (10.1.1)
20
+ rest-client (1.6.7)
21
+ mime-types (>= 1.16)
11
22
  rspec (2.14.1)
12
23
  rspec-core (~> 2.14.0)
13
24
  rspec-expectations (~> 2.14.0)
@@ -16,12 +27,22 @@ GEM
16
27
  rspec-expectations (2.14.4)
17
28
  diff-lcs (>= 1.1.3, < 2.0)
18
29
  rspec-mocks (2.14.4)
30
+ simplecov (0.8.2)
31
+ docile (~> 1.1.0)
32
+ multi_json
33
+ simplecov-html (~> 0.8.0)
34
+ simplecov-html (0.8.0)
35
+ term-ansicolor (1.2.2)
36
+ tins (~> 0.8)
37
+ thor (0.18.1)
38
+ tins (0.13.1)
19
39
 
20
40
  PLATFORMS
21
41
  ruby
22
42
 
23
43
  DEPENDENCIES
24
44
  bundler (~> 1.5)
45
+ coveralls (~> 0.7)
25
46
  rake (~> 10.1)
26
47
  rspec (~> 2.14)
27
48
  ssh-fingerprint!
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ssh-fingerprint
2
2
  ===============
3
- [![Build Status](https://travis-ci.org/victorgama/has_gravatar.png?branch=master)](https://travis-ci.org/victorgama/ssh-fingerprint) [![Dependency Status](https://gemnasium.com/victorgama/ssh-fingerprint.png)](https://gemnasium.com/victorgama/ssh-fingerprint)
3
+ [![Gem Version](https://badge.fury.io/rb/ssh-fingerprint.png)](http://badge.fury.io/rb/ssh-fingerprint) [![Build Status](https://travis-ci.org/victorgama/has_gravatar.png?branch=master)](https://travis-ci.org/victorgama/ssh-fingerprint) [![Dependency Status](https://gemnasium.com/victorgama/ssh-fingerprint.png)](https://gemnasium.com/victorgama/ssh-fingerprint) [![Coverage Status](https://coveralls.io/repos/victorgama/ssh-fingerprint/badge.png)](https://coveralls.io/r/victorgama/ssh-fingerprint)
4
4
 
5
5
  Generate a fingerprint given an SSH public key (without `ssh-keygen` or external dependencies)
6
6
  * based on [bahamas10/node-ssh-fingerprint](https://github.com/bahamas10/node-ssh-fingerprint)
@@ -7,10 +7,11 @@ class SSHFingerprint
7
7
  COLONS = /(.{2})(?=.)/
8
8
 
9
9
  def compute(key)
10
+ key = key.clone
10
11
  key.gsub!(PUBRE, '')
11
12
  key = Base64.decode64(key)
12
13
  key = Digest::MD5.hexdigest(key)
13
- key.gsub(COLONS, '\1:')
14
+ key.gsub!(COLONS, '\1:')
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,5 @@
1
1
  class SSHFingerprint
2
- @@VERSION = "0.0.2"
2
+ @@VERSION = "0.0.3"
3
3
  def self.VERSION
4
4
  @@VERSION
5
5
  end
@@ -1,4 +1,6 @@
1
1
  require 'ssh-fingerprint'
2
+ require 'coveralls'
3
+ Coveralls.wear!
2
4
 
3
5
  describe 'Fingerprint' do
4
6
  let(:key) do
@@ -8,6 +10,13 @@ describe 'Fingerprint' do
8
10
  # Obtained through ssh-keygen -lf ../support/id_rsa.pub
9
11
  let(:known_fingerprint) { 'f5:d8:39:1d:7c:26:0c:07:97:b2:d5:09:2f:dd:45:e4' }
10
12
 
13
+ it 'should not break the key apart!' do
14
+ current_key = key.clone
15
+ used_key = key.clone
16
+ SSHFingerprint.compute(used_key)
17
+ used_key.should eq(current_key)
18
+ end
19
+
11
20
  it 'should match known fingerprint' do
12
21
  SSHFingerprint.compute(key).should eq(known_fingerprint)
13
22
  end
@@ -19,7 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency 'bundler', '~> 1.5'
23
- spec.add_development_dependency 'rake', '~> 10.1'
24
- spec.add_development_dependency 'rspec', '~> 2.14'
22
+ spec.add_development_dependency 'bundler', '~> 1.5'
23
+ spec.add_development_dependency 'rake', '~> 10.1'
24
+ spec.add_development_dependency 'rspec', '~> 2.14'
25
+ spec.add_development_dependency 'coveralls', '~> 0.7'
25
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssh-fingerprint
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
  - Victor Gama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.7'
55
69
  description: Generate a fingerprint given an SSH public key (without `ssh-keygen`
56
70
  or external dependencies)
57
71
  email: