auth_keys_chain 0.0.1
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 +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +674 -0
- data/README.md +64 -0
- data/Rakefile +2 -0
- data/auth_keys_chain.gemspec +23 -0
- data/bin/auth_keys +33 -0
- data/lib/auth_keys/version.rb +3 -0
- data/lib/auth_keys.rb +90 -0
- data/vendor/bundle/cache/auth_keys-0.0.1.gem +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKey/cdesc-AuthKey.ri +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/%5b%5d-c.ri +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/cdesc-AuthKeys.ri +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/get-c.ri +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/keys-c.ri +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/load-c.ri +0 -0
- data/vendor/bundle/doc/auth_keys-0.0.1/ri/cache.ri +0 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/.gitignore +14 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/Gemfile +4 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/LICENSE.txt +674 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/README.md +33 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/Rakefile +2 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/auth_keys.gemspec +23 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/lib/auth_keys/version.rb +3 -0
- data/vendor/bundle/gems/auth_keys-0.0.1/lib/auth_keys.rb +49 -0
- data/vendor/bundle/specifications/auth_keys-0.0.1.gemspec +32 -0
- metadata +99 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
# AuthKeys
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'auth_keys'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install auth_keys
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/takuya/auth_keys/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
32
|
+
|
33
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'auth_keys/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "auth_keys"
|
8
|
+
spec.version = AuthKey::VERSION
|
9
|
+
spec.authors = ["takuya"]
|
10
|
+
spec.email = ["takuy.a.1st+nospam@gmail.com"]
|
11
|
+
spec.summary = %q{Password loads in ~/.auth_keys }
|
12
|
+
spec.description = %q{Password loads in ~/.auth_keys }
|
13
|
+
spec.homepage = "https://github.com/takuya/auth_key"
|
14
|
+
spec.license = "GPL3"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
### ~/.auth_keys
|
3
|
+
# softbank 080xxxxxx xxxxxxxx
|
4
|
+
# 7spot xxxxxx@gmaol.com xxxx
|
5
|
+
# facebook fsfsf@example.jp xxxxxxxxx
|
6
|
+
###results
|
7
|
+
# AuthKeysload() #=> {
|
8
|
+
# "softbank"=>["08xxxxxx", "xxxxxxx"],
|
9
|
+
# "7spot"=>["example@gmail.com", "xxxxxxxxxxx"],
|
10
|
+
# }
|
11
|
+
#
|
12
|
+
#
|
13
|
+
#
|
14
|
+
#
|
15
|
+
#
|
16
|
+
#
|
17
|
+
class AuthKeys
|
18
|
+
KEY_PATH = "~/.auth_keys"
|
19
|
+
class << self
|
20
|
+
def load
|
21
|
+
path = File.expand_path(KEY_PATH)
|
22
|
+
return unless File.exists?(path)
|
23
|
+
array = open(path).read
|
24
|
+
.split("\n")
|
25
|
+
.reject{|e| e.strip =~/^#/}
|
26
|
+
.map(&:split).map{|e| [e[0],[ e[1],e[2] ] ] }
|
27
|
+
password_table = Hash[array]
|
28
|
+
end
|
29
|
+
def get(key)
|
30
|
+
hash = self.load
|
31
|
+
hash.key?(key) ? hash[key] : nil ;
|
32
|
+
end
|
33
|
+
def [](key)
|
34
|
+
self.get(key)
|
35
|
+
end
|
36
|
+
def keys
|
37
|
+
self.load.keys
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
if $0 == __FILE__ then
|
44
|
+
require 'pp'
|
45
|
+
pp AuthKeys["softbank"]
|
46
|
+
pp AuthKeys.keys
|
47
|
+
pp AuthKeys.load
|
48
|
+
end
|
49
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "auth_keys"
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["takuya"]
|
9
|
+
s.date = "2015-08-07"
|
10
|
+
s.description = "Password loads in ~/.auth_keys "
|
11
|
+
s.email = ["takuy.a.1st+nospam@gmail.com"]
|
12
|
+
s.homepage = "https://github.com/takuya/auth_key"
|
13
|
+
s.licenses = ["GPL3"]
|
14
|
+
s.require_paths = ["lib"]
|
15
|
+
s.rubygems_version = "2.0.14"
|
16
|
+
s.summary = "Password loads in ~/.auth_keys"
|
17
|
+
|
18
|
+
if s.respond_to? :specification_version then
|
19
|
+
s.specification_version = 4
|
20
|
+
|
21
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
22
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.7"])
|
23
|
+
s.add_development_dependency(%q<rake>, ["~> 10.0"])
|
24
|
+
else
|
25
|
+
s.add_dependency(%q<bundler>, ["~> 1.7"])
|
26
|
+
s.add_dependency(%q<rake>, ["~> 10.0"])
|
27
|
+
end
|
28
|
+
else
|
29
|
+
s.add_dependency(%q<bundler>, ["~> 1.7"])
|
30
|
+
s.add_dependency(%q<rake>, ["~> 10.0"])
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: auth_keys_chain
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- takuya
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: 'Passwords save/load in ~/.auth_keys(plain text table) '
|
42
|
+
email:
|
43
|
+
- takuy.a.1st+nospam@gmail.com
|
44
|
+
executables:
|
45
|
+
- auth_keys
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- auth_keys_chain.gemspec
|
55
|
+
- bin/auth_keys
|
56
|
+
- lib/auth_keys.rb
|
57
|
+
- lib/auth_keys/version.rb
|
58
|
+
- vendor/bundle/cache/auth_keys-0.0.1.gem
|
59
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKey/cdesc-AuthKey.ri
|
60
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/%5b%5d-c.ri
|
61
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/cdesc-AuthKeys.ri
|
62
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/get-c.ri
|
63
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/keys-c.ri
|
64
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/AuthKeys/load-c.ri
|
65
|
+
- vendor/bundle/doc/auth_keys-0.0.1/ri/cache.ri
|
66
|
+
- vendor/bundle/gems/auth_keys-0.0.1/.gitignore
|
67
|
+
- vendor/bundle/gems/auth_keys-0.0.1/Gemfile
|
68
|
+
- vendor/bundle/gems/auth_keys-0.0.1/LICENSE.txt
|
69
|
+
- vendor/bundle/gems/auth_keys-0.0.1/README.md
|
70
|
+
- vendor/bundle/gems/auth_keys-0.0.1/Rakefile
|
71
|
+
- vendor/bundle/gems/auth_keys-0.0.1/auth_keys.gemspec
|
72
|
+
- vendor/bundle/gems/auth_keys-0.0.1/lib/auth_keys.rb
|
73
|
+
- vendor/bundle/gems/auth_keys-0.0.1/lib/auth_keys/version.rb
|
74
|
+
- vendor/bundle/specifications/auth_keys-0.0.1.gemspec
|
75
|
+
homepage: https://github.com/takuya/auth_key
|
76
|
+
licenses:
|
77
|
+
- GPLv3
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.0.14
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: Passwords saves/load in ~/.auth_keys
|
99
|
+
test_files: []
|