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
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
4
+
5
+ def subfolders; %w(Tests Example); end
6
+
7
+ def subperform(command)
8
+ subfolders.each do |subfolder|
9
+ Dir.chdir(subfolder) do
10
+ sh "rake #{command}"
11
+ end
12
+ end
13
+ end
14
+
15
+ task :default => :test
16
+
17
+ task :ci => [:clobber, :test]
18
+
19
+ task :clobber do
20
+ subperform(:clobber)
21
+ end
22
+
23
+ task :clean do
24
+ subperform(:clean)
25
+ end
26
+
27
+ task :test => :spec do
28
+ subperform(:test)
29
+
30
+ end
31
+
32
+ task :coverage do
33
+ excludes = ['.*/Classes/.*\.h'] + subfolders.map { |subfolder| ".*/#{subfolder}/.*" }
34
+ sh "coveralls #{excludes.map { |exclude| "-E '#{exclude}'" }.join(' ')}"
35
+ end
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>plist_enabled_feature</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>${EXECUTABLE_NAME}</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>com.github.${PRODUCT_NAME:rfc1034identifier}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>BNDL</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSignature</key>
18
+ <string>????</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>1</string>
21
+ </dict>
22
+ </plist>
@@ -0,0 +1,13 @@
1
+ //
2
+ // Prefix header
3
+ //
4
+ // The contents of this file are implicitly included at the beginning of every source file.
5
+ //
6
+
7
+ #ifdef __OBJC__
8
+ #import <Cocoa/Cocoa.h>
9
+ #import <Specta/Specta.h>
10
+ #define EXP_SHORTHAND
11
+ #import <Expecta/Expecta.h>
12
+ #import <OCMockito/OCMockito.h>
13
+ #endif
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>plist_enabled_feature</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>${EXECUTABLE_NAME}</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>com.github.${PRODUCT_NAME:rfc1034identifier}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>BNDL</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSignature</key>
18
+ <string>????</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>1</string>
21
+ </dict>
22
+ </plist>
@@ -0,0 +1,14 @@
1
+ //
2
+ // Prefix header
3
+ //
4
+ // The contents of this file are implicitly included at the beginning of every source file.
5
+ //
6
+
7
+ #ifdef __OBJC__
8
+ #import <UIKit/UIKit.h>
9
+ #import <Foundation/Foundation.h>
10
+ #import <Specta/Specta.h>
11
+ #define EXP_SHORTHAND
12
+ #import <Expecta/Expecta.h>
13
+ #import <OCMockito/OCMockito.h>
14
+ #endif