cocoapods-app_group 0.1.0

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.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/CODE_OF_CONDUCT.md +13 -0
  6. data/Example/.cocoapods_appgroup +1 -0
  7. data/Example/Example.xcodeproj/project.pbxproj +524 -0
  8. data/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  9. data/Example/Example.xcodeproj/project.xcworkspace/xcuserdata/mzp.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  10. data/Example/Example.xcodeproj/xcuserdata/mzp.xcuserdatad/xcschemes/Example.xcscheme +91 -0
  11. data/Example/Example.xcodeproj/xcuserdata/mzp.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
  12. data/Example/Example.xcworkspace/contents.xcworkspacedata +10 -0
  13. data/Example/Example/AppDelegate.swift +46 -0
  14. data/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +38 -0
  15. data/Example/Example/Base.lproj/LaunchScreen.storyboard +27 -0
  16. data/Example/Example/Base.lproj/Main.storyboard +25 -0
  17. data/Example/Example/Info.plist +40 -0
  18. data/Example/Example/ViewController.swift +28 -0
  19. data/Example/Podfile +6 -0
  20. data/Example/Podfile.lock +14 -0
  21. data/Example/Pods/CocoaPodsAppGroup/AppGroup.h +7 -0
  22. data/Example/Pods/CocoaPodsAppGroup/AppGroup.m +23 -0
  23. data/Example/Pods/CocoaPodsAppGroup/AppGroup.podspec.json +24 -0
  24. data/Example/Pods/Headers/Private/AppGroup/AppGroup.h +7 -0
  25. data/Example/Pods/Local Podspecs/AppGroup.podspec.json +24 -0
  26. data/Example/Pods/Manifest.lock +14 -0
  27. data/Example/Pods/Pods.xcodeproj/project.pbxproj +505 -0
  28. data/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/AppGroup.xcscheme +62 -0
  29. data/Example/Pods/Target Support Files/AppGroup/AppGroup-Private.xcconfig +6 -0
  30. data/Example/Pods/Target Support Files/AppGroup/AppGroup-dummy.m +5 -0
  31. data/Example/Pods/Target Support Files/AppGroup/AppGroup-prefix.pch +4 -0
  32. data/Example/Pods/Target Support Files/AppGroup/AppGroup-umbrella.h +7 -0
  33. data/Example/Pods/Target Support Files/AppGroup/AppGroup.modulemap +6 -0
  34. data/Example/Pods/Target Support Files/AppGroup/AppGroup.xcconfig +1 -0
  35. data/Example/Pods/Target Support Files/AppGroup/Info.plist +26 -0
  36. data/Example/Pods/Target Support Files/Pods/Info.plist +26 -0
  37. data/Example/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown +7 -0
  38. data/Example/Pods/Target Support Files/Pods/Pods-acknowledgements.plist +37 -0
  39. data/Example/Pods/Target Support Files/Pods/Pods-dummy.m +5 -0
  40. data/Example/Pods/Target Support Files/Pods/Pods-frameworks.sh +59 -0
  41. data/Example/Pods/Target Support Files/Pods/Pods-resources.sh +95 -0
  42. data/Example/Pods/Target Support Files/Pods/Pods-umbrella.h +6 -0
  43. data/Example/Pods/Target Support Files/Pods/Pods.debug.xcconfig +7 -0
  44. data/Example/Pods/Target Support Files/Pods/Pods.modulemap +6 -0
  45. data/Example/Pods/Target Support Files/Pods/Pods.release.xcconfig +7 -0
  46. data/Example/ReadFromAppGroup/AppDelegate.swift +46 -0
  47. data/Example/ReadFromAppGroup/Assets.xcassets/AppIcon.appiconset/Contents.json +38 -0
  48. data/Example/ReadFromAppGroup/Base.lproj/LaunchScreen.storyboard +27 -0
  49. data/Example/ReadFromAppGroup/Base.lproj/Main.storyboard +25 -0
  50. data/Example/ReadFromAppGroup/Info.plist +40 -0
  51. data/Example/ReadFromAppGroup/ReadFromAppGroup.entitlements +10 -0
  52. data/Example/ReadFromAppGroup/ViewController.swift +26 -0
  53. data/Example/WriteToAppGroup.entitlements +10 -0
  54. data/Gemfile +6 -0
  55. data/LICENSE.txt +21 -0
  56. data/README.md +90 -0
  57. data/Rakefile +6 -0
  58. data/bin/console +14 -0
  59. data/bin/setup +7 -0
  60. data/cocoapods-app_group.gemspec +25 -0
  61. data/lib/cocoapods/app_group.rb +6 -0
  62. data/lib/cocoapods/app_group/hook.rb +18 -0
  63. data/lib/cocoapods/app_group/setup.rb +58 -0
  64. data/lib/cocoapods/app_group/store.rb +41 -0
  65. data/lib/cocoapods/app_group/template.rb +27 -0
  66. data/lib/cocoapods/app_group/version.rb +5 -0
  67. data/lib/cocoapods_plugin.rb +1 -0
  68. data/lib/pod/command/app_group.rb +31 -0
  69. data/templates/AppGroup.h +7 -0
  70. data/templates/AppGroup.m +23 -0
  71. data/templates/AppGroup.podspec.json +24 -0
  72. metadata +158 -0
