vendor 0.0.1 → 0.0.2

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 (166) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile.lock +2 -4
  3. data/LICENSE +20 -0
  4. data/Readme.markdown +91 -10
  5. data/bin/vendor +5 -53
  6. data/lib/vendor.rb +37 -26
  7. data/lib/vendor/api.rb +1 -1
  8. data/lib/vendor/cli.rb +3 -15
  9. data/lib/vendor/cli/app.rb +140 -0
  10. data/lib/vendor/cli/auth.rb +6 -4
  11. data/lib/vendor/cli/console.rb +25 -0
  12. data/lib/vendor/extensions/string.rb +1 -1
  13. data/lib/vendor/template.rb +55 -0
  14. data/lib/vendor/templates/Vendorfile +3 -0
  15. data/lib/vendor/templates/vendorspec +15 -0
  16. data/lib/vendor/ui.rb +62 -0
  17. data/lib/vendor/vendor_file.rb +12 -0
  18. data/lib/vendor/vendor_file/dsl.rb +54 -0
  19. data/lib/vendor/vendor_file/library.rb +16 -0
  20. data/lib/vendor/vendor_file/library/base.rb +95 -0
  21. data/lib/vendor/vendor_file/library/git.rb +71 -0
  22. data/lib/vendor/vendor_file/library/local.rb +22 -0
  23. data/lib/vendor/vendor_file/library/remote.rb +18 -0
  24. data/lib/vendor/vendor_file/loader.rb +36 -0
  25. data/lib/vendor/vendor_file/source.rb +21 -0
  26. data/lib/vendor/vendor_spec.rb +11 -0
  27. data/lib/vendor/vendor_spec/builder.rb +10 -3
  28. data/lib/vendor/version.rb +1 -1
  29. data/lib/vendor/xcode.rb +10 -0
  30. data/lib/vendor/xcode/project.rb +132 -19
  31. data/lib/vendor/xcode/proxy.rb +28 -0
  32. data/lib/vendor/xcode/{object.rb → proxy/base.rb} +52 -25
  33. data/lib/vendor/xcode/proxy/pbx_build_file.rb +9 -0
  34. data/lib/vendor/xcode/proxy/pbx_container_item_proxy.rb +8 -0
  35. data/lib/vendor/xcode/proxy/pbx_file_reference.rb +39 -0
  36. data/lib/vendor/xcode/proxy/pbx_frameworks_build_phase.rb +9 -0
  37. data/lib/vendor/xcode/proxy/pbx_group.rb +35 -0
  38. data/lib/vendor/xcode/{objects → proxy}/pbx_native_target.rb +2 -2
  39. data/lib/vendor/xcode/{objects → proxy}/pbx_project.rb +2 -2
  40. data/lib/vendor/xcode/proxy/pbx_resources_build_phase.rb +7 -0
  41. data/lib/vendor/xcode/proxy/pbx_shell_script_build_phase.rb +7 -0
  42. data/lib/vendor/xcode/proxy/pbx_sources_build_phase.rb +9 -0
  43. data/lib/vendor/xcode/proxy/pbx_target_dependency.rb +7 -0
  44. data/lib/vendor/xcode/proxy/pbx_variant_group.rb +7 -0
  45. data/lib/vendor/xcode/proxy/xc_build_configuration.rb +7 -0
  46. data/lib/vendor/xcode/proxy/xc_configuration_list.rb +9 -0
  47. data/lib/vendor/xcode/proxy/xc_version_group.rb +7 -0
  48. data/spec/{vendor → lib/vendor}/api_spec.rb +0 -0
  49. data/spec/{vendor → lib/vendor}/cli/auth_spec.rb +1 -1
  50. data/spec/{vendor → lib/vendor}/config_spec.rb +1 -1
  51. data/spec/lib/vendor/template_spec.rb +36 -0
  52. data/spec/lib/vendor/vendor_file/dsl_spec.rb +5 -0
  53. data/spec/lib/vendor/vendor_file/library/base_spec.rb +148 -0
  54. data/spec/lib/vendor/vendor_file/library/git_spec.rb +33 -0
  55. data/spec/lib/vendor/vendor_file/library/local_spec.rb +19 -0
  56. data/spec/lib/vendor/vendor_file/library/remote_spec.rb +13 -0
  57. data/spec/lib/vendor/vendor_file/loader_spec.rb +102 -0
  58. data/spec/lib/vendor/vendor_file/source_spec.rb +17 -0
  59. data/spec/{vendor → lib/vendor}/vendor_spec/builder_spec.rb +0 -0
  60. data/spec/{vendor → lib/vendor}/vendor_spec/dsl_spec.rb +0 -0
  61. data/spec/{vendor → lib/vendor}/vendor_spec/loader_spec.rb +1 -1
  62. data/spec/lib/vendor/xcode/project_spec.rb +400 -0
  63. data/spec/{vendor/xcode/object_spec.rb → lib/vendor/xcode/proxy/base_spec.rb} +15 -3
  64. data/spec/lib/vendor/xcode/proxy/pbx_file_reference_spec.rb +25 -0
  65. data/spec/lib/vendor/xcode/proxy/pbx_group_spec.rb +27 -0
  66. data/spec/{vendor/xcode/objects → lib/vendor/xcode/proxy}/pbx_project_spec.rb +1 -1
  67. data/spec/spec_helper.rb +5 -3
  68. data/spec/support/api_stubs.rb +4 -3
  69. data/spec/support/resources/Vendorfile +22 -0
  70. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/BICoreDataCache.mom +0 -0
  71. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/BMMapCalloutView.nib +0 -0
  72. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/Info.plist +0 -0
  73. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/bingmaps_logo.png +0 -0
  74. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/bingmaps_logo@2x.png +0 -0
  75. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_selected_comp.png +0 -0
  76. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_selected_comp@2x.png +0 -0
  77. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected.png +0 -0
  78. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected@2x.png +0 -0
  79. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected_comp.png +0 -0
  80. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected_comp@2x.png +0 -0
  81. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/callout_white.png +0 -0
  82. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/callout_white@2x.png +0 -0
  83. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_selected_comp.png +0 -0
  84. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_selected_comp@2x.png +0 -0
  85. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected.png +0 -0
  86. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected@2x.png +0 -0
  87. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected_comp.png +0 -0
  88. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected_comp@2x.png +0 -0
  89. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/mapConfiguration.plist +0 -0
  90. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/me_dot_128.png +0 -0
  91. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/networkDefaults.plist +0 -0
  92. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_selected_comp.png +0 -0
  93. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_selected_comp@2x.png +0 -0
  94. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected.png +0 -0
  95. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected@2x.png +0 -0
  96. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected_comp.png +0 -0
  97. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected_comp@2x.png +0 -0
  98. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_selected_comp.png +0 -0
  99. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_selected_comp@2x.png +0 -0
  100. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected.png +0 -0
  101. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected@2x.png +0 -0
  102. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected_comp.png +0 -0
  103. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected_comp@2x.png +0 -0
  104. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_selected_comp.png +0 -0
  105. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_selected_comp@2x.png +0 -0
  106. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected.png +0 -0
  107. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected@2x.png +0 -0
  108. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected_comp.png +0 -0
  109. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected_comp@2x.png +0 -0
  110. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/shadow.png +0 -0
  111. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/shadow@2x.png +0 -0
  112. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_selected_comp.png +0 -0
  113. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_selected_comp@2x.png +0 -0
  114. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected.png +0 -0
  115. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected@2x.png +0 -0
  116. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected_comp.png +0 -0
  117. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected_comp@2x.png +0 -0
  118. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMEntity.h +34 -0
  119. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMGeometry.h +67 -0
  120. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMapView.h +159 -0
  121. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMarker.h +41 -0
  122. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMarkerView.h +47 -0
  123. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMPushpinView.h +31 -0
  124. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMReverseGeocoder.h +63 -0
  125. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMTypes.h +25 -0
  126. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMUserLocation.h +26 -0
  127. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BingMaps.h +210 -0
  128. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/libBingMaps.a +0 -0
  129. data/spec/support/resources/cache/base/BingMapsIOS/README.html +8 -0
  130. data/spec/support/resources/cache/base/DKBenchmark-Manifest/data/DKBenchmark.h +18 -0
  131. data/spec/support/resources/cache/base/DKBenchmark-Manifest/data/DKBenchmark.m +73 -0
  132. data/spec/support/resources/cache/base/DKBenchmark-Manifest/vendor.json +1 -0
  133. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.h +18 -0
  134. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.m +73 -0
  135. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.vendorspec +11 -0
  136. data/spec/support/resources/projects/TabBarWithUnitTests/TabBarWithUnitTests.xcodeproj/project.pbxproj +10 -0
  137. data/spec/support/resources/projects/UtilityApplication/UtilityApplication.xcodeproj/project.pbxproj +288 -0
  138. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAAppDelegate.h +15 -0
  139. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAAppDelegate.m +60 -0
  140. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAFlipsideViewController.h +23 -0
  141. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAFlipsideViewController.m +69 -0
  142. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAMainViewController.h +13 -0
  143. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAMainViewController.m +75 -0
  144. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UtilityApplication-Info.plist +42 -0
  145. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UtilityApplication-Prefix.pch +14 -0
  146. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/en.lproj/InfoPlist.strings +2 -0
  147. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/en.lproj/MainStoryboard.storyboard +90 -0
  148. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/main.m +18 -0
  149. data/spec/support/resources/{files → source}/SecondViewController.h +0 -0
  150. data/spec/support/resources/{files → source}/SecondViewController.m +0 -0
  151. data/vendor.gemspec +0 -1
  152. metadata +254 -74
  153. data/LICENCE +0 -19
  154. data/lib/vendor/xcode/objects/pbx_build_file.rb +0 -9
  155. data/lib/vendor/xcode/objects/pbx_container_item_proxy.rb +0 -8
  156. data/lib/vendor/xcode/objects/pbx_file_reference.rb +0 -21
  157. data/lib/vendor/xcode/objects/pbx_frameworks_build_phase.rb +0 -9
  158. data/lib/vendor/xcode/objects/pbx_group.rb +0 -13
  159. data/lib/vendor/xcode/objects/pbx_resources_build_phase.rb +0 -7
  160. data/lib/vendor/xcode/objects/pbx_shell_script_build_phase.rb +0 -7
  161. data/lib/vendor/xcode/objects/pbx_sources_build_phase.rb +0 -9
  162. data/lib/vendor/xcode/objects/pbx_target_dependency.rb +0 -7
  163. data/lib/vendor/xcode/objects/pbx_variant_group.rb +0 -7
  164. data/lib/vendor/xcode/objects/xc_build_configuration.rb +0 -7
  165. data/lib/vendor/xcode/objects/xc_configuration_list.rb +0 -9
  166. data/spec/vendor/xcode/project_spec.rb +0 -211
