cocoapods-keys 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile.lock +16 -1
- data/Rakefile +5 -0
- data/cocoapods_keys.gemspec +1 -0
- data/lib/cocoapods_keys.rb +1 -1
- data/lib/key_master.rb +9 -92
- data/lib/name_whisperer.rb +1 -1
- data/lib/plugin.rb +18 -7
- data/lib/preinstaller.rb +1 -1
- data/spec/fixtures/Keys_empty.h +12 -0
- data/spec/fixtures/Keys_empty.m +44 -0
- data/spec/key_master_spec.rb +56 -0
- data/spec/keyring_liberator_spec.rb +30 -0
- data/spec/plugin_spec.rb +14 -0
- data/spec/spec_helper.rb +12 -0
- data/templates/Keys.h.erb +13 -0
- data/templates/Keys.m.erb +65 -0
- metadata +32 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18be4c87abf2316d890e3cf029d415c0698c9f3e
|
4
|
+
data.tar.gz: 9f00ae2e7edfda4d6241d2902796fa14fbd18be0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2e54f948ebe951f8258552859840c46be4894ddc84884b09d9931aac5da9ebc68d3adfe604c997da9a4fd325650c18f3fe29cde7b8a41400de4c53f2ab07837
|
7
|
+
data.tar.gz: ca51a2f69df3d96ef32acbf8899d81a2467686edc344b4141ee53942749693a96dfa9e0b561cd8019d7a8afd83b3400d22afd618607f127dcf0db6a408c148a6
|
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocoapods-keys (1.0
|
4
|
+
cocoapods-keys (1.1.0)
|
5
5
|
osx_keychain
|
6
6
|
|
7
7
|
GEM
|
@@ -10,9 +10,23 @@ GEM
|
|
10
10
|
RubyInline (3.12.3)
|
11
11
|
ZenTest (~> 4.3)
|
12
12
|
ZenTest (4.11.0)
|
13
|
+
diff-lcs (1.2.5)
|
13
14
|
osx_keychain (1.0.0)
|
14
15
|
RubyInline (~> 3)
|
15
16
|
rake (10.3.2)
|
17
|
+
rspec (3.2.0)
|
18
|
+
rspec-core (~> 3.2.0)
|
19
|
+
rspec-expectations (~> 3.2.0)
|
20
|
+
rspec-mocks (~> 3.2.0)
|
21
|
+
rspec-core (3.2.2)
|
22
|
+
rspec-support (~> 3.2.0)
|
23
|
+
rspec-expectations (3.2.0)
|
24
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
+
rspec-support (~> 3.2.0)
|
26
|
+
rspec-mocks (3.2.1)
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
+
rspec-support (~> 3.2.0)
|
29
|
+
rspec-support (3.2.2)
|
16
30
|
|
17
31
|
PLATFORMS
|
18
32
|
ruby
|
@@ -21,3 +35,4 @@ DEPENDENCIES
|
|
21
35
|
bundler (~> 1.3)
|
22
36
|
cocoapods-keys!
|
23
37
|
rake
|
38
|
+
rspec
|
data/Rakefile
CHANGED
data/cocoapods_keys.gemspec
CHANGED
data/lib/cocoapods_keys.rb
CHANGED
data/lib/key_master.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
require 'set'
|
2
|
+
require 'erb'
|
3
|
+
require 'digest'
|
2
4
|
|
3
5
|
module CocoaPodsKeys
|
4
6
|
class KeyMaster
|
5
7
|
|
6
8
|
attr_accessor :name, :interface, :implementation
|
7
9
|
|
8
|
-
def initialize(keyring)
|
10
|
+
def initialize(keyring, time=Time.now)
|
11
|
+
@time = time
|
9
12
|
@keys = Hash[keyring.keychain_data.map { |(key, value)| [key[0].downcase + key[1..-1], value] }]
|
10
13
|
@name = keyring.code_name + 'Keys'
|
11
14
|
@used_indexes = Set.new
|
@@ -56,103 +59,17 @@ module CocoaPodsKeys
|
|
56
59
|
end
|
57
60
|
|
58
61
|
def generate_interface
|
59
|
-
erb
|
60
|
-
//
|
61
|
-
// Generated by CocoaPods-Keys
|
62
|
-
// on #{Time.now.strftime("%d/%m/%Y")}
|
63
|
-
// For more information see https://github.com/cocoapods/cocoapods-keys
|
64
|
-
//
|
65
|
-
|
66
|
-
#import <Foundation/NSString.h>
|
67
|
-
|
68
|
-
@interface <%= @name %> : NSObject
|
69
|
-
<% @keys.each do |key, value| %>
|
70
|
-
- (NSString *)<%= key %>;<% end %>
|
71
|
-
|
72
|
-
@end
|
73
|
-
SOURCE
|
74
|
-
|
75
|
-
render_erb(erb)
|
62
|
+
render_erb("Keys.h.erb")
|
76
63
|
end
|
77
64
|
|
78
65
|
def generate_implementation
|
79
|
-
|
80
|
-
|
81
|
-
erb = <<-SOURCE
|
82
|
-
//
|
83
|
-
// Generated by CocoaPods-Keys
|
84
|
-
// on #{Time.now.strftime("%d/%m/%Y")}
|
85
|
-
// For more information see https://github.com/cocoapods/cocoapods-keys
|
86
|
-
//
|
87
|
-
|
88
|
-
#import <objc/runtime.h>
|
89
|
-
#import <Foundation/NSDictionary.h>
|
90
|
-
#import "<%= @name %>.h"
|
91
|
-
|
92
|
-
#pragma clang diagnostic push
|
93
|
-
#pragma clang diagnostic ignored "-Wincomplete-implementation"
|
94
|
-
|
95
|
-
@implementation <%= @name %>
|
96
|
-
|
97
|
-
#pragma clang diagnostic pop
|
98
|
-
|
99
|
-
+ (BOOL)resolveInstanceMethod:(SEL)name
|
100
|
-
{
|
101
|
-
NSString *key = NSStringFromSelector(name);
|
102
|
-
NSString * (*implementation)(<%= name %> *, SEL) = NULL;
|
103
|
-
<% @keys.each do |key, value| %>
|
104
|
-
if ([key isEqualToString:@"<%= key %>"]) {
|
105
|
-
implementation = _podKeys<%= Digest::MD5.hexdigest(key) %>;
|
106
|
-
}
|
107
|
-
<% end %>
|
108
|
-
if (!implementation) {
|
109
|
-
return [super resolveInstanceMethod:name];
|
110
|
-
}
|
111
|
-
|
112
|
-
return class_addMethod([self class], name, (IMP)implementation, "@@:");
|
113
|
-
}
|
114
|
-
<% @keys.each do |key, value| %>
|
115
|
-
static NSString *_podKeys<%= Digest::MD5.hexdigest(key) %>(<%= name %> *self, SEL _cmd)
|
116
|
-
{
|
117
|
-
<% if @indexed_keys.length > 0 %>
|
118
|
-
<% if @indexed_keys[key].length > 0 %>
|
119
|
-
char cString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\\0' };
|
120
|
-
<% else %>
|
121
|
-
char cString[1] = { '\\0' };
|
122
|
-
<% end %>
|
123
|
-
return [NSString stringWithCString:cString encoding:NSUTF8StringEncoding];
|
124
|
-
<% else %>
|
125
|
-
return @"";
|
126
|
-
<% end %>
|
127
|
-
}
|
128
|
-
<% end %>
|
129
|
-
|
130
|
-
static char <%= name %>Data[<%= @data_length %>] = "<%= @data %>";
|
131
|
-
|
132
|
-
- (NSString *)description
|
133
|
-
{
|
134
|
-
return [@{
|
135
|
-
<%- @keys.each do |key, value| -%>
|
136
|
-
@"<%= key %>": self.<%= key %>,
|
137
|
-
<%- end -%>
|
138
|
-
} description];
|
139
|
-
}
|
140
|
-
|
141
|
-
- (id)debugQuickLookObject
|
142
|
-
{
|
143
|
-
return [self description];
|
144
|
-
}
|
145
|
-
|
146
|
-
@end
|
147
|
-
SOURCE
|
148
|
-
|
149
|
-
render_erb(erb)
|
66
|
+
render_erb("Keys.m.erb")
|
150
67
|
end
|
151
68
|
|
152
69
|
:private
|
153
|
-
|
154
|
-
def render_erb(
|
155
|
-
|
70
|
+
|
71
|
+
def render_erb(erb_template)
|
72
|
+
erb = IO.read(File.join(__dir__, "../templates", erb_template))
|
156
73
|
ERB.new(erb, nil, '-').result(binding)
|
157
74
|
end
|
158
75
|
|
data/lib/name_whisperer.rb
CHANGED
@@ -27,7 +27,7 @@ module CocoaPodsKeys
|
|
27
27
|
Pathname.new(xcodeprojects[0]).basename.to_s
|
28
28
|
else
|
29
29
|
error_message = (xcodeprojects.length > 1) ? "found too many" : "couldn't find any"
|
30
|
-
puts "
|
30
|
+
puts "CocoaPods-Keys " + error_message + " Xcode projects. Please give a name for this project."
|
31
31
|
|
32
32
|
answer = ""
|
33
33
|
loop do
|
data/lib/plugin.rb
CHANGED
@@ -4,9 +4,9 @@ module CocoaPodsKeys
|
|
4
4
|
class << self
|
5
5
|
def podspec_for_current_project(spec_contents)
|
6
6
|
local_user_options = user_options || {}
|
7
|
-
project = local_user_options.fetch("project"
|
7
|
+
project = local_user_options.fetch("project") { CocoaPodsKeys::NameWhisperer.get_project_name }
|
8
8
|
keyring = KeyringLiberator.get_keyring_named(project) || KeyringLiberator.get_keyring(Dir.getwd)
|
9
|
-
raise Pod::Informative, "Could not load keyring" unless keyring
|
9
|
+
raise Pod::Informative, "Could not load keyring" unless keyring
|
10
10
|
key_master = KeyMaster.new(keyring)
|
11
11
|
|
12
12
|
spec_contents.gsub!(/%%SOURCE_FILES%%/, "#{key_master.name}.{h,m}")
|
@@ -28,7 +28,13 @@ module CocoaPodsKeys
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def user_options
|
31
|
-
podfile.plugins["cocoapods-keys"]
|
31
|
+
options = podfile.plugins["cocoapods-keys"]
|
32
|
+
# Until CocoaPods provides a HashWithIndifferentAccess, normalize the hash keys here.
|
33
|
+
# See https://github.com/CocoaPods/CocoaPods/issues/3354
|
34
|
+
options.inject({}) do |normalized_hash, (key, value)|
|
35
|
+
normalized_hash[key.to_s] = value
|
36
|
+
normalized_hash
|
37
|
+
end
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
@@ -38,15 +44,20 @@ module Pod
|
|
38
44
|
alias_method :install_before_cocoapods_keys!, :install!
|
39
45
|
|
40
46
|
def install!
|
41
|
-
CocoaPodsKeys.setup
|
47
|
+
CocoaPodsKeys.setup if validates_for_keys
|
48
|
+
|
42
49
|
install_before_cocoapods_keys!
|
43
50
|
end
|
44
51
|
|
52
|
+
def validates_for_keys
|
53
|
+
Pod::Config.instance.podfile.plugins["cocoapods-keys"] != nil
|
54
|
+
end
|
55
|
+
|
45
56
|
class Analyzer
|
46
57
|
class SandboxAnalyzer
|
47
58
|
alias_method :pod_state_before_cocoapods_keys, :pod_state
|
48
59
|
|
49
|
-
def pod_state(pod)
|
60
|
+
def pod_state(pod)
|
50
61
|
if pod == 'Keys'
|
51
62
|
# return :added if we were, otherwise assume the Keys have :changed since last install, following my mother's "Better Safe than Sorry" principle.
|
52
63
|
return :added if pod_added?(pod)
|
@@ -60,11 +71,11 @@ module Pod
|
|
60
71
|
end
|
61
72
|
|
62
73
|
class Specification
|
63
|
-
class << self
|
74
|
+
class << self
|
64
75
|
alias_method :from_string_before_cocoapods_keys, :from_string
|
65
76
|
|
66
77
|
def from_string(spec_contents, path, subspec_name = nil)
|
67
|
-
if path.to_s
|
78
|
+
if path.basename.to_s =~ /\AKeys.podspec(?:.json)\Z/
|
68
79
|
CocoaPodsKeys.podspec_for_current_project(spec_contents)
|
69
80
|
end
|
70
81
|
from_string_before_cocoapods_keys(spec_contents, path, subspec_name)
|
data/lib/preinstaller.rb
CHANGED
@@ -11,7 +11,7 @@ module CocoaPodsKeys
|
|
11
11
|
|
12
12
|
options = @user_options || {}
|
13
13
|
current_dir = Dir.getwd
|
14
|
-
project = options.fetch('project'
|
14
|
+
project = options.fetch('project') { CocoaPodsKeys::NameWhisperer.get_project_name }
|
15
15
|
keyring = KeyringLiberator.get_keyring_named(project) || KeyringLiberator.get_keyring(current_dir)
|
16
16
|
|
17
17
|
keyring = CocoaPodsKeys::Keyring.new(project, current_dir, []) unless keyring
|
@@ -0,0 +1,44 @@
|
|
1
|
+
//
|
2
|
+
// Generated by CocoaPods-Keys
|
3
|
+
// on 11/03/2015
|
4
|
+
// For more information see https://github.com/cocoapods/cocoapods-keys
|
5
|
+
//
|
6
|
+
|
7
|
+
#import <objc/runtime.h>
|
8
|
+
#import <Foundation/NSDictionary.h>
|
9
|
+
#import "FakeKeys.h"
|
10
|
+
|
11
|
+
#pragma clang diagnostic push
|
12
|
+
#pragma clang diagnostic ignored "-Wincomplete-implementation"
|
13
|
+
|
14
|
+
@implementation FakeKeys
|
15
|
+
|
16
|
+
#pragma clang diagnostic pop
|
17
|
+
|
18
|
+
+ (BOOL)resolveInstanceMethod:(SEL)name
|
19
|
+
{
|
20
|
+
NSString *key = NSStringFromSelector(name);
|
21
|
+
NSString * (*implementation)(FakeKeys *, SEL) = NULL;
|
22
|
+
|
23
|
+
if (!implementation) {
|
24
|
+
return [super resolveInstanceMethod:name];
|
25
|
+
}
|
26
|
+
|
27
|
+
return class_addMethod([self class], name, (IMP)implementation, "@@:");
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
static char FakeKeysData[] = "";
|
32
|
+
|
33
|
+
- (NSString *)description
|
34
|
+
{
|
35
|
+
return [@{
|
36
|
+
} description];
|
37
|
+
}
|
38
|
+
|
39
|
+
- (id)debugQuickLookObject
|
40
|
+
{
|
41
|
+
return [self description];
|
42
|
+
}
|
43
|
+
|
44
|
+
@end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'key_master'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
describe CocoaPodsKeys::KeyMaster do
|
6
|
+
let(:empty_keys_interface) {
|
7
|
+
IO.read(File.join(__dir__, "fixtures", "Keys_empty.h"))
|
8
|
+
}
|
9
|
+
|
10
|
+
let(:empty_keys_implementation) {
|
11
|
+
IO.read(File.join(__dir__, "fixtures", "Keys_empty.m"))
|
12
|
+
}
|
13
|
+
|
14
|
+
it "should work with an empty keyring" do
|
15
|
+
keyring = double("Keyring", keychain_data: [], code_name: "Fake")
|
16
|
+
keymaster = described_class.new(keyring, Time.new(2015, 3, 11))
|
17
|
+
expect(keymaster.name).to eq("FakeKeys")
|
18
|
+
expect(keymaster.interface).to eq(empty_keys_interface)
|
19
|
+
expect(keymaster.implementation).to eq(empty_keys_implementation)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should generate valid empty objc files", requires_clang: true do
|
23
|
+
keyring = double("Keyring", keychain_data: [], code_name: "Fake")
|
24
|
+
keymaster = described_class.new(keyring, Time.new(2015, 3, 11))
|
25
|
+
expect(validate_syntax(keymaster)).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should escape backslashes" do
|
29
|
+
keyring = double("Keyring", keychain_data: [], code_name: "Fake")
|
30
|
+
keymaster = described_class.new(keyring, Time.new(2015, 3, 11))
|
31
|
+
keymaster.instance_variable_set(:@data, '\4')
|
32
|
+
expect(keymaster.generate_implementation).to include('"\\\4"')
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should escape double-quotes" do
|
36
|
+
keyring = double("Keyring", keychain_data: [], code_name: "Fake")
|
37
|
+
keymaster = described_class.new(keyring, Time.new(2015, 3, 11))
|
38
|
+
keymaster.instance_variable_set(:@data, '"')
|
39
|
+
expect(keymaster.generate_implementation).to include('"\\""')
|
40
|
+
end
|
41
|
+
|
42
|
+
def validate_syntax(keymaster)
|
43
|
+
# write out the interface and the implementation to temp files
|
44
|
+
Dir.mktmpdir do |dir|
|
45
|
+
# create the header file
|
46
|
+
h_file = File.join(dir, "#{keymaster.name}.h")
|
47
|
+
IO.write(h_file, keymaster.interface)
|
48
|
+
# create the implementation file
|
49
|
+
m_file = File.join(dir, "#{keymaster.name}.m")
|
50
|
+
IO.write(m_file, keymaster.implementation)
|
51
|
+
# attempt to validate syntax with clang
|
52
|
+
Dir.chdir(dir)
|
53
|
+
system(`xcrun --sdk macosx --find clang`.strip, "-fsyntax-only", m_file)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'keyring_liberator'
|
3
|
+
require 'tmpdir'
|
4
|
+
require 'keyring'
|
5
|
+
|
6
|
+
include CocoaPodsKeys
|
7
|
+
|
8
|
+
describe KeyringLiberator do
|
9
|
+
it "should get the keys directory" do
|
10
|
+
expect(KeyringLiberator.keys_dir).to end_with("cocoapods/keys")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should append a sha + .yaml when getting the yaml path" do
|
14
|
+
expect(KeyringLiberator.yaml_path_for_path("test")).to include("cocoapods/keys/")
|
15
|
+
expect(KeyringLiberator.yaml_path_for_path("test")).to end_with("098f6bcd4621d373cade4e832627b4f6.yml")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should find by name" do
|
19
|
+
keyring = Keyring.from_hash({ "name" => "test", "path" =>"testpath", "keys" => [] })
|
20
|
+
allow(KeyringLiberator).to receive(:get_all_keyrings).and_return([keyring])
|
21
|
+
expect(KeyringLiberator.get_keyring_named("test")).to equal(keyring)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should be nil if nothing found find by name" do
|
25
|
+
keyring = Keyring.from_hash({ "name" => "test", "path" =>"testpath", "keys" => [] })
|
26
|
+
allow(KeyringLiberator).to receive(:get_all_keyrings).and_return([keyring])
|
27
|
+
expect(KeyringLiberator.get_keyring_named("not found")).to be_falsey
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
data/spec/plugin_spec.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'cocoapods'
|
3
|
+
require 'cocoapods-core'
|
4
|
+
require 'plugin'
|
5
|
+
#
|
6
|
+
# include Pod
|
7
|
+
#
|
8
|
+
# describe Installer do
|
9
|
+
# it "only runs if the podfile has keys support" do
|
10
|
+
# installer = Installer.new(Sandbox.new("."), Podfile.new)
|
11
|
+
# installer.install!
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
def clang_available
|
4
|
+
# uses a shell to ensure we get a reasonable PATH
|
5
|
+
system("which -s clang")
|
6
|
+
end
|
7
|
+
|
8
|
+
RSpec.configure do |c|
|
9
|
+
# exclude tests requiring clang when it's unavailable
|
10
|
+
c.filter_run_excluding requires_clang: true unless clang_available
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// Generated by CocoaPods-Keys
|
3
|
+
// on <%= @time.strftime("%d/%m/%Y") %>
|
4
|
+
// For more information see https://github.com/cocoapods/cocoapods-keys
|
5
|
+
//
|
6
|
+
|
7
|
+
#import <Foundation/NSString.h>
|
8
|
+
|
9
|
+
@interface <%= @name %> : NSObject
|
10
|
+
<% @keys.each do |key, value| %>
|
11
|
+
- (NSString *)<%= key %>;<% end %>
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
//
|
2
|
+
// Generated by CocoaPods-Keys
|
3
|
+
// on <%= @time.strftime("%d/%m/%Y") %>
|
4
|
+
// For more information see https://github.com/cocoapods/cocoapods-keys
|
5
|
+
//
|
6
|
+
|
7
|
+
#import <objc/runtime.h>
|
8
|
+
#import <Foundation/NSDictionary.h>
|
9
|
+
#import "<%= @name %>.h"
|
10
|
+
|
11
|
+
#pragma clang diagnostic push
|
12
|
+
#pragma clang diagnostic ignored "-Wincomplete-implementation"
|
13
|
+
|
14
|
+
@implementation <%= @name %>
|
15
|
+
|
16
|
+
#pragma clang diagnostic pop
|
17
|
+
|
18
|
+
+ (BOOL)resolveInstanceMethod:(SEL)name
|
19
|
+
{
|
20
|
+
NSString *key = NSStringFromSelector(name);
|
21
|
+
NSString * (*implementation)(<%= name %> *, SEL) = NULL;
|
22
|
+
<% @keys.each do |key, value| %>
|
23
|
+
if ([key isEqualToString:@"<%= key %>"]) {
|
24
|
+
implementation = _podKeys<%= Digest::MD5.hexdigest(key) %>;
|
25
|
+
}
|
26
|
+
<% end %>
|
27
|
+
if (!implementation) {
|
28
|
+
return [super resolveInstanceMethod:name];
|
29
|
+
}
|
30
|
+
|
31
|
+
return class_addMethod([self class], name, (IMP)implementation, "@@:");
|
32
|
+
}
|
33
|
+
<% @keys.each do |key, value| %>
|
34
|
+
static NSString *_podKeys<%= Digest::MD5.hexdigest(key) %>(<%= name %> *self, SEL _cmd)
|
35
|
+
{
|
36
|
+
<% if @indexed_keys.length > 0 %>
|
37
|
+
<% if @indexed_keys[key].length > 0 %>
|
38
|
+
char cString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' };
|
39
|
+
<% else %>
|
40
|
+
char cString[1] = { '\0' };
|
41
|
+
<% end %>
|
42
|
+
return [NSString stringWithCString:cString encoding:NSUTF8StringEncoding];
|
43
|
+
<% else %>
|
44
|
+
return @"";
|
45
|
+
<% end %>
|
46
|
+
}
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
static char <%= name %>Data[<%= @data_length %>] = "<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>";
|
50
|
+
|
51
|
+
- (NSString *)description
|
52
|
+
{
|
53
|
+
return [@{
|
54
|
+
<%- @keys.each do |key, value| -%>
|
55
|
+
@"<%= key %>": self.<%= key %>,
|
56
|
+
<%- end -%>
|
57
|
+
} description];
|
58
|
+
}
|
59
|
+
|
60
|
+
- (id)debugQuickLookObject
|
61
|
+
{
|
62
|
+
return [self description];
|
63
|
+
}
|
64
|
+
|
65
|
+
@end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: osx_keychain
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
description: A key value store for environment settings in Cocoa Apps.
|
57
71
|
email:
|
58
72
|
- orta.therox@gmail.com
|
@@ -62,6 +76,7 @@ extensions: []
|
|
62
76
|
extra_rdoc_files: []
|
63
77
|
files:
|
64
78
|
- ".gitignore"
|
79
|
+
- ".travis.yml"
|
65
80
|
- Gemfile
|
66
81
|
- Gemfile.lock
|
67
82
|
- LICENSE.txt
|
@@ -82,6 +97,14 @@ files:
|
|
82
97
|
- lib/pod/command/keys/rm.rb
|
83
98
|
- lib/pod/command/keys/set.rb
|
84
99
|
- lib/preinstaller.rb
|
100
|
+
- spec/fixtures/Keys_empty.h
|
101
|
+
- spec/fixtures/Keys_empty.m
|
102
|
+
- spec/key_master_spec.rb
|
103
|
+
- spec/keyring_liberator_spec.rb
|
104
|
+
- spec/plugin_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- templates/Keys.h.erb
|
107
|
+
- templates/Keys.m.erb
|
85
108
|
homepage: https://github.com/cocoapods/cocoapods-keys
|
86
109
|
licenses:
|
87
110
|
- MIT
|
@@ -108,4 +131,10 @@ specification_version: 4
|
|
108
131
|
summary: CocoaPods Keys will store sensitive data in your Mac's keychain. Then on
|
109
132
|
running pod install they will be installed into your app's source code via the Pods
|
110
133
|
library.
|
111
|
-
test_files:
|
134
|
+
test_files:
|
135
|
+
- spec/fixtures/Keys_empty.h
|
136
|
+
- spec/fixtures/Keys_empty.m
|
137
|
+
- spec/key_master_spec.rb
|
138
|
+
- spec/keyring_liberator_spec.rb
|
139
|
+
- spec/plugin_spec.rb
|
140
|
+
- spec/spec_helper.rb
|