cocoapods-keys 2.0.5 → 2.2.1

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
- SHA1:
3
- metadata.gz: 635f4e1b61f52669ce98378592e4eb6eefb0d879
4
- data.tar.gz: d6ff4f21c5c32b58880d7a83e3ce48d988420d83
2
+ SHA256:
3
+ metadata.gz: 86d06ce794bdfa758b1001238ec11e6ae635274623f72ca9722ff33b7b11ae4c
4
+ data.tar.gz: bd2d607a2b0956d7c2e0fc620fc2bd115861dbc041fe297c474a1b63c33b49b1
5
5
  SHA512:
6
- metadata.gz: b7f6572ebacd2b6cfb9e0823b9befa6169d6ef0a2579b0338b1abb406d282e230a5124603dd3b66691e0d66f1281285dc13f9e1196aa7705d57ff768e2470339
7
- data.tar.gz: a0609ef4cee14a1b12c689ad2b92be5c4b4d91a3542c4d6ea7c7f48dca0cd2cc2f25274ab1bf726ca6c567287f21cd32bbbaa5603949cccbaf5022c23af1c0d6
6
+ metadata.gz: fea1b50b535fedd2326333f297620ec467d2de7416a7bae36af2cfe7414f85edf9b69b30cc08648adcd4294718e14ccab7c3d37cbffca2f687290f3e2d452fc8
7
+ data.tar.gz: dfb7ce7bd1ff9648f802357c32acf44579ae76b1e035d1b526f73b7b1b901b314ab3eacd9fc739b0d137e3c61455dfb6f23a1f9c85e2084b56a3f542860e7a0a
@@ -1,5 +1,25 @@
1
1
  ## Master
2
2
 
3
+ ## 2.2.1
4
+
5
+ * Fixed Keys.m generation when there are empty-string keys. [rogerluan]
6
+
7
+ ## 2.2.0
8
+
9
+ * Revised template which doesn't allow for secrets to appear in the binaries in modern Xcode builds. [ashfurrow]
10
+
11
+ ## 2.1.0
12
+
13
+ * Add the ability to manually specify keys when running `pod keys generate`. [fwal]
14
+
15
+ ## 2.0.7
16
+
17
+ * Fix keys not recorded in YML on first run. [ileitch]
18
+
19
+ ## 2.0.6
20
+
21
+ * Makes list of keys unique on the yaml file [leoformaggio]
22
+
3
23
  ## 2.0.4 - 2.0.5
4
24
 
5
25
  * Handles more CIs [SlaunchaMan]
@@ -10,15 +30,15 @@
10
30
 
11
31
  ## 2.0.2
12
32
 
13
- * Sets a minimum iOS target of 8.0 [orta]
33
+ * Sets a minimum iOS target of 8.0 [orta]
14
34
 
15
35
  ## 2.0.1
16
36
 
17
- * Handles more CI types [m-ruhl]
37
+ * Handles more CI types [m-ruhl]
18
38
 
19
39
  ## 2.0.0
20
40
 
21
- * Handles casing correctly in generated key names [breaking] [marcelofabri]
41
+ * Handles casing correctly in generated key names [breaking] [marcelofabri]
22
42
  * Adds Nullability notations to default erb template [Skogetroll]
23
43
  * Use properties for accessing key values instead of functions [breaking, for swift] [Skogetroll]
24
44
  * Don't ask for keys on the command line when running on CI. [dantoml]
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-keys (2.0.5)
4
+ cocoapods-keys (2.1.0)
5
5
  dotenv
6
6
  osx_keychain
7
7
 
@@ -11,7 +11,7 @@ GEM
11
11
  CFPropertyList (2.3.5)
12
12
  RubyInline (3.12.4)
13
13
  ZenTest (~> 4.3)
14
- ZenTest (4.11.1)
14
+ ZenTest (4.11.2)
15
15
  activesupport (4.2.9)
16
16
  i18n (~> 0.7)
17
17
  minitest (~> 5.1)
@@ -53,7 +53,7 @@ GEM
53
53
  colored (1.2)
54
54
  colored2 (3.1.2)
55
55
  diff-lcs (1.3)
56
- dotenv (2.2.1)
56
+ dotenv (2.6.0)
57
57
  escape (0.0.4)
58
58
  fourflusher (0.3.2)
59
59
  fuzzy_match (2.0.4)
@@ -116,4 +116,4 @@ DEPENDENCIES
116
116
  rubocop
117
117
 
118
118
  BUNDLED WITH
