agent_smith 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 05582a89d7d39897ec63dddd3dc6d236da3c74a6
4
+ data.tar.gz: 150ba9be7e02008423dbaf7aba441b1c7e0a2612
5
+ SHA512:
6
+ metadata.gz: 0337e0d66789d83e642e35f9ae5174efd2e3c14f8738f07559e1688cf8033d8bc5c42f54ed953724706e69563e79d6b09d172317df912027b271131de0fd89ef
7
+ data.tar.gz: cc66bbaceb0114a4fcf4a739b411c27a8b4451c4515bec5c67976501390efbb3aad7111f081b6d4115099bdfc7d10077604df2d5f0a2f14cb945137f90d09850
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Luca Querella
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ Agent Smith
2
+ ----
3
+
4
+ Tiny small tool that allow you to synchronise the provisioining profiles installed on your machine with the ones collected in a git repository
5
+
6
+
7
+ How to Install
8
+ ----
9
+
10
+ ```
11
+ gem install agent_smit
12
+ ```
13
+
14
+ Usage
15
+ ----
16
+
17
+ ```
18
+ Usage:
19
+ agent_smith delete_all
20
+
21
+ delete all the provisioning profiles installed.
22
+
23
+
24
+ Usage:
25
+ agent_smith install --repo=REPO
26
+
27
+ Options:
28
+ --repo=REPO
29
+
30
+ Description:
31
+ `agent_smith install --repo=git@github.com:Organization/provisioning-profiles`
32
+ will execute `agent_smith delete_all` and then will install all
33
+ the provisioning profiles prent in the root of the given repository.
34
+
35
+ ```
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'agent_smith/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "agent_smith"
8
+ spec.version = AgentSmith::VERSION
9
+ spec.authors = ["Luca Querella"]
10
+ spec.email = ["luca.querella@gmail.com"]
11
+ spec.summary = "Manage your organization provisioning profile!"
12
+ spec.description = "A simple gem to fetch provisioning profiles from a git repository and install them"
13
+ spec.homepage = "https://github.com/BendingSpoons/agent-smith"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_dependency "thor", "~> 0.19.1"
23
+ spec.add_dependency "plist", "~> 3.1.0"
24
+
25
+ end
26
+
data/bin/agent_smith ADDED
@@ -0,0 +1,4 @@
1
+
2
+ require "agent_smith"
3
+
4
+ AgentSmith::CLI.start(ARGV)
@@ -0,0 +1,3 @@
1
+ module AgentSmith
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,67 @@
1
+ require "agent_smith/version"
2
+ require "thor"
3
+ require "openssl"
4
+ require 'open-uri'
5
+ require 'plist'
6
+
7
+ PROVISIONING_PATH = "#{Dir.home}/Library/MobileDevice/Provisioning Profiles/"
8
+ APPLE_ROOT_CERTIFICATE_URL = 'http://www.apple.com/appleca/AppleIncRootCertificate.cer'
9
+
10
+ module AgentSmith
11
+ class CLI < ::Thor
12
+
13
+ desc "delete_all", "delete all the provisioning profiles installed."
14
+ def delete_all
15
+ prov_profiles = Dir["#{PROVISIONING_PATH}/*.mobileprovision"]
16
+ prov_profiles.each do |file|
17
+ system "rm \"#{file}\""
18
+ puts "#{File.basename(file)} removed"
19
+ end
20
+ puts "done"
21
+ end
22
+
23
+ desc "install", "install provisioning profiles from a repository"
24
+ long_desc <<-LONGDESC
25
+
26
+ `agent_smith install --repo=git@github.com:Organization/provisioning-profiles`
27
+ will execute `agent_smith delete_all` and then will install all the provisioning
28
+ profiles present in the root of the given repository.
29
+
30
+ LONGDESC
31
+
32
+ option :repo, :required => true
33
+ def install
34
+ Dir.mktmpdir do |dir|
35
+
36
+ system "git clone #{options[:repo]} #{dir} &> /dev/null"
37
+ certificate = open(APPLE_ROOT_CERTIFICATE_URL).read()
38
+
39
+ prov_profiles = Dir["#{dir}/*.mobileprovision"]
40
+ puts "#{prov_profiles.count} provisioning profiles found"
41
+
42
+ prov_profiles.each do |prov_profile|
43
+
44
+
45
+ prov_profile_content = File.read(prov_profile)
46
+ p7 = OpenSSL::PKCS7.new(prov_profile_content)
47
+ store = OpenSSL::X509::Store.new
48
+
49
+ cert = OpenSSL::X509::Certificate.new(certificate)
50
+ store.add_cert(cert)
51
+ verification = p7.verify([cert], store)
52
+
53
+ if verification
54
+ plist = Plist::parse_xml(p7.data)
55
+ uuid = plist["UUID"]
56
+ system "cp #{prov_profile} #{PROVISIONING_PATH.gsub(" ","\\ ")}#{uuid}.mobileprovision"
57
+ puts "#{File.basename(prov_profile)} installed"
58
+ else
59
+ puts "#{File.basename(prov_profile)} is not valid"
60
+ end
61
+
62
+ end
63
+ end
64
+ end
65
+
66
+ end
67
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: agent_smith
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Luca Querella
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-12 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
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.19.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.19.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: plist
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 3.1.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 3.1.0
69
+ description: A simple gem to fetch provisioning profiles from a git repository and
70
+ install them
71
+ email:
72
+ - luca.querella@gmail.com
73
+ executables:
74
+ - agent_smith
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - .gitignore
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - agent_smith.gemspec
84
+ - bin/agent_smith
85
+ - lib/agent_smith.rb
86
+ - lib/agent_smith/version.rb
87
+ homepage: https://github.com/BendingSpoons/agent-smith
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.1.11
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Manage your organization provisioning profile!
111
+ test_files: []