@@ -0,0 +1,8 @@
1
+ <html>
2
+ <body>
3
+ <h1>Bing Maps iOS Control</h1>
4
+ <p>
5
+ Documentation for the Bing Maps iOS Control can be found at <a href="Docs/html/index.html">Docs/html/index.html</a>. The documentation includes information about getting started, system requirements, and a complete API reference.
6
+ </p>
7
+ </body>
8
+ </html>
@@ -0,0 +1,18 @@
1
+ //
2
+ // DKBenchmark.h
3
+ // DiscoKit
4
+ //
5
+ // Created by Keith Pitt on 30/06/11.
6
+ // Copyright 2011 Mostly Disco. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+
11
+ typedef void (^DKBenchmarkBlock)(void);
12
+
13
+ @interface DKBenchmark : NSObject
14
+
15
+ + (void)benchmark:(NSString *)name block:(DKBenchmarkBlock)block;
16
+ + (void)benchmark:(NSString *)name iterations:(NSInteger)iterations block:(DKBenchmarkBlock)block;
17
+
18
+ @end
@@ -0,0 +1,73 @@
1
+ //
2
+ // DKBenchmark.m
3
+ // DiscoKit
4
+ //
5
+ // Created by Keith Pitt on 30/06/11.
6
+ // Copyright 2011 Mostly Disco. All rights reserved.
7
+ //
8
+
9
+ #import "DKBenchmark.h"
10
+
11
+ @implementation DKBenchmark
12
+
13
+ + (void)benchmark:(NSString *)name block:(DKBenchmarkBlock)block {
14
+
15
+ // If you don't specify an iterations loop, lets just default
16
+ // it to 100.
17
+ [self benchmark:name iterations:100 block:block];
18
+
19
+ }
20
+
21
+ + (void)benchmark:(NSString *)name iterations:(NSInteger)iterations block:(DKBenchmarkBlock)block {
22
+
23
+ // Store the results of the iteration in this array
24
+ NSMutableArray * results = [[NSMutableArray alloc] init];
25
+
26
+ // Define variables that we're going to use in the loop.
27
+ NSDate * date;
28
+ NSTimeInterval timePassed;
29
+
30
+ for (NSInteger i = 0; i < iterations; i++) {
31
+
32
+ // Grab the current date
33
+ date = [[NSDate alloc] init];
34
+
35
+ // Run the block
36
+ block();
37
+
38
+ // Calcualte the time that has passed, and convert to a
39
+ // signed integer by * -1
40
+ timePassed = [date timeIntervalSinceNow] * -1;
41
+
42
+ // Release the date
43
+ [date release], date = nil;
44
+
45
+ // Add the result
46
+ [results addObject:[NSNumber numberWithDouble:timePassed]];
47
+
48
+ }
49
+
50
+ // Start at 0
51
+ NSDecimalNumber * average = [NSDecimalNumber decimalNumberWithDecimal:
52
+ [[NSNumber numberWithInt:0] decimalValue]];
53
+
54
+ // Add all our results together
55
+ for (NSNumber * timePassed in results) {
56
+ average = [average decimalNumberByAdding:
57
+ [NSDecimalNumber decimalNumberWithDecimal:
58
+ [timePassed decimalValue]]];
59
+ }
60
+
61
+ // Divide them by the total
62
+ average = [average decimalNumberByDividingBy:
63
+ [NSDecimalNumber decimalNumberWithDecimal:
64
+ [[NSNumber numberWithInt:iterations] decimalValue]]];
65
+
66
+ // Show the results
67
+ NSLog(@"[DKBenchmark] \"%@\" took %@ seconds on average with (%i iterations)", name, average, iterations);
68
+
69
+ [results release];
70
+
71
+ }
72
+
73
+ @end
@@ -0,0 +1 @@
1
+ {"name":"DKBenchmark","version":"0.1","authors":"keithpitt","email":"me@keithpitt.com","homepage":"http://www.keithpitt.com","description":"Easy benchmarking in Objective-C using blocks","github":"https://github.com/keithpitt/DKBenchmark","files":["DKBenchmark.h","DKBenchmark.m"]}
@@ -0,0 +1,18 @@
1
+ //
2
+ // DKBenchmark.h
3
+ // DiscoKit
4
+ //
5
+ // Created by Keith Pitt on 30/06/11.
6
+ // Copyright 2011 Mostly Disco. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+
11
+ typedef void (^DKBenchmarkBlock)(void);
12
+
13
+ @interface DKBenchmark : NSObject
14
+
15
+ + (void)benchmark:(NSString *)name block:(DKBenchmarkBlock)block;
16
+ + (void)benchmark:(NSString *)name iterations:(NSInteger)iterations block:(DKBenchmarkBlock)block;
17
+
18
+ @end
@@ -0,0 +1,73 @@
1
+ //
2
+ // DKBenchmark.m
3
+ // DiscoKit
4
+ //
5
+ // Created by Keith Pitt on 30/06/11.
6
+ // Copyright 2011 Mostly Disco. All rights reserved.
7
+ //
8
+
9
+ #import "DKBenchmark.h"
10
+
11
+ @implementation DKBenchmark
12
+
13
+ + (void)benchmark:(NSString *)name block:(DKBenchmarkBlock)block {
14
+
15
+ // If you don't specify an iterations loop, lets just default
16
+ // it to 100.
17
+ [self benchmark:name iterations:100 block:block];
18
+
19
+ }
20
+
21
+ + (void)benchmark:(NSString *)name iterations:(NSInteger)iterations block:(DKBenchmarkBlock)block {
22
+
23
+ // Store the results of the iteration in this array
24
+ NSMutableArray * results = [[NSMutableArray alloc] init];
25
+
26
+ // Define variables that we're going to use in the loop.
27
+ NSDate * date;
28
+ NSTimeInterval timePassed;
29
+
30
+ for (NSInteger i = 0; i < iterations; i++) {
31
+
32
+ // Grab the current date
33
+ date = [[NSDate alloc] init];
34
+
35
+ // Run the block
36
+ block();
37
+
38
+ // Calcualte the time that has passed, and convert to a
39
+ // signed integer by * -1
40
+ timePassed = [date timeIntervalSinceNow] * -1;
41
+
42
+ // Release the date
43
+ [date release], date = nil;
44
+
45
+ // Add the result
46
+ [results addObject:[NSNumber numberWithDouble:timePassed]];
47
+
48
+ }
49
+
50
+ // Start at 0
51
+ NSDecimalNumber * average = [NSDecimalNumber decimalNumberWithDecimal:
52
+ [[NSNumber numberWithInt:0] decimalValue]];
53
+
54
+ // Add all our results together
55
+ for (NSNumber * timePassed in results) {
56
+ average = [average decimalNumberByAdding:
57
+ [NSDecimalNumber decimalNumberWithDecimal:
58
+ [timePassed decimalValue]]];
59
+ }
60
+
61
+ // Divide them by the total
62
+ average = [average decimalNumberByDividingBy:
63
+ [NSDecimalNumber decimalNumberWithDecimal:
64
+ [[NSNumber numberWithInt:iterations] decimalValue]]];
65
+
66
+ // Show the results
67
+ NSLog(@"[DKBenchmark] \"%@\" took %@ seconds on average with (%i iterations)", name, average, iterations);
68
+
69
+ [results release];
70
+
71
+ }
72
+
73
+ @end
@@ -0,0 +1,11 @@
1
+ name "DKBenchmark"
2
+ version "0.1"
3
+
4
+ authors "keithpitt"
5
+ email "me@keithpitt.com"
6
+ homepage "http://www.keithpitt.com"
7
+ description "Easy benchmarking in Objective-C using blocks"
8
+
9
+ github "https://github.com/keithpitt/DKBenchmark"
10
+
11
+ files [ "DKBenchmark.h", "DKBenchmark.m" ]
@@ -7,6 +7,8 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ 532F5364145F68BB007AF27D /* Mario.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 532F5362145F68BB007AF27D /* Mario.jpg */; };
11
+ 532F5365145F68BB007AF27D /* Mario@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 532F5363145F68BB007AF27D /* Mario@2x.jpg */; };
10
12
  53FA525A1415C530001D35FA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53FA52591415C530001D35FA /* UIKit.framework */; };