@@ -0,0 +1,41 @@
1
+ require 'json'
2
+
3
+ module CocoaPods
4
+ module AppGroup
5
+ class Store
6
+ attr_reader :path
7
+
8
+ def initialize(path = default_root)
9
+ @path = path
10
+ end
11
+
12
+ def read(name)
13
+ table[name.to_s]
14
+ end
15
+
16
+ def write(name, value)
17
+ saving { table[name.to_s] = value }
18
+ end
19
+
20
+ private
21
+
22
+ def default_root
23
+ Pod::Config.instance.installation_root.join('.cocoapods_appgroup')
24
+ end
25
+
26
+ def table
27
+ @table ||= JSON.parse File.read(path)
28
+ rescue Errno::ENOENT, JSON::ParserError
29
+ @table ||= {}
30
+ end
31
+
32
+ def saving(&f)
33
+ f.call.tap do
34
+ File.open(path, 'w+') do |io|
35
+ JSON.dump table, io
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,27 @@
1
+ require 'erb'
2
+
3
+ module CocoaPods
4
+ module AppGroup
5
+ class Template
6
+ attr_reader :path
7
+
8
+ def initialize(path)
9
+ @path = path
10
+ end
11
+
12
+ def call(dest)
13
+ File.write dest, ERB.new(content).result(binding)
14
+ end
15
+
16
+ private
17
+
18
+ def content
19
+ @content ||= File.read(path)
20
+ end
21
+
22
+ def store
23
+ @store ||= Store.new
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ module Cocoapods
2
+ module AppGroup
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods/app_group'
@@ -0,0 +1,31 @@
1
+ module Pod
2
+ class Command
3
+ class AppGroup < Command
4
+ self.summary = 'Setup app group'
5
+ self.description = 'Setup app group'
6
+
7
+ self.arguments = [CLAide::Argument.new('app-group', true)]
8
+
9
+ attr_reader :app_group
10
+
11
+ def initialize(argv)
12
+ @app_group = argv.shift_argument
13
+ super
14
+ end
15
+
16
+ def validate!
17
+ super
18
+ verify_podfile_exists!
19
+ help! 'A app-group is required.' unless app_group
20
+ end
21
+
22
+ def run
23
+ store.write :app_group, app_group
24
+ end
25
+
26
+ def store
27
+ @store ||= CocoaPods::AppGroup::Store.new
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,7 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ @interface AppGroup : NSObject
4
+ + (NSString *)appGroupID;
5
+ + (NSString *)pathForResource:(NSString *)subpath;
6
+ + (NSUserDefaults*)userDefaults;
7
+ @end
@@ -0,0 +1,23 @@
1
+ #import "AppGroup.h"
2
+
3
+ static NSString * const kAppIdentifier = @"<%= store.read :app_group %>";
4
+
5
+ @implementation AppGroup
6
+
7
+ + (NSString *)appGroupID
8
+ {
9
+ return [NSString stringWithFormat:@"group.%@", kAppIdentifier];
10
+ }
11
+
12
+ + (NSString *)pathForResource:(NSString *)subpath
13
+ {
14
+ NSString *containerPath = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[self appGroupID]].path;
15
+ return [containerPath stringByAppendingPathComponent:subpath];
16
+ }
17
+
18
+ + (NSUserDefaults*)userDefaults
19
+ {
20
+ return [[NSUserDefaults alloc] initWithSuiteName: [self appGroupID]];
21
+ }
22
+
23
+ @end
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "AppGroup",
3
+ "version": "1.0.0",
4
+ "summary": "Injected podspec used by CocoaPods-AppGroup plugin.",
5
+ "description": "This is intended to be used as an injected podspec template \n used by the [CocoaPods-ApGroup plugin](https://github.com/mzp/cocoapods-app_group).\n\n It should *not* be referenced outside of that context. \n",
6
+ "homepage": "https://github.com/mzp/cocoapods-app_group",
7
+ "license": {
8
+ "type": "MIT",
9
+ "text": "MIT LICENSE Found in the repo"
10
+ },
11
+ "authors": {
12
+ "mzp": "mzpppp@gmail.com"
13
+ },
14
+ "source": {
15
+ "git": "https://github.com/mzp/cocoapods-app_group.git",
16
+ "tag": "<%= Cocoapods::AppGroup::VERSION %>"
17
+ },
18
+ "user_target_xcconfig": {
19
+ "APP_IDENTIFIER": "<%= store.read :app_group %>"
20
+ },
21
+ "source_files": "*.{h,m,swift}",
22
+ "frameworks": "Foundation",
23
+ "requires_arc": true
24
+ }
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-app_group
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mzp
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-09-22 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.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
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: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Because app group is strong bound to AppleID, it is hard to distribute
56
+ iOS project using app group. This plugin enable each user to customize app group
57
+ name at setup phase. This make easy to distribute your iOS project.
58
+ email:
59
+ - mzpppp@gmail.com
60
+ executables: []
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - ".rspec"
66
+ - ".travis.yml"
67
+ - CODE_OF_CONDUCT.md
68
+ - Example/.cocoapods_appgroup
69
+ - Example/Example.xcodeproj/project.pbxproj
70
+ - Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
71
+ - Example/Example.xcodeproj/project.xcworkspace/xcuserdata/mzp.xcuserdatad/UserInterfaceState.xcuserstate
72
+ - Example/Example.xcodeproj/xcuserdata/mzp.xcuserdatad/xcschemes/Example.xcscheme
73
+ - Example/Example.xcodeproj/xcuserdata/mzp.xcuserdatad/xcschemes/xcschememanagement.plist
74
+ - Example/Example.xcworkspace/contents.xcworkspacedata
75
+ - Example/Example/AppDelegate.swift
76
+ - Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json
77
+ - Example/Example/Base.lproj/LaunchScreen.storyboard
78
+ - Example/Example/Base.lproj/Main.storyboard
79
+ - Example/Example/Info.plist
80
+ - Example/Example/ViewController.swift
81
+ - Example/Podfile
82
+ - Example/Podfile.lock
83
+ - Example/Pods/CocoaPodsAppGroup/AppGroup.h
84
+ - Example/Pods/CocoaPodsAppGroup/AppGroup.m
85
+ - Example/Pods/CocoaPodsAppGroup/AppGroup.podspec.json
86
+ - Example/Pods/Headers/Private/AppGroup/AppGroup.h
87
+ - Example/Pods/Local Podspecs/AppGroup.podspec.json
88
+ - Example/Pods/Manifest.lock
89
+ - Example/Pods/Pods.xcodeproj/project.pbxproj
90
+ - Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/AppGroup.xcscheme
91
+ - Example/Pods/Target Support Files/AppGroup/AppGroup-Private.xcconfig
92
+ - Example/Pods/Target Support Files/AppGroup/AppGroup-dummy.m
93
+ - Example/Pods/Target Support Files/AppGroup/AppGroup-prefix.pch
94
+ - Example/Pods/Target Support Files/AppGroup/AppGroup-umbrella.h
95
+ - Example/Pods/Target Support Files/AppGroup/AppGroup.modulemap
96
+ - Example/Pods/Target Support Files/AppGroup/AppGroup.xcconfig
97
+ - Example/Pods/Target Support Files/AppGroup/Info.plist
98
+ - Example/Pods/Target Support Files/Pods/Info.plist
99
+ - Example/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown
100
+ - Example/Pods/Target Support Files/Pods/Pods-acknowledgements.plist
101
+ - Example/Pods/Target Support Files/Pods/Pods-dummy.m
102
+ - Example/Pods/Target Support Files/Pods/Pods-frameworks.sh
103
+ - Example/Pods/Target Support Files/Pods/Pods-resources.sh
104
+ - Example/Pods/Target Support Files/Pods/Pods-umbrella.h
105
+ - Example/Pods/Target Support Files/Pods/Pods.debug.xcconfig
106
+ - Example/Pods/Target Support Files/Pods/Pods.modulemap
107
+ - Example/Pods/Target Support Files/Pods/Pods.release.xcconfig
108
+ - Example/ReadFromAppGroup/AppDelegate.swift
109
+ - Example/ReadFromAppGroup/Assets.xcassets/AppIcon.appiconset/Contents.json
110
+ - Example/ReadFromAppGroup/Base.lproj/LaunchScreen.storyboard
111
+ - Example/ReadFromAppGroup/Base.lproj/Main.storyboard
112
+ - Example/ReadFromAppGroup/Info.plist
113
+ - Example/ReadFromAppGroup/ReadFromAppGroup.entitlements
114
+ - Example/ReadFromAppGroup/ViewController.swift
115
+ - Example/WriteToAppGroup.entitlements
116
+ - Gemfile
117
+ - LICENSE.txt
118
+ - README.md
119
+ - Rakefile
120
+ - bin/console
121
+ - bin/setup
122
+ - cocoapods-app_group.gemspec
123
+ - lib/cocoapods/app_group.rb
124
+ - lib/cocoapods/app_group/hook.rb
125
+ - lib/cocoapods/app_group/setup.rb
126
+ - lib/cocoapods/app_group/store.rb
127
+ - lib/cocoapods/app_group/template.rb
128
+ - lib/cocoapods/app_group/version.rb
129
+ - lib/cocoapods_plugin.rb
130
+ - lib/pod/command/app_group.rb
131
+ - templates/AppGroup.h
132
+ - templates/AppGroup.m
133
+ - templates/AppGroup.podspec.json
134
+ homepage: https://github.com/mzp/cocoapods-app_group
135
+ licenses:
136
+ - MIT
137
+ metadata: {}
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ requirements: []
153
+ rubyforge_project:
154
+ rubygems_version: 2.4.5.1
155
+ signing_key:
156
+ specification_version: 4
157
+ summary: Customizable app group plugin
158
+ test_files: []