119
- 1.16.1
119
+ 1.16.4
data/README.md CHANGED
@@ -42,23 +42,23 @@ Then running `pod install` will prompt for the keys not yet set and you can ensu
42
42
 
43
43
  You can save keys on a per-project basis by running the command:
44
44
 
45
- $ pod keys set KEY VALUE
45
+ $ bundle exec pod keys set KEY VALUE
46
46
 
47
47
  You can list all known keys by running:
48
48
 
49
- $ pod keys
49
+ $ bundle exec pod keys
50
50
 
51
51
  For example:
52
52
 
53
53
  ``` sh
54
54
  $ cd MyApplication
55
- $ pod keys set "NetworkAPIToken" "AH2ZMiraGQbyUd9GkNTNfWEdxlwXcmHciEOH"
55
+ $ bundle exec pod keys set "NetworkAPIToken" "AH2ZMiraGQbyUd9GkNTNfWEdxlwXcmHciEOH"
56
56
  Saved NetworkAPIToken to MyApplication.
57
57
 
58
- $ pod keys set "AnalyticsToken" "6TYKGVCn7sBSBFpwfSUCclzDoSBtEXw7"
58
+ $ bundle exec pod keys set "AnalyticsToken" "6TYKGVCn7sBSBFpwfSUCclzDoSBtEXw7"
59
59
  Saved AnalyticsToken to MyApplication.
60
60
 
61
- $ pod keys
61
+ $ bundle exec pod keys
62
62
  Keys for MyApplication
63
63
  ├ NetworkAPIToken - AH2ZMiraGQbyUd9GkNTNfWEdxlwXcmHciEOH
64
64
  └ AnalyticsToken - 6TYKGVCn7sBSBFpwfSUCclzDoSBtEXw7
@@ -95,16 +95,16 @@ Some documentation is also available to [use cocoapods-keys in Swift projects](S
95
95
 
96
96
  CocoaPods-keys has 3 other commands:
97
97
 
98
- * `pod keys get [key] [optional project]`
98
+ * `bundle exec pod keys get [key] [optional project]`
99
99
  Which will output the value of the key to STDOUT, useful for scripting.
100
100
 
101
- * `pod keys rm [key] [optional project]`
102
- Will remove a key from a project.
101
+ * `bundle exec pod keys rm [key] [optional project]`
102
+ Will remove a key from a project.
103
103
 
104
- If Wildcards are included, it will remove the keys matching the pattern. E.g.: `pod keys rm "G*og*"` will remove *all* the keys that begin with 'G', have 'og' in the middle and end with anything.
105
- To nuke all the keys, run either `pod keys rm "*"` or `pod keys rm --all`
104
+ If Wildcards are included, it will remove the keys matching the pattern. E.g.: `bundle exec pod keys rm "G*og*"` will remove *all* the keys that begin with 'G', have 'og' in the middle and end with anything.
105
+ To nuke all the keys, run either `bundle exec pod keys rm "*"` or `bundle exec pod keys rm --all`
106
106
 
107
- * `pod keys generate [optional project]`
107
+ * `bundle exec pod keys generate [optional project]`
108
108
  Will generate the obfuscated Objective-C keys class (mainly used internally).
109
109
 
110
110
  #### Continuous Integration
@@ -1,7 +1,7 @@
1
1
  # Using CocoaPods-Keys in Swift projects
2
2
 
3
3
  Once you've followed the setup instructions described in the [Usage](README.md#usage)
4
- section of the README, you have two choices.
4
+ section of the README, you are ready to use `Keys` from Swift.
5
5
 
6
6
  ## Importing the framework
7
7
 
@@ -1,3 +1,3 @@
1
1
  module CocoaPodsKeys
2
- VERSION = '2.0.5'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
@@ -84,7 +84,7 @@ module CocoaPodsKeys
84
84
  end
85
85
 
86
86
  def key_data_arrays
87
- Hash[@indexed_keys.map { |key, value| [key, value.map { |i| name + "Data[#{i}]" }.join(', ')] }]
87
+ Hash[@indexed_keys.map { |key, value| [key, value.map { |i| '[' + name + "Data characterAtIndex:#{i}]" }.join(', ')] }]
88
88
  end
89
89
  end
90
90
  end
@@ -16,14 +16,19 @@ module Pod
16
16
 
17
17
  self.arguments = [CLAide::Argument.new('project_name', false)]
18
18
 
19
+ def self.options
20
+ [['--keys=key1,key2...', 'An array of keys to add if no keyring is found']].concat(super)
21
+ end
22
+
19
23
  def initialize(argv)
20
24
  @project_name = argv.shift_argument
25
+ @keys = argv.option('keys', '').split(',')
21
26
  super
22
27
  end
23
28
 
24
29
  def run
25
30
  Dotenv.load
26
- keyring = get_current_keyring
31
+ keyring = get_current_keyring || CocoaPodsKeys::Keyring.new(@project_name, '/', @keys)
27
32
 
28
33
  if keyring
29
34
 
@@ -40,6 +40,7 @@ module Pod
40
40
 
41
41
  keyring = get_current_keyring || create_keyring
42
42
  keyring.keys << @key_name.tr('-', '_')
43
+ keyring.keys.uniq!
43
44
  CocoaPodsKeys::KeyringLiberator.save_keyring keyring
44
45
 
45
46
  keyring.save @key_name, @key_value
@@ -65,7 +65,6 @@ module CocoaPodsKeys
65
65
  setter.run
66
66
  end
67
67
  end
68
- CocoaPodsKeys::KeyringLiberator.save_keyring(keyring)
69
68
 
70
69
  existing_keyring || !keys.empty?
71
70
  end
@@ -4,51 +4,43 @@
4
4
  // For more information see https://github.com/orta/cocoapods-keys
5
5
  //
6
6
 
7
- #import <objc/runtime.h>
8
7
  #import <Foundation/NSDictionary.h>
9
8
  #import "<%= @name %>.h"
10
9
 
11
- #pragma clang diagnostic push
12
- #pragma clang diagnostic ignored "-Wincomplete-implementation"
10
+ @interface <%= @name %> ()
13
11
 
14
- @implementation <%= @name %>
15
- <% @keys.each do |key, value| %>
16
- @dynamic <%= key %>;<% end %>
12
+ <% @keys.each do |key, value| %>@property (nonatomic, copy) NSString *<%= key %>;
13
+ <% end %>
17
14
 
18
- #pragma clang diagnostic pop
15
+ @end
19
16
 
20
- + (BOOL)resolveInstanceMethod:(SEL)name
21
- {
22
- NSString *key = NSStringFromSelector(name);
23
- NSString * (*implementation)(<%= name %> *, SEL) = NULL;
24
- <% @keys.each do |key, value| %>
25
- if ([key isEqualToString:@"<%= key %>"]) {
26
- implementation = _podKeys<%= Digest::MD5.hexdigest(key) %>;
27
- }
28
- <% end %>
29
- if (!implementation) {
30
- return [super resolveInstanceMethod:name];
31
- }
17
+ @implementation <%= @name %>
32
18
 
33
- return class_addMethod([self class], name, (IMP)implementation, "@@:");
34
- }
35
- <% @keys.each do |key, value| %>
36
- static NSString *_podKeys<%= Digest::MD5.hexdigest(key) %>(<%= name %> *self, SEL _cmd)
19
+ - (instancetype)init
37
20
  {
38
- <% if @indexed_keys.length > 0 %>
21
+ if (!(self = [super init])) { return nil; }
22
+
23
+ <% @keys.each do |key, value| %>
39
24
  <% if @indexed_keys[key].length > 0 %>
40
- char cString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' };
25
+ char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' };
41
26
  <% else %>
42
- char cString[1] = { '\0' };
27
+ char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { '\0' };
28
+ <% end %>
29
+ _<%= key %> = <% if @indexed_keys.length > 0 %>
30
+ <% if @indexed_keys[key].length > 0 %>
31
+ [NSString stringWithCString:<%= key %>CString encoding:NSUTF8StringEncoding];
32
+ <% else %>
33
+ @"";
34
+ <% end %>
35
+ <% else %>
36
+ @"";
37
+ <% end %>
43
38
  <% end %>
44
- return [NSString stringWithCString:cString encoding:NSUTF8StringEncoding];
45
- <% else %>
46
- return @"";
47
- <% end %>
39
+
40
+ return self;
48
41
  }
49
- <% end %>
50
42
 
51
- static char <%= name %>Data[<%= @data_length %>] = "<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>";
43
+ static NSString *<%= name %>Data = @"<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>";
52
44
 
53
45
  - (NSString *)description
54
46
  {
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: 2.0.5
4
+ version: 2.2.1
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: 2018-07-12 00:00:00.000000000 Z
12
+ date: 2020-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: osx_keychain
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.2.2
167
+ rubygems_version: 2.7.6
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: CocoaPods Keys will store sensitive data in your Mac's keychain. Then on