11
13
  53FA525C1415C530001D35FA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53FA525B1415C530001D35FA /* Foundation.framework */; };
12
14
  53FA525E1415C530001D35FA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53FA525D1415C530001D35FA /* CoreGraphics.framework */; };
@@ -38,6 +40,8 @@
38
40
  /* End PBXContainerItemProxy section */
39
41
 
40
42
  /* Begin PBXFileReference section */
43
+ 532F5362145F68BB007AF27D /* Mario.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Mario.jpg; sourceTree = SOURCE_ROOT; };
44
+ 532F5363145F68BB007AF27D /* Mario@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "Mario@2x.jpg"; sourceTree = SOURCE_ROOT; };
41
45
  53FA52551415C530001D35FA /* TabBarWithUnitTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TabBarWithUnitTests.app; sourceTree = BUILT_PRODUCTS_DIR; };
42
46
  53FA52591415C530001D35FA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
43
47
  53FA525B1415C530001D35FA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -138,6 +142,8 @@
138
142
  53FA52601415C530001D35FA /* Supporting Files */ = {
139
143
  isa = PBXGroup;
140
144
  children = (
145
+ 532F5362145F68BB007AF27D /* Mario.jpg */,
146
+ 532F5363145F68BB007AF27D /* Mario@2x.jpg */,
141
147
  53FA52611415C530001D35FA /* TabBarWithUnitTests-Info.plist */,
142
148
  53FA52621415C530001D35FA /* InfoPlist.strings */,
143
149
  53FA52651415C530001D35FA /* main.m */,
@@ -236,6 +242,8 @@
236
242
  53FA526D1415C530001D35FA /* MainWindow.xib in Resources */,
237
243
  53FA52761415C530001D35FA /* FirstView.xib in Resources */,
238
244
  53FA52791415C530001D35FA /* SecondView.xib in Resources */,
245
+ 532F5364145F68BB007AF27D /* Mario.jpg in Resources */,
246
+ 532F5365145F68BB007AF27D /* Mario@2x.jpg in Resources */,
239
247
  );
240
248
  runOnlyForDeploymentPostprocessing = 0;
241
249
  };
