flip_the_switch 0.3.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 (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +146 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +13 -0
  5. data/CHANGELOG.md +14 -0
  6. data/Classes/FlipTheSwitch/FlipTheSwitch.h +9 -0
  7. data/Classes/FlipTheSwitch/FlipTheSwitch.m +88 -0
  8. data/Example/.gitignore +2 -0
  9. data/Example/Colors-iOS/AppDelegateiOS.h +3 -0
  10. data/Example/Colors-iOS/AppDelegateiOS.m +4 -0
  11. data/Example/Colors-iOS/Base.lproj/Main_iPhone.storyboard +76 -0
  12. data/Example/Colors-iOS/Colors-iOS-Info.plist +49 -0
  13. data/Example/Colors-iOS/Colors-iOS-Prefix.pch +16 -0
  14. data/Example/Colors-iOS/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  15. data/Example/Colors-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  16. data/Example/Colors-iOS/ViewControlleriOS.h +2 -0
  17. data/Example/Colors-iOS/ViewControlleriOS.m +78 -0
  18. data/Example/Colors-iOS/main.m +8 -0
  19. data/Example/Colors.xcodeproj/project.pbxproj +358 -0
  20. data/Example/Colors.xcodeproj/xcshareddata/xcschemes/Colors-iOS.xcscheme +77 -0
  21. data/Example/Podfile +4 -0
  22. data/Example/Rakefile +23 -0
  23. data/Example/features.yml +2 -0
  24. data/FlipTheSwitch.podspec +16 -0
  25. data/Gemfile +17 -0
  26. data/Guardfile.example +15 -0
  27. data/LICENSE +21 -0
  28. data/README.md +104 -0
  29. data/Rakefile +35 -0
  30. data/Tests/FlipTheSwitchSpec-Mac/Features.plist +8 -0
  31. data/Tests/FlipTheSwitchSpec-Mac/FlipTheSwitchSpec-Mac-Info.plist +22 -0
  32. data/Tests/FlipTheSwitchSpec-Mac/FlipTheSwitchSpec-Mac-Prefix.pch +13 -0
  33. data/Tests/FlipTheSwitchSpec-iOS/Features.plist +8 -0
  34. data/Tests/FlipTheSwitchSpec-iOS/FlipTheSwitchSpec-iOS-Info.plist +22 -0
  35. data/Tests/FlipTheSwitchSpec-iOS/FlipTheSwitchSpec-iOS-Prefix.pch +14 -0
  36. data/Tests/FlipTheSwitchSpec.xcodeproj/project.pbxproj +605 -0
  37. data/Tests/FlipTheSwitchSpec.xcodeproj/xcshareddata/xcschemes/FlipTheSwitchSpec-Mac.xcscheme +75 -0
  38. data/Tests/FlipTheSwitchSpec.xcodeproj/xcshareddata/xcschemes/FlipTheSwitchSpec-iOS.xcscheme +75 -0
  39. data/Tests/Podfile +15 -0
  40. data/Tests/Rakefile +22 -0
  41. data/Tests/Spec/Classes/FlipTheSwitch/FlipTheSwitchSpec.m +88 -0
  42. data/Tests/Spec/Helpers/GcovTestObserver.h +4 -0
  43. data/Tests/Spec/Helpers/GcovTestObserver.m +12 -0
  44. data/bin/flip-the-switch +4 -0
  45. data/flip_the_switch.gemspec +17 -0
  46. data/lib/flip_the_switch/cli.rb +61 -0
  47. data/lib/flip_the_switch/errors.rb +12 -0
  48. data/lib/flip_the_switch/generator/base.rb +13 -0
  49. data/lib/flip_the_switch/generator/category.rb +71 -0
  50. data/lib/flip_the_switch/generator/header.h.erb +11 -0
  51. data/lib/flip_the_switch/generator/implementation.m.erb +26 -0
  52. data/lib/flip_the_switch/generator/plist.rb +17 -0
  53. data/lib/flip_the_switch/generator.rb +3 -0
  54. data/lib/flip_the_switch/reader/yaml.rb +39 -0
  55. data/lib/flip_the_switch/reader.rb +1 -0
  56. data/lib/flip_the_switch.rb +3 -0
  57. data/spec/flip_the_switch/cli_spec.rb +81 -0
  58. data/spec/flip_the_switch/generator/category_spec.rb +44 -0
  59. data/spec/flip_the_switch/generator/plist_spec.rb +19 -0
  60. data/spec/flip_the_switch/reader/yaml_spec.rb +43 -0
  61. data/spec/resources/ExpectedFeatures.plist +10 -0
  62. data/spec/resources/expected_header.h +16 -0
  63. data/spec/resources/expected_implementation.m +46 -0
  64. data/spec/resources/invalid_layout/features.yml +4 -0
  65. data/spec/resources/invalid_type/features.yml +7 -0
  66. data/spec/resources/real/features.yml +2 -0
  67. data/spec/spec_helper.rb +15 -0
  68. metadata +166 -0
@@ -0,0 +1,358 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 35D6E35AEAC9473FAAAB5BE5 /* libPods-Colors-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F7C4D132FE24A06ACC52E5F /* libPods-Colors-iOS.a */; };
11
+ 5B20701A194237BF00D07667 /* Features.plist in Resources */ = {isa = PBXBuildFile; fileRef = F80321679CBE499FFA387688 /* Features.plist */; };
12
+ 5B909898193A235E004C12B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B909897193A235E004C12B3 /* Foundation.framework */; };
13
+ 5B90989C193A235E004C12B3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B90989B193A235E004C12B3 /* UIKit.framework */; };
14
+ 5B9098A4193A235E004C12B3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B9098A3193A235E004C12B3 /* main.m */; };
15
+ 5B9098AB193A235E004C12B3 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5B9098A9193A235E004C12B3 /* Main_iPhone.storyboard */; };
16
+ 5B9098B1193A235E004C12B3 /* ViewControlleriOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B9098B0193A235E004C12B3 /* ViewControlleriOS.m */; };
17
+ 5B9098B3193A235E004C12B3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5B9098B2193A235E004C12B3 /* Images.xcassets */; };
18
+ F803204E3B632B5F0E19014F /* AppDelegateiOS.m in Sources */ = {isa = PBXBuildFile; fileRef = F803243E8A66F29C3EA37B65 /* AppDelegateiOS.m */; };
19
+ F80326F51193A67FEB8D4F69 /* FlipTheSwitch+Features.m in Sources */ = {isa = PBXBuildFile; fileRef = F803287440254AB051D00DDB /* FlipTheSwitch+Features.m */; };
20
+ /* End PBXBuildFile section */
21
+
22
+ /* Begin PBXFileReference section */
23
+ 5B909894193A235E004C12B3 /* Colors-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Colors-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
24
+ 5B909897193A235E004C12B3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
25
+ 5B90989B193A235E004C12B3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
26
+ 5B90989F193A235E004C12B3 /* Colors-iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Colors-iOS-Info.plist"; sourceTree = "<group>"; };
27
+ 5B9098A3193A235E004C12B3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
28
+ 5B9098A5193A235E004C12B3 /* Colors-iOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Colors-iOS-Prefix.pch"; sourceTree = "<group>"; };
29
+ 5B9098AA193A235E004C12B3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
30
+ 5B9098AF193A235E004C12B3 /* ViewControlleriOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewControlleriOS.h; sourceTree = "<group>"; };
31
+ 5B9098B0193A235E004C12B3 /* ViewControlleriOS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewControlleriOS.m; sourceTree = "<group>"; };
32
+ 5B9098B2193A235E004C12B3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
33
+ 5F7C4D132FE24A06ACC52E5F /* libPods-Colors-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Colors-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
34
+ F80321679CBE499FFA387688 /* Features.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Features.plist; sourceTree = "<group>"; };
35
+ F803243E8A66F29C3EA37B65 /* AppDelegateiOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegateiOS.m; sourceTree = "<group>"; };
36
+ F803287440254AB051D00DDB /* FlipTheSwitch+Features.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FlipTheSwitch+Features.m"; sourceTree = "<group>"; };
37
+ F8032EBDB675B3B788B1297F /* FlipTheSwitch+Features.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FlipTheSwitch+Features.h"; sourceTree = "<group>"; };
38
+ F8032F89446610853BDFF019 /* AppDelegateiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegateiOS.h; sourceTree = "<group>"; };
39
+ FA266F5E1A3E46478CDB53E6 /* Pods-Colors-iOS.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Colors-iOS.xcconfig"; path = "Pods/Pods-Colors-iOS.xcconfig"; sourceTree = "<group>"; };
40
+ /* End PBXFileReference section */
41
+
42
+ /* Begin PBXFrameworksBuildPhase section */
43
+ 5B909891193A235E004C12B3 /* Frameworks */ = {
44
+ isa = PBXFrameworksBuildPhase;
45
+ buildActionMask = 2147483647;
46
+ files = (
47
+ 5B90989C193A235E004C12B3 /* UIKit.framework in Frameworks */,
48
+ 5B909898193A235E004C12B3 /* Foundation.framework in Frameworks */,
49
+ 35D6E35AEAC9473FAAAB5BE5 /* libPods-Colors-iOS.a in Frameworks */,
50
+ );
51
+ runOnlyForDeploymentPostprocessing = 0;
52
+ };
53
+ /* End PBXFrameworksBuildPhase section */
54
+
55
+ /* Begin PBXGroup section */
56
+ 5B90988B193A235E004C12B3 = {
57
+ isa = PBXGroup;
58
+ children = (
59
+ 5B90989D193A235E004C12B3 /* Colors-iOS */,
60
+ 5B909896193A235E004C12B3 /* Frameworks */,
61
+ 5B909895193A235E004C12B3 /* Products */,
62
+ FA266F5E1A3E46478CDB53E6 /* Pods-Colors-iOS.xcconfig */,
63
+ );
64
+ sourceTree = "<group>";
65
+ };
66
+ 5B909895193A235E004C12B3 /* Products */ = {
67
+ isa = PBXGroup;
68
+ children = (
69
+ 5B909894193A235E004C12B3 /* Colors-iOS.app */,
70
+ );
71
+ name = Products;
72
+ sourceTree = "<group>";
73
+ };
74
+ 5B909896193A235E004C12B3 /* Frameworks */ = {
75
+ isa = PBXGroup;
76
+ children = (
77
+ 5B909897193A235E004C12B3 /* Foundation.framework */,
78
+ 5B90989B193A235E004C12B3 /* UIKit.framework */,
79
+ 5F7C4D132FE24A06ACC52E5F /* libPods-Colors-iOS.a */,
80
+ );
81
+ name = Frameworks;
82
+ sourceTree = "<group>";
83
+ };
84
+ 5B90989D193A235E004C12B3 /* Colors-iOS */ = {
85
+ isa = PBXGroup;
86
+ children = (
87
+ 5B9098A9193A235E004C12B3 /* Main_iPhone.storyboard */,
88
+ 5B9098AF193A235E004C12B3 /* ViewControlleriOS.h */,
89
+ 5B9098B0193A235E004C12B3 /* ViewControlleriOS.m */,
90
+ 5B9098B2193A235E004C12B3 /* Images.xcassets */,
91
+ 5B90989E193A235E004C12B3 /* Supporting Files */,
92
+ F8032F89446610853BDFF019 /* AppDelegateiOS.h */,
93
+ F803243E8A66F29C3EA37B65 /* AppDelegateiOS.m */,
94
+ F8032EBDB675B3B788B1297F /* FlipTheSwitch+Features.h */,
95
+ F803287440254AB051D00DDB /* FlipTheSwitch+Features.m */,
96
+ );
97
+ path = "Colors-iOS";
98
+ sourceTree = "<group>";
99
+ };
100
+ 5B90989E193A235E004C12B3 /* Supporting Files */ = {
101
+ isa = PBXGroup;
102
+ children = (
103
+ 5B90989F193A235E004C12B3 /* Colors-iOS-Info.plist */,
104
+ 5B9098A3193A235E004C12B3 /* main.m */,
105
+ 5B9098A5193A235E004C12B3 /* Colors-iOS-Prefix.pch */,
106
+ F80321679CBE499FFA387688 /* Features.plist */,
107
+ );
108
+ name = "Supporting Files";
109
+ sourceTree = "<group>";
110
+ };
111
+ /* End PBXGroup section */
112
+
113
+ /* Begin PBXNativeTarget section */
114
+ 5B909893193A235E004C12B3 /* Colors-iOS */ = {
115
+ isa = PBXNativeTarget;
116
+ buildConfigurationList = 5B9098C9193A235E004C12B3 /* Build configuration list for PBXNativeTarget "Colors-iOS" */;
117
+ buildPhases = (
118
+ 55584C56EF90491FA19D948C /* Check Pods Manifest.lock */,
119
+ 5B909890193A235E004C12B3 /* Sources */,
120
+ 5B909891193A235E004C12B3 /* Frameworks */,
121
+ 5B909892193A235E004C12B3 /* Resources */,
122
+ 0842EFA4D455433B89965D50 /* Copy Pods Resources */,
123
+ );
124
+ buildRules = (
125
+ );
126
+ dependencies = (
127
+ );
128
+ name = "Colors-iOS";
129
+ productName = Colors;
130
+ productReference = 5B909894193A235E004C12B3 /* Colors-iOS.app */;
131
+ productType = "com.apple.product-type.application";
132
+ };
133
+ /* End PBXNativeTarget section */
134
+
135
+ /* Begin PBXProject section */
136
+ 5B90988C193A235E004C12B3 /* Project object */ = {
137
+ isa = PBXProject;
138
+ attributes = {
139
+ LastUpgradeCheck = 0510;
140
+ ORGANIZATIONNAME = MichaelEngland;
141
+ };
142
+ buildConfigurationList = 5B90988F193A235E004C12B3 /* Build configuration list for PBXProject "Colors" */;
143
+ compatibilityVersion = "Xcode 3.2";
144
+ developmentRegion = English;
145
+ hasScannedForEncodings = 0;
146
+ knownRegions = (
147
+ en,
148
+ Base,
149
+ );
150
+ mainGroup = 5B90988B193A235E004C12B3;
151
+ productRefGroup = 5B909895193A235E004C12B3 /* Products */;
152
+ projectDirPath = "";
153
+ projectRoot = "";
154
+ targets = (
155
+ 5B909893193A235E004C12B3 /* Colors-iOS */,
156
+ );
157
+ };
158
+ /* End PBXProject section */
159
+
160
+ /* Begin PBXResourcesBuildPhase section */
161
+ 5B909892193A235E004C12B3 /* Resources */ = {
162
+ isa = PBXResourcesBuildPhase;
163
+ buildActionMask = 2147483647;
164
+ files = (
165
+ 5B20701A194237BF00D07667 /* Features.plist in Resources */,
166
+ 5B9098B3193A235E004C12B3 /* Images.xcassets in Resources */,
167
+ 5B9098AB193A235E004C12B3 /* Main_iPhone.storyboard in Resources */,
168
+ );
169
+ runOnlyForDeploymentPostprocessing = 0;
170
+ };
171
+ /* End PBXResourcesBuildPhase section */
172
+
173
+ /* Begin PBXShellScriptBuildPhase section */
174
+ 0842EFA4D455433B89965D50 /* Copy Pods Resources */ = {
175
+ isa = PBXShellScriptBuildPhase;
176
+ buildActionMask = 2147483647;
177
+ files = (
178
+ );
179
+ inputPaths = (
180
+ );
181
+ name = "Copy Pods Resources";
182
+ outputPaths = (
183
+ );
184
+ runOnlyForDeploymentPostprocessing = 0;
185
+ shellPath = /bin/sh;
186
+ shellScript = "\"${SRCROOT}/Pods/Pods-Colors-iOS-resources.sh\"\n";
187
+ showEnvVarsInLog = 0;
188
+ };
189
+ 55584C56EF90491FA19D948C /* Check Pods Manifest.lock */ = {
190
+ isa = PBXShellScriptBuildPhase;
191
+ buildActionMask = 2147483647;
192
+ files = (
193
+ );
194
+ inputPaths = (
195
+ );
196
+ name = "Check Pods Manifest.lock";
197
+ outputPaths = (
198
+ );
199
+ runOnlyForDeploymentPostprocessing = 0;
200
+ shellPath = /bin/sh;
201
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
202
+ showEnvVarsInLog = 0;
203
+ };
204
+ /* End PBXShellScriptBuildPhase section */
205
+
206
+ /* Begin PBXSourcesBuildPhase section */
207
+ 5B909890193A235E004C12B3 /* Sources */ = {
208
+ isa = PBXSourcesBuildPhase;
209
+ buildActionMask = 2147483647;
210
+ files = (
211
+ 5B9098B1193A235E004C12B3 /* ViewControlleriOS.m in Sources */,
212
+ 5B9098A4193A235E004C12B3 /* main.m in Sources */,
213
+ F803204E3B632B5F0E19014F /* AppDelegateiOS.m in Sources */,
214
+ F80326F51193A67FEB8D4F69 /* FlipTheSwitch+Features.m in Sources */,
215
+ );
216
+ runOnlyForDeploymentPostprocessing = 0;
217
+ };
218
+ /* End PBXSourcesBuildPhase section */
219
+
220
+ /* Begin PBXVariantGroup section */
221
+ 5B9098A9193A235E004C12B3 /* Main_iPhone.storyboard */ = {
222
+ isa = PBXVariantGroup;
223
+ children = (
224
+ 5B9098AA193A235E004C12B3 /* Base */,
225
+ );
226
+ name = Main_iPhone.storyboard;
227
+ sourceTree = "<group>";
228
+ };
229
+ /* End PBXVariantGroup section */
230
+
231
+ /* Begin XCBuildConfiguration section */
232
+ 5B9098C7193A235E004C12B3 /* Debug */ = {
233
+ isa = XCBuildConfiguration;
234
+ buildSettings = {
235
+ ALWAYS_SEARCH_USER_PATHS = NO;
236
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
237
+ CLANG_CXX_LIBRARY = "libc++";
238
+ CLANG_ENABLE_MODULES = YES;
239
+ CLANG_ENABLE_OBJC_ARC = YES;
240
+ CLANG_WARN_BOOL_CONVERSION = YES;
241
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
242
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
243
+ CLANG_WARN_EMPTY_BODY = YES;
244
+ CLANG_WARN_ENUM_CONVERSION = YES;
245
+ CLANG_WARN_INT_CONVERSION = YES;
246
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
247
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
248
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
249
+ COPY_PHASE_STRIP = NO;
250
+ GCC_C_LANGUAGE_STANDARD = gnu99;
251
+ GCC_DYNAMIC_NO_PIC = NO;
252
+ GCC_OPTIMIZATION_LEVEL = 0;
253
+ GCC_PREPROCESSOR_DEFINITIONS = (
254
+ "DEBUG=1",
255
+ "$(inherited)",
256
+ );
257
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
258
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
259
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
260
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
261
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
262
+ GCC_WARN_UNUSED_FUNCTION = YES;
263
+ GCC_WARN_UNUSED_VARIABLE = YES;
264
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
265
+ ONLY_ACTIVE_ARCH = YES;
266
+ SDKROOT = iphoneos;
267
+ TARGETED_DEVICE_FAMILY = "1,2";
268
+ };
269
+ name = Debug;
270
+ };
271
+ 5B9098C8193A235E004C12B3 /* Release */ = {
272
+ isa = XCBuildConfiguration;
273
+ buildSettings = {
274
+ ALWAYS_SEARCH_USER_PATHS = NO;
275
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
276
+ CLANG_CXX_LIBRARY = "libc++";
277
+ CLANG_ENABLE_MODULES = YES;
278
+ CLANG_ENABLE_OBJC_ARC = YES;
279
+ CLANG_WARN_BOOL_CONVERSION = YES;
280
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
281
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
282
+ CLANG_WARN_EMPTY_BODY = YES;
283
+ CLANG_WARN_ENUM_CONVERSION = YES;
284
+ CLANG_WARN_INT_CONVERSION = YES;
285
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
286
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
287
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
288
+ COPY_PHASE_STRIP = YES;
289
+ ENABLE_NS_ASSERTIONS = NO;
290
+ GCC_C_LANGUAGE_STANDARD = gnu99;
291
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
292
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
293
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
294
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
295
+ GCC_WARN_UNUSED_FUNCTION = YES;
296
+ GCC_WARN_UNUSED_VARIABLE = YES;
297
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
298
+ SDKROOT = iphoneos;
299
+ TARGETED_DEVICE_FAMILY = "1,2";
300
+ VALIDATE_PRODUCT = YES;
301
+ };
302
+ name = Release;
303
+ };
304
+ 5B9098CA193A235E004C12B3 /* Debug */ = {
305
+ isa = XCBuildConfiguration;
306
+ baseConfigurationReference = FA266F5E1A3E46478CDB53E6 /* Pods-Colors-iOS.xcconfig */;
307
+ buildSettings = {
308
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
309
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
310
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
311
+ GCC_PREFIX_HEADER = "Colors-iOS/Colors-iOS-Prefix.pch";
312
+ INFOPLIST_FILE = "Colors-iOS/Colors-iOS-Info.plist";
313
+ PRODUCT_NAME = "$(TARGET_NAME)";
314
+ TARGETED_DEVICE_FAMILY = 1;
315
+ WRAPPER_EXTENSION = app;
316
+ };
317
+ name = Debug;
318
+ };
319
+ 5B9098CB193A235E004C12B3 /* Release */ = {
320
+ isa = XCBuildConfiguration;
321
+ baseConfigurationReference = FA266F5E1A3E46478CDB53E6 /* Pods-Colors-iOS.xcconfig */;
322
+ buildSettings = {
323
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
324
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
325
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
326
+ GCC_PREFIX_HEADER = "Colors-iOS/Colors-iOS-Prefix.pch";
327
+ INFOPLIST_FILE = "Colors-iOS/Colors-iOS-Info.plist";
328
+ PRODUCT_NAME = "$(TARGET_NAME)";
329
+ TARGETED_DEVICE_FAMILY = 1;
330
+ WRAPPER_EXTENSION = app;
331
+ };
332
+ name = Release;
333
+ };
334
+ /* End XCBuildConfiguration section */
335
+
336
+ /* Begin XCConfigurationList section */
337
+ 5B90988F193A235E004C12B3 /* Build configuration list for PBXProject "Colors" */ = {
338
+ isa = XCConfigurationList;
339
+ buildConfigurations = (
340
+ 5B9098C7193A235E004C12B3 /* Debug */,
341
+ 5B9098C8193A235E004C12B3 /* Release */,
342
+ );
343
+ defaultConfigurationIsVisible = 0;
344
+ defaultConfigurationName = Release;
345
+ };
346
+ 5B9098C9193A235E004C12B3 /* Build configuration list for PBXNativeTarget "Colors-iOS" */ = {
347
+ isa = XCConfigurationList;
348
+ buildConfigurations = (
349
+ 5B9098CA193A235E004C12B3 /* Debug */,
350
+ 5B9098CB193A235E004C12B3 /* Release */,
351
+ );
352
+ defaultConfigurationIsVisible = 0;
353
+ defaultConfigurationName = Release;
354
+ };
355
+ /* End XCConfigurationList section */
356
+ };
357
+ rootObject = 5B90988C193A235E004C12B3 /* Project object */;
358
+ }
@@ -0,0 +1,77 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0510"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "5B909893193A235E004C12B3"
18
+ BuildableName = "Colors-iOS.app"
19
+ BlueprintName = "Colors-iOS"
20
+ ReferencedContainer = "container:Colors.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
+ shouldUseLaunchSchemeArgsEnv = "YES"
29
+ buildConfiguration = "Debug">
30
+ <Testables>
31
+ </Testables>
32
+ </TestAction>
33
+ <LaunchAction
34
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36
+ launchStyle = "0"
37
+ useCustomWorkingDirectory = "NO"
38
+ buildConfiguration = "Debug"
39
+ ignoresPersistentStateOnLaunch = "NO"
40
+ debugDocumentVersioning = "YES"
41
+ allowLocationSimulation = "YES">
42
+ <BuildableProductRunnable>
43
+ <BuildableReference
44
+ BuildableIdentifier = "primary"
45
+ BlueprintIdentifier = "5B909893193A235E004C12B3"
46
+ BuildableName = "Colors-iOS.app"
47
+ BlueprintName = "Colors-iOS"
48
+ ReferencedContainer = "container:Colors.xcodeproj">
49
+ </BuildableReference>
50
+ </BuildableProductRunnable>
51
+ <AdditionalOptions>
52
+ </AdditionalOptions>
53
+ </LaunchAction>
54
+ <ProfileAction
55
+ shouldUseLaunchSchemeArgsEnv = "YES"
56
+ savedToolIdentifier = ""
57
+ useCustomWorkingDirectory = "NO"
58
+ buildConfiguration = "Release"
59
+ debugDocumentVersioning = "YES">
60
+ <BuildableProductRunnable>
61
+ <BuildableReference
62
+ BuildableIdentifier = "primary"
63
+ BlueprintIdentifier = "5B909893193A235E004C12B3"
64
+ BuildableName = "Colors-iOS.app"
65
+ BlueprintName = "Colors-iOS"
66
+ ReferencedContainer = "container:Colors.xcodeproj">
67
+ </BuildableReference>
68
+ </BuildableProductRunnable>
69
+ </ProfileAction>
70
+ <AnalyzeAction
71
+ buildConfiguration = "Debug">
72
+ </AnalyzeAction>
73
+ <ArchiveAction
74
+ buildConfiguration = "Release"
75
+ revealArchiveInOrganizer = "YES">
76
+ </ArchiveAction>
77
+ </Scheme>
data/Example/Podfile ADDED
@@ -0,0 +1,4 @@
1
+ target 'Colors-iOS' do
2
+ platform :ios, :deployment_target => 7.0
3
+ pod 'FlipTheSwitch', :path => '../'
4
+ end
data/Example/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ require 'rake/clean'
2
+
3
+ def pods; 'Pods'; end
4
+ def podfile_lock; 'Podfile.lock'; end
5
+ def build; 'build'; end
6
+ def workspace; 'Colors'; end
7
+
8
+ CLOBBER.include(podfile_lock)
9
+ CLOBBER.include(pods)
10
+
11
+ CLEAN.include(build)
12
+
13
+ task :default => :test
14
+
15
+ file podfile_lock do
16
+ sh 'pod install'
17
+ end
18
+
19
+ task :test => podfile_lock do
20
+ sh 'bundle exec ../bin/flip-the-switch plist -o Colors-iOS'
21
+ sh 'bundle exec ../bin/flip-the-switch category -o Colors-iOS'
22
+ sh "xctool build -scheme #{workspace}-iOS -workspace #{workspace}.xcworkspace -sdk iphonesimulator OBJROOT=#{build} SHARED_PRECOMPS_DIR=#{build}"
23
+ end
@@ -0,0 +1,2 @@
1
+ purple_color: Yes
2
+ red_color: No
@@ -0,0 +1,16 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'FlipTheSwitch'
3
+ s.version = '0.3.0'
4
+ s.summary = 'A simple library to help enabling/disabling features on iOS/Mac applications.'
5
+ s.authors = {
6
+ 'Michael England' => 'mg.england@gmail.com',
7
+ 'Rob Siwek' => 'rob@robsiwek.com'
8
+ }
9
+ s.homepage = 'https://github.com/michaelengland/FlipTheSwitch'
10
+
11
+ s.license = {:type => 'MIT', :file => 'LICENSE'}
12
+ s.source = {:git => 'git@github.com:michaelengland/FlipTheSwitch.git', :tag => s.version.to_s}
13
+ s.source_files = 'Classes/FlipTheSwitch/*.{h,m}'
14
+ s.public_header_files = 'Classes/FlipTheSwitch/*.h'
15
+ s.requires_arc = true
16
+ end
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'travis', '~> 1.6.11'
4
+ gem 'cocoapods', '~> 0.33.1'
5
+ gem 'rake', '~> 10.3.2'
6
+
7
+ gemspec
8
+
9
+ group :development, :test do
10
+ gem 'codeclimate-test-reporter', '~> 0.3.0', require: false
11
+ gem 'rspec', '~> 2.14.1'
12
+ gem 'spork', '~> 0.9.2'
13
+ gem 'guard', '~> 2.6.1'
14
+ gem 'guard-bundler', '~> 2.0.0'
15
+ gem 'guard-spork', '~> 1.5.1'
16
+ gem 'guard-rspec', '~> 4.2.10'
17
+ end
data/Guardfile.example ADDED
@@ -0,0 +1,15 @@
1
+ guard :bundler do
2
+ watch('Gemfile')
3
+ watch(/^.+\.gemspec/)
4
+ end
5
+
6
+ guard :rspec do
7
+ watch(%r{^spec/.+_spec\.rb$})
8
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
9
+ watch('spec/spec_helper.rb') { "spec" }
10
+ end
11
+
12
+ guard :spork do
13
+ watch('Gemfile.lock')
14
+ watch('spec/spec_helper.rb') { :rspec }
15
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Michael England
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # FlipTheSwitch [![Build Status](https://travis-ci.org/michaelengland/FlipTheSwitch.svg?branch=master)](https://travis-ci.org/michaelengland/FlipTheSwitch) [![Coverage Status](https://img.shields.io/coveralls/michaelengland/FlipTheSwitch.svg)](https://coveralls.io/r/michaelengland/FlipTheSwitch?branch=master) ![version](https://cocoapod-badges.herokuapp.com/v/FlipTheSwitch/badge.png) ![platform](https://cocoapod-badges.herokuapp.com/p/FlipTheSwitch/badge.png)
2
+
3
+ A feature switching/toggling/flipping library for ObjectiveC.
4
+
5
+ # flip_the_switch [![Build Status](https://travis-ci.org/michaelengland/FlipTheSwitch.svg?branch=master)](https://travis-ci.org/michaelengland/FlipTheSwitch) [![Code Climate](https://codeclimate.com/github/michaelengland/FlipTheSwitch.png)](https://codeclimate.com/github/michaelengland/FlipTheSwitch) [![Code Climate](https://codeclimate.com/github/michaelengland/FlipTheSwitch/coverage.png)](https://codeclimate.com/github/michaelengland/FlipTheSwitch) [![Gem Version](https://badge.fury.io/rb/flip-the-switch.svg)](http://badge.fury.io/rb/flip-the-switch)
6
+
7
+ A gem command line tool for generating the `Features.plist` & `FlipTheSwitch+Features.{h,m}` categories to help with the corresponding Pod.
8
+
9
+ ## The Problem
10
+
11
+ We have a a new feature we've been working on, `AmazingFeature`, and we've been building it inside a branch.
12
+ Now has come the time to finally merge it back in. This then takes us the next day, as the `MyApp.xcodeproj/project.pbxproj` file has a lot of conflicting changes, and we get things wrong a lot before we get them right.
13
+ We weren't able to rebase often, as multiple people were working on this branch, and so we also had to keep regularly merging in all of the other changes from the rest of the team, constantly losing focus of our goal.
14
+ We finally have it all merged and then... *everything breaks*!
15
+
16
+ The way to avoid all of these constant merges/rebases/context switches is to always have our code in the `master` branch, but we didn't want to affect the rest of the team while they released `QuickerFeature` in the next release cycle.
17
+
18
+ How can we get the benefits of working on `master` branch, while still not worrying about breaking the other features while we build `AmazingFeature`?
19
+
20
+ ## Introducing FlipTheSwitch
21
+
22
+ With FlipTheSwitch, we can choose different code paths at runtime:
23
+
24
+ ```objective-c
25
+ self.newFeatureButton.hidden = [[FlipTheSwitch sharedInstance] isFeatureEnabled:@"new_feature"];
26
+ ```
27
+
28
+ The features can be enabled/disabled at runtime:
29
+
30
+ ```objective-c
31
+ [[FlipTheSwitch sharedInstance] enableFeature:@"new_feature"];
32
+ ```
33
+
34
+ ```objective-c
35
+ [[FlipTheSwitch sharedInstance] disableFeature:@"new_feature"];
36
+ ```
37
+
38
+ ```objective-c
39
+ [[FlipTheSwitch sharedInstance] setFeature:@"new_feature" enabled:YES];
40
+ ```
41
+
42
+ All enabled features will persist between app loads through `NSUserDefaults`.
43
+
44
+ The features can defaulted to enabled/disabled via a plist file `Features.plist`:
45
+
46
+ ```xml
47
+ <?xml version="1.0" encoding="UTF-8"?>
48
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
49
+ <plist version="1.0">
50
+ <dict>
51
+ <key>enabled_feature</key>
52
+ <true/>
53
+ <key>disabled_feature</key>
54
+ <false/>
55
+ </dict>
56
+ </plist>
57
+ ```
58
+
59
+ ## Command-Line-Interface
60
+
61
+ If you install the gem, you will be able to use the Command-Line-Interface.
62
+
63
+ The CLI consists of 2 commands:
64
+
65
+ - `plist` - creates a `Features.plist` file for enabled/disabled features like that mentioned above.
66
+ - `category` - creates `FlipTheSwitch+Features.{h,m}` files for features, thus giving compile-time checks for adding/removal of new features.
67
+ e.g:
68
+
69
+ ```objective-c
70
+ /* AUTO-GENERATED. DO NOT ALTER */
71
+ #import <FlipTheSwitch/FlipTheSwitch.h>
72
+
73
+ @interface FlipTheSwitch (Features)
74
+
75
+ + (BOOL)isAwesomeFeatureEnabled;
76
+ + (void)enableAwesomeFeature;
77
+ + (void)disableAwesomeFeature;
78
+ + (void)setAwesomeFeatureEnabled:(BOOL)enabled;
79
+
80
+ @end
81
+ ```
82
+
83
+ The features, along with their default enabled/disabled state, are read from a `features.yml` file. e.g.:
84
+
85
+ ```yaml
86
+ awesome_feature: Yes
87
+ ```
88
+
89
+ For more information, run `flip-the-switch help`
90
+
91
+ ## How to install
92
+
93
+ Add `pod 'FlipTheSwitch'` to your Podfile
94
+
95
+ Add `gem 'flip-the-switch'` to your Gemfile
96
+
97
+ ## Authors
98
+
99
+ - [Michael England](https://github.com/michaelengland) @ [SoundCloud](https://github.com/soundcloud)
100
+ - [Rob Siwek](https://github.com/nerdsRob) @ [SoundCloud](https://github.com/soundcloud)
101
+
102
+ ## License
103
+
104
+ FlipTheSwitch is available under the MIT license. See the LICENSE file for more info.