security 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 974cae8d45c872de00ec5c142b5d2d3613b60f03
4
+ data.tar.gz: 6cd7d5f700352bc4f3856332de2dea1bb104e71c
5
+ SHA512:
6
+ metadata.gz: 0e6a6ea95a2ddb21c93234d202701347079cb1d441e28f9d388065c5484ca44f3d312faa94b160a5c0e73b76cd675c3a3dee8caec2c36f4541ce1685a47355fa
7
+ data.tar.gz: b2336082e2bd82876bbefa371191ad20ff3d68cf03a96ee3fac2ded425a4e95f1f12a07d6001f6ed9c3add3febc32051700c44fee49187332ce94fb101b8c0e4
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- security (0.1.2)
4
+ security (0.1.3)
5
5
 
6
6
  GEM
7
- remote: http://rubygems.org/
7
+ remote: https://rubygems.org/
8
8
  specs:
9
9
  rake (0.9.2.2)
10
10
  rspec (0.6.4)
@@ -1,9 +1,4 @@
1
- module Security
2
- VERSION = "0.1.2"
3
- end
4
-
5
- require 'shellwords'
6
-
1
+ require 'security/version'
7
2
  require 'security/keychain'
8
3
  require 'security/certificate'
9
4
  require 'security/password'
@@ -16,4 +16,4 @@ module Security
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -1,3 +1,5 @@
1
+ require 'shellwords'
2
+
1
3
  module Security
2
4
  class Keychain
3
5
  DOMAINS = [:user, :system, :common, :dynamic]
@@ -56,6 +58,6 @@ module Security
56
58
  def keychains_from_output(output)
57
59
  output.split(/\n/).collect{|line| new(line.strip.gsub(/^\"|\"$/, ""))}
58
60
  end
59
- end
61
+ end
60
62
  end
61
63
  end
@@ -1,3 +1,5 @@
1
+ require 'shellwords'
2
+
1
3
  module Security
2
4
  class Password
3
5
  attr_reader :keychain, :attributes, :password
@@ -7,14 +9,14 @@ module Security
7
9
  def initialize(keychain, attributes, password)
8
10
  @keychain = Keychain.new(keychain)
9
11
  @attributes = attributes
10
- @password = password
12
+ @password = password
11
13
  end
12
14
 
13
15
  class << self
14
16
  private
15
17
 
16
18
  def password_from_output(output)
17
- return nil if /^security\: / === output
19
+ return nil if /^security\: / === output
18
20
 
19
21
  keychain, attributes, password = nil, {}, nil
20
22
  output.split(/\n/).each do |line|
@@ -33,12 +35,12 @@ module Security
33
35
 
34
36
  def flags_for_options(options = {})
35
37
  flags = options.dup
36
- flags[:a] ||= options.delete(:account)
37
- flags[:c] ||= options.delete(:creator)
38
- flags[:C] ||= options.delete(:type)
39
- flags[:D] ||= options.delete(:kind)
40
- flags[:G] ||= options.delete(:value)
41
- flags[:j] ||= options.delete(:comment)
38
+ flags[:a] ||= flags.delete(:account)
39
+ flags[:c] ||= flags.delete(:creator)
40
+ flags[:C] ||= flags.delete(:type)
41
+ flags[:D] ||= flags.delete(:kind)
42
+ flags[:G] ||= flags.delete(:value)
43
+ flags[:j] ||= flags.delete(:comment)
42
44
 
43
45
  flags.delete_if{|k,v| v.nil?}.collect{|k, v| "-#{k} #{v.shellescape}".strip}.join(" ")
44
46
  end
@@ -78,7 +80,7 @@ module Security
78
80
  options[:a] = account
79
81
  options[:s] = server
80
82
  options[:w] = password
81
-
83
+
82
84
  system "security add-internet-password #{flags_for_options(options)}"
83
85
  end
84
86
 
@@ -0,0 +1,3 @@
1
+ module Security
2
+ VERSION = "0.1.3"
3
+ end
metadata CHANGED
@@ -1,38 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: security
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mattt Thompson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-07-21 00:00:00.000000000Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
- requirement: &70304035253220 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.6.1
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *70304035253220
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.1
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rake
27
- requirement: &70304035252680 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
33
  version: 0.9.2
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *70304035252680
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.9.2
36
41
  description: Library for interacting with the Mac OS X Keychain
37
42
  email: m@mattt.me
38
43
  executables: []
@@ -44,41 +49,33 @@ files:
44
49
  - ./lib/security/certificate.rb
45
50
  - ./lib/security/keychain.rb
46
51
  - ./lib/security/password.rb
52
+ - ./lib/security/version.rb
47
53
  - ./lib/security.rb
48
54
  - ./LICENSE
49
55
  - ./Rakefile
50
56
  - ./README.md
51
- - ./security-0.1.0.gem
52
- - ./security-0.1.1.gem
53
57
  - ./security.gemspec
54
58
  homepage: http://mattt.me
55
59
  licenses: []
60
+ metadata: {}
56
61
  post_install_message:
57
62
  rdoc_options: []
58
63
  require_paths:
59
64
  - lib
60
65
  required_ruby_version: !ruby/object:Gem::Requirement
61
- none: false
62
66
  requirements:
63
- - - ! '>='
67
+ - - '>='
64
68
  - !ruby/object:Gem::Version
65
69
  version: '0'
66
- segments:
67
- - 0
68
- hash: -1161416136524147904
69
70
  required_rubygems_version: !ruby/object:Gem::Requirement
70
- none: false
71
71
  requirements:
72
- - - ! '>='
72
+ - - '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
- segments:
76
- - 0
77
- hash: -1161416136524147904
78
75
  requirements: []
79
76
  rubyforge_project:
80
- rubygems_version: 1.8.15
77
+ rubygems_version: 2.1.11
81
78
  signing_key:
82
- specification_version: 3
79
+ specification_version: 4
83
80
  summary: Security
84
81
  test_files: []
Binary file
Binary file