@@ -458,6 +466,7 @@
458
466
  53FA52951415C530001D35FA /* Release */,
459
467
  );
460
468
  defaultConfigurationIsVisible = 0;
469
+ defaultConfigurationName = Release;
461
470
  };
462
471
  53FA52961415C530001D35FA /* Build configuration list for PBXNativeTarget "TabBarWithUnitTestsTests" */ = {
463
472
  isa = XCConfigurationList;
@@ -466,6 +475,7 @@
466
475
  53FA52981415C530001D35FA /* Release */,
467
476
  );
468
477
  defaultConfigurationIsVisible = 0;
478
+ defaultConfigurationName = Release;
469
479
  };
470
480
  /* End XCConfigurationList section */
471
481
  };
@@ -0,0 +1,288 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 53A22322145F884F00A3EEAA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53A22321145F884F00A3EEAA /* UIKit.framework */; };
11
+ 53A22324145F884F00A3EEAA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53A22323145F884F00A3EEAA /* Foundation.framework */; };
12
+ 53A22326145F884F00A3EEAA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53A22325145F884F00A3EEAA /* CoreGraphics.framework */; };
13
+ 53A2232C145F884F00A3EEAA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53A2232A145F884F00A3EEAA /* InfoPlist.strings */; };
14
+ 53A2232E145F884F00A3EEAA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A2232D145F884F00A3EEAA /* main.m */; };
15
+ 53A22332145F884F00A3EEAA /* UAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A22331145F884F00A3EEAA /* UAAppDelegate.m */; };
16
+ 53A22335145F884F00A3EEAA /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53A22333145F884F00A3EEAA /* MainStoryboard.storyboard */; };
17
+ 53A22338145F884F00A3EEAA /* UAMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A22337145F884F00A3EEAA /* UAMainViewController.m */; };
18
+ 53A2233B145F884F00A3EEAA /* UAFlipsideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A2233A145F884F00A3EEAA /* UAFlipsideViewController.m */; };
19
+ /* End PBXBuildFile section */
20
+
21
+ /* Begin PBXFileReference section */
22
+ 53A2231D145F884F00A3EEAA /* UtilityApplication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UtilityApplication.app; sourceTree = BUILT_PRODUCTS_DIR; };
23
+ 53A22321145F884F00A3EEAA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
24
+ 53A22323145F884F00A3EEAA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
25
+ 53A22325145F884F00A3EEAA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
26
+ 53A22329145F884F00A3EEAA /* UtilityApplication-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UtilityApplication-Info.plist"; sourceTree = "<group>"; };
27
+ 53A2232B145F884F00A3EEAA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
28
+ 53A2232D145F884F00A3EEAA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29
+ 53A2232F145F884F00A3EEAA /* UtilityApplication-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UtilityApplication-Prefix.pch"; sourceTree = "<group>"; };
30
+ 53A22330145F884F00A3EEAA /* UAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UAAppDelegate.h; sourceTree = "<group>"; };
31
+ 53A22331145F884F00A3EEAA /* UAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UAAppDelegate.m; sourceTree = "<group>"; };
32
+ 53A22334145F884F00A3EEAA /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
33
+ 53A22336145F884F00A3EEAA /* UAMainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UAMainViewController.h; sourceTree = "<group>"; };
34
+ 53A22337145F884F00A3EEAA /* UAMainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UAMainViewController.m; sourceTree = "<group>"; };
35
+ 53A22339145F884F00A3EEAA /* UAFlipsideViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UAFlipsideViewController.h; sourceTree = "<group>"; };
36
+ 53A2233A145F884F00A3EEAA /* UAFlipsideViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UAFlipsideViewController.m; sourceTree = "<group>"; };
37
+ /* End PBXFileReference section */
38
+
39
+ /* Begin PBXFrameworksBuildPhase section */
40
+ 53A2231A145F884F00A3EEAA /* Frameworks */ = {
41
+ isa = PBXFrameworksBuildPhase;
42
+ buildActionMask = 2147483647;
43
+ files = (
44
+ 53A22322145F884F00A3EEAA /* UIKit.framework in Frameworks */,
45
+ 53A22324145F884F00A3EEAA /* Foundation.framework in Frameworks */,
46
+ 53A22326145F884F00A3EEAA /* CoreGraphics.framework in Frameworks */,
47
+ );
48
+ runOnlyForDeploymentPostprocessing = 0;
49
+ };
50
+ /* End PBXFrameworksBuildPhase section */
51
+
52
+ /* Begin PBXGroup section */
53
+ 53A22312145F884F00A3EEAA = {
54
+ isa = PBXGroup;
55
+ children = (
56
+ 53A22327145F884F00A3EEAA /* UtilityApplication */,
57
+ 53A22320145F884F00A3EEAA /* Frameworks */,
58
+ 53A2231E145F884F00A3EEAA /* Products */,
59
+ );
60
+ sourceTree = "<group>";
61
+ };
62
+ 53A2231E145F884F00A3EEAA /* Products */ = {
63
+ isa = PBXGroup;
64
+ children = (
65
+ 53A2231D145F884F00A3EEAA /* UtilityApplication.app */,
66
+ );
67
+ name = Products;
68
+ sourceTree = "<group>";
69
+ };
70
+ 53A22320145F884F00A3EEAA /* Frameworks */ = {
71
+ isa = PBXGroup;
72
+ children = (
73
+ 53A22321145F884F00A3EEAA /* UIKit.framework */,
74
+ 53A22323145F884F00A3EEAA /* Foundation.framework */,
75
+ 53A22325145F884F00A3EEAA /* CoreGraphics.framework */,
76
+ );
77
+ name = Frameworks;
78
+ sourceTree = "<group>";
79
+ };
80
+ 53A22327145F884F00A3EEAA /* UtilityApplication */ = {
81
+ isa = PBXGroup;
82
+ children = (
83
+ 53A22330145F884F00A3EEAA /* UAAppDelegate.h */,
84
+ 53A22331145F884F00A3EEAA /* UAAppDelegate.m */,
85
+ 53A22333145F884F00A3EEAA /* MainStoryboard.storyboard */,
86
+ 53A22336145F884F00A3EEAA /* UAMainViewController.h */,
87
+ 53A22337145F884F00A3EEAA /* UAMainViewController.m */,
88
+ 53A22339145F884F00A3EEAA /* UAFlipsideViewController.h */,
89
+ 53A2233A145F884F00A3EEAA /* UAFlipsideViewController.m */,
90
+ 53A22328145F884F00A3EEAA /* Supporting Files */,
91
+ );
92
+ path = UtilityApplication;
93
+ sourceTree = "<group>";
94
+ };
95
+ 53A22328145F884F00A3EEAA /* Supporting Files */ = {
96
+ isa = PBXGroup;
97
+ children = (
98
+ 53A22329145F884F00A3EEAA /* UtilityApplication-Info.plist */,
99
+ 53A2232A145F884F00A3EEAA /* InfoPlist.strings */,
100
+ 53A2232D145F884F00A3EEAA /* main.m */,
101
+ 53A2232F145F884F00A3EEAA /* UtilityApplication-Prefix.pch */,
102
+ );
103
+ name = "Supporting Files";
104
+ sourceTree = "<group>";
105
+ };
106
+ /* End PBXGroup section */
107
+
108
+ /* Begin PBXNativeTarget section */
109
+ 53A2231C145F884F00A3EEAA /* UtilityApplication */ = {
110
+ isa = PBXNativeTarget;
111
+ buildConfigurationList = 53A2233E145F884F00A3EEAA /* Build configuration list for PBXNativeTarget "UtilityApplication" */;
112
+ buildPhases = (
113
+ 53A22319145F884F00A3EEAA /* Sources */,
114
+ 53A2231A145F884F00A3EEAA /* Frameworks */,
115
+ 53A2231B145F884F00A3EEAA /* Resources */,
116
+ );
117
+ buildRules = (
118
+ );
119
+ dependencies = (
120
+ );
121
+ name = UtilityApplication;
122
+ productName = UtilityApplication;
123
+ productReference = 53A2231D145F884F00A3EEAA /* UtilityApplication.app */;
124
+ productType = "com.apple.product-type.application";
125
+ };
126
+ /* End PBXNativeTarget section */
127
+
128
+ /* Begin PBXProject section */
129
+ 53A22314145F884F00A3EEAA /* Project object */ = {
130
+ isa = PBXProject;
131
+ attributes = {
132
+ LastUpgradeCheck = 0420;
133
+ ORGANIZATIONNAME = n/a;
134
+ };
135
+ buildConfigurationList = 53A22317145F884F00A3EEAA /* Build configuration list for PBXProject "UtilityApplication" */;
136
+ compatibilityVersion = "Xcode 3.2";
137
+ developmentRegion = English;
138
+ hasScannedForEncodings = 0;
139
+ knownRegions = (
140
+ en,
141
+ );
142
+ mainGroup = 53A22312145F884F00A3EEAA;
143
+ productRefGroup = 53A2231E145F884F00A3EEAA /* Products */;
144
+ projectDirPath = "";
145
+ projectRoot = "";
146
+ targets = (
147
+ 53A2231C145F884F00A3EEAA /* UtilityApplication */,
148
+ );
149
+ };
150
+ /* End PBXProject section */
151
+
152
+ /* Begin PBXResourcesBuildPhase section */
153
+ 53A2231B145F884F00A3EEAA /* Resources */ = {
154
+ isa = PBXResourcesBuildPhase;
155
+ buildActionMask = 2147483647;
156
+ files = (
157
+ 53A2232C145F884F00A3EEAA /* InfoPlist.strings in Resources */,
158
+ 53A22335145F884F00A3EEAA /* MainStoryboard.storyboard in Resources */,
159
+ );
160
+ runOnlyForDeploymentPostprocessing = 0;
161
+ };
162
+ /* End PBXResourcesBuildPhase section */
163
+
164
+ /* Begin PBXSourcesBuildPhase section */
165
+ 53A22319145F884F00A3EEAA /* Sources */ = {
166
+ isa = PBXSourcesBuildPhase;
167
+ buildActionMask = 2147483647;
168
+ files = (
169
+ 53A2232E145F884F00A3EEAA /* main.m in Sources */,
170
+ 53A22332145F884F00A3EEAA /* UAAppDelegate.m in Sources */,
171
+ 53A22338145F884F00A3EEAA /* UAMainViewController.m in Sources */,
172
+ 53A2233B145F884F00A3EEAA /* UAFlipsideViewController.m in Sources */,
173
+ );
174
+ runOnlyForDeploymentPostprocessing = 0;
175
+ };
176
+ /* End PBXSourcesBuildPhase section */
177
+
178
+ /* Begin PBXVariantGroup section */
179
+ 53A2232A145F884F00A3EEAA /* InfoPlist.strings */ = {
180
+ isa = PBXVariantGroup;
181
+ children = (
182
+ 53A2232B145F884F00A3EEAA /* en */,
183
+ );
184
+ name = InfoPlist.strings;
185
+ sourceTree = "<group>";
186
+ };
187
+ 53A22333145F884F00A3EEAA /* MainStoryboard.storyboard */ = {
188
+ isa = PBXVariantGroup;
189
+ children = (
190
+ 53A22334145F884F00A3EEAA /* en */,
191
+ );
192
+ name = MainStoryboard.storyboard;
193
+ sourceTree = "<group>";
194
+ };
195
+ /* End PBXVariantGroup section */
196
+
197
+ /* Begin XCBuildConfiguration section */
198
+ 53A2233C145F884F00A3EEAA /* Debug */ = {
199
+ isa = XCBuildConfiguration;
200
+ buildSettings = {
201
+ ALWAYS_SEARCH_USER_PATHS = NO;
202
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
203
+ CLANG_ENABLE_OBJC_ARC = YES;
204
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
205
+ COPY_PHASE_STRIP = NO;
206
+ GCC_C_LANGUAGE_STANDARD = gnu99;
207
+ GCC_DYNAMIC_NO_PIC = NO;
208
+ GCC_OPTIMIZATION_LEVEL = 0;
209
+ GCC_PREPROCESSOR_DEFINITIONS = (
210
+ "DEBUG=1",
211
+ "$(inherited)",
212
+ );
213
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
214
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
215
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
216
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
217
+ GCC_WARN_UNUSED_VARIABLE = YES;
218
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
219
+ SDKROOT = iphoneos;
220
+ };
221
+ name = Debug;
222
+ };
223
+ 53A2233D145F884F00A3EEAA /* Release */ = {
224
+ isa = XCBuildConfiguration;
225
+ buildSettings = {
226
+ ALWAYS_SEARCH_USER_PATHS = NO;
227
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
228
+ CLANG_ENABLE_OBJC_ARC = YES;
229
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
230
+ COPY_PHASE_STRIP = YES;
231
+ GCC_C_LANGUAGE_STANDARD = gnu99;
232
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
233
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
234
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
235
+ GCC_WARN_UNUSED_VARIABLE = YES;
236
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
237
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
238
+ SDKROOT = iphoneos;
239
+ VALIDATE_PRODUCT = YES;
240
+ };
241
+ name = Release;
242
+ };
243
+ 53A2233F145F884F00A3EEAA /* Debug */ = {
244
+ isa = XCBuildConfiguration;
245
+ buildSettings = {
246
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
247
+ GCC_PREFIX_HEADER = "UtilityApplication/UtilityApplication-Prefix.pch";
248
+ INFOPLIST_FILE = "UtilityApplication/UtilityApplication-Info.plist";
249
+ PRODUCT_NAME = "$(TARGET_NAME)";
250
+ WRAPPER_EXTENSION = app;
251
+ };
252
+ name = Debug;
253
+ };
254
+ 53A22340145F884F00A3EEAA /* Release */ = {
255
+ isa = XCBuildConfiguration;
256
+ buildSettings = {
257
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
258
+ GCC_PREFIX_HEADER = "UtilityApplication/UtilityApplication-Prefix.pch";
259
+ INFOPLIST_FILE = "UtilityApplication/UtilityApplication-Info.plist";
260
+ PRODUCT_NAME = "$(TARGET_NAME)";
261
+ WRAPPER_EXTENSION = app;
262
+ };
263
+ name = Release;
264
+ };
265
+ /* End XCBuildConfiguration section */
266
+
267
+ /* Begin XCConfigurationList section */
268
+ 53A22317145F884F00A3EEAA /* Build configuration list for PBXProject "UtilityApplication" */ = {
269
+ isa = XCConfigurationList;
270
+ buildConfigurations = (
271
+ 53A2233C145F884F00A3EEAA /* Debug */,
272
+ 53A2233D145F884F00A3EEAA /* Release */,
273
+ );
274
+ defaultConfigurationIsVisible = 0;
275
+ defaultConfigurationName = Release;
276
+ };
277
+ 53A2233E145F884F00A3EEAA /* Build configuration list for PBXNativeTarget "UtilityApplication" */ = {
278
+ isa = XCConfigurationList;
279
+ buildConfigurations = (
280
+ 53A2233F145F884F00A3EEAA /* Debug */,
281
+ 53A22340145F884F00A3EEAA /* Release */,
282
+ );
283
+ defaultConfigurationIsVisible = 0;
284
+ };
285
+ /* End XCConfigurationList section */
286
+ };
287
+ rootObject = 53A22314145F884F00A3EEAA /* Project object */;
288
+ }