vendor 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
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
data/.gitignore CHANGED
@@ -10,3 +10,4 @@ contents.xcworkspacedata
10
10
  tmp
11
11
  log
12
12
  *.vendor
13
+ DerivedData
@@ -2,7 +2,6 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  vendor (0.0.1)
5
- colorize
6
5
  json
7
6
  rake
8
7
  rest-client
@@ -15,11 +14,10 @@ GEM
15
14
  specs:
16
15
  archive-tar-minitar (0.5.2)
17
16
  bond (0.4.1)
18
- colorize (0.5.8)
19
17
  columnize (0.3.4)
20
18
  diff-lcs (1.1.2)
21
19
  fakeweb (1.3.0)
22
- json (1.5.4)
20
+ json (1.6.1)
23
21
  linecache (0.46)
24
22
  rbx-require-relative (> 0.0.4)
25
23
  linecache19 (0.5.12)
@@ -27,7 +25,7 @@ GEM
27
25
  mime-types (1.16)
28
26
  rake (0.9.2)
29
27
  rbx-require-relative (0.0.5)
30
- rest-client (1.6.3)
28
+ rest-client (1.6.7)
31
29
  mime-types (>= 1.16)
32
30
  ripl (0.5.1)
33
31
  bond (~> 0.4.0)
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,5 +1,7 @@
1
1
  # Vendor – an iOS library management system
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/keithpitt/vendor.png)](http://travis-ci.org/keithpitt/vendor)
4
+
3
5
  Vendor makes the process of using and managing libraries in iOS easy. Vendor is modeled after [Bundler](https://github.com/carlhuda/bundler). Vendor streamlines the installation and update process for dependent libraries. It also tracks versions and manages dependencies between libraries.
4
6
 
5
7
  ## Installation
@@ -23,11 +25,37 @@ $ sudo gem install vendor
23
25
  Specify your dependencies in a Vendors file in your project's root.
24
26
 
25
27
  ```ruby
26
- source "https://vendorage.com"
28
+ source "https://vendorforge.com"
27
29
 
30
+ # Downloads the latest version of DKBenchmark from
31
+ # http://vendorforge.com
28
32
  lib "DKBenchmark"
29
- lib "DKPredicateBuilder"
30
- lib "JSONKit", :git => "https://github.com/johnezang/JSONKit.git"
33
+
34
+ # Downloads version 0.5 of DKPredicateBuilder from
35
+ # http://vendorforge.com
36
+ lib "DKPredicateBuilder", '0.5'
37
+
38
+ # Include all the source files found in ~/Development/DKRest/Classes
39
+ # This is usefull when developing your own libraries
40
+ lib "DKRest", :path => "~/Development/DKRest", :require => "Classes"
41
+
42
+ # Checks out the git repo and includes all the files found in the
43
+ # AFNetworking folder in the repo. The require option is handy for
44
+ # repo's that haven't created vendor libraries and pushed them to
45
+ # Vendorforge
46
+ lib "DKRest", :git => "git://github.com/gowalla/AFNetworking.git", :require => "AFNetworking"
47
+
48
+ # The Vendorfile allows you to specify targets to add your libraries to.
49
+ # By default, each library will be added to all targets, but if you have
50
+ # library that you only wanted to use in the "Integration Tests" target,
51
+ # you could do the following
52
+ target "Integration Tests" do
53
+ lib "cedar", '0.2'
54
+ end
55
+
56
+ # These lines are an alternative syntax to the target specification above
57
+ lib "OCMock", :targets => [ "Integration Tests", "Specs" ]
58
+ lib "Kiwi", :target => "Specs"
31
59
  ```
32
60
 
33
61
  You can do this by either creating a `Vendorfile` manually, or by running:
@@ -43,7 +71,7 @@ $ vendor install
43
71
  $ git add Vendors.lock
44
72
  ```
45
73
 
46
- Installing a vendor library gets the latest version of the code, and adds them directly to your project in a "Vendor" group.
74
+ Installing a vendor library gets the latest version of the code, and adds them directly to your project in a `Vendor` group.
47
75
 
48
76
  As part of the installation process the required frameworks are added aswell as any compiler/linker flags. The installed version of the library is captured in the Vendors.lock file.
49
77
 
@@ -53,11 +81,21 @@ XCode sometimes goes bonkers if you try and make a modification to it while its
53
81
 
54
82
  ## Creating Libraries
55
83
 
84
+ If a vendor library has no framework dependencies, has no required additional compiler/linker flags, and has an XCode project, it doesn’t require a "vendorspec". An example is JSONKit, which may be specified as below. However, if another Vendor library requires JSONKit, JSONKit must have a vendorspec.
85
+
86
+ ```ruby
87
+ lib "JSONKit", :git => "https://github.com/johnezang/JSONKit.git"
88
+ ```
89
+
90
+ However, if the vendor library requires frameworks or has dependencies on other Vendor libraries, it must have a vendorspec. As with Rubygems, a vendorspec is some declarative Ruby code that is open source and centrally managed.
91
+
92
+ To create a vendorspec, simply run:
93
+
56
94
  ```bash
57
- $ vendor library create
95
+ $ vendor library init
58
96
  ```
59
97
 
60
- Will create a `.vendorspec` file that looks something like this:
98
+ This command will create a blank `.vendorspec` file that looks something like this:
61
99
 
62
100
  ```ruby
63
101
  name "DKBenchmark"
@@ -73,13 +111,46 @@ github "https://github.com/keithpitt/DKBenchmark"
73
111
  files [ "DKBenchmark.h", "DKBenchmark.m" ]
74
112
  ```
75
113
 
76
- Change what you need to match your project, and to push the library to
77
- [http://vendorage.com](http://vendorage.com), just run the following:
114
+ Change what you need to match your project, then build a packaged
115
+ vendor library by running:
116
+
117
+ ```bash
118
+ $ vendor library build my_library.vendorspec
119
+ ```
120
+
121
+ Now that you have a packaged library, you can push it to [http://vendorforge.org](http://vendorforge.org) by
122
+ running:
78
123
 
79
124
  ```bash
80
- $ vendor library publish
125
+ $ vendor library publish my_library.vendor
81
126
  ```
82
127
 
128
+ ## Why not CocoaPods?
129
+
130
+ During the early days of Vendor development, another dependency/package
131
+ manager called [CocoaPods](https://github.com/alloy/cocoapods) came on the seen. I had a look into the
132
+ project, but _I_ like my all the source files in my project to be in
133
+ one place. I didn't like the idea of compiling all my dependencies into
134
+ a static lib. I also don't like the approach of _requiring_ all libs to
135
+ be commited to the main CocoaPods repo (just like [homebrew](https://github.com/mxcl/homebrew)).
136
+ I think it puts alot of pressure on the maintainer to make sure that he reviews all the libs and that they're
137
+ not doing anything smelly.
138
+
139
+ In saying that, trying to solve the problem of iOS dependency
140
+ management, is tough, and a big shout out to anyone that tries to solve
141
+ the problem. I should also mention another library that I admire that is
142
+ also trying to solve this problem: [Kit](https://github.com/nkpart/kit)
143
+
144
+ I wrote Vendor the way I think dependency management should be handled,
145
+ and in a way that I like. Vendor can work with any lib, even if it
146
+ doesn't have a compiled vendorspec - which I think is one of the
147
+ strengths of Vendor.
148
+
149
+ I also like the idea of a central site where people can upload their own
150
+ libraries - just like Rubygems. There isn't much of an ecosystem
151
+ around iOS development, just lots of isolated Github repos. I hope
152
+ Vendor can fix this.
153
+
83
154
  ## History
84
155
 
85
156
  Vendor was inspired by a blog post entitled [Vendor – Bringing Bundler to iOS](http://engineering.gomiso.com/2011/08/08/vendor-the-best-way-to-manage-ios-libraries/). I had started working on Vendor after they started doing it themselves. Their repo can be found here [https://github.com/bazaarlabs/vendor](https://github.com/bazaarlabs/vendor). I took many of the ideas (and parts of this Readme) from their code.
@@ -96,6 +167,16 @@ So I've probably made mistake or two. But thats OK, because at least I have *som
96
167
  * [Tim Lee](http://twitter.com/#!/timothy1ee)
97
168
  * [Jari Bakken](https://github.com/jarib/plist/blob/master/lib/plist/ascii.rb)
98
169
 
170
+ ## Special Thanks
171
+
172
+ Thanks to the following libraries. They provided me with a great deal of
173
+ inspiration and example code :D
174
+
175
+ * [CocoaPods](https://github.com/alloy/cocoapods)
176
+ * [Kit](https://github.com/nkpart/kit)
177
+ * [Vendor](https://github.com/bazaarlabs/vendor)
178
+ * [Bundler](https://github.com/carlhuda/bundler)
179
+
99
180
  ## Note on Patches/Pull Requests
100
181
 
101
182
  1. Fork the project.
@@ -106,4 +187,4 @@ So I've probably made mistake or two. But thats OK, because at least I have *som
106
187
 
107
188
  ## Copyright
108
189
 
109
- Copyright (c) 2011 Keith Pitt. See LICENSE for details.
190
+ Copyright © 2011 Keith Pitt. See LICENSE for details.
data/bin/vendor CHANGED
@@ -2,61 +2,13 @@
2
2
  require "rubygems"
3
3
 
4
4
  require "thor"
5
+ require "thor/group"
5
6
  require "ripl"
6
7
 
7
- $:.push File.expand_path(File.join(__FILE__, "..", "..", "lib"))
8
+ # During development, I symlink /usr/local/bin/vendor to this file
9
+ this_file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
10
+ $:.push File.expand_path(File.join(this_file, "..", "..", "lib"))
8
11
 
9
12
  require "vendor"
10
- require "vendor/cli"
11
13
 
12
- class Vendor::App < Thor
13
-
14
- desc "auth", "Login to your vendorage.com account"
15
- def auth
16
- begin
17
- Vendor::CLI::Auth.with_api_key do |api_key|
18
- puts "Successfully authenticated".green
19
- end
20
- rescue Vendor::API::Error => e
21
- puts "Error: #{e.message}".red
22
- end
23
- end
24
-
25
- desc "build MANIFEST_FILE", "Build a vendor package from a vendorspec file"
26
- def build(file)
27
- builder = Vendor::Manifest::Builder.new(File.expand_path(file))
28
- if builder.build
29
- puts "Successfully built Vendor".green
30
- puts "Name: #{builder.name}"
31
- puts "Version: #{builder.version}"
32
- puts "File: #{builder.filename}"
33
- end
34
- end
35
-
36
- desc "publish VENDOR_FILE", "Publish a vendor package to vendorage.com"
37
- def publish(file)
38
- begin
39
- Vendor::CLI::Auth.with_api_key do |api_key|
40
- url = Vendor::API.publish :file => File.expand_path(file), :api_key => api_key
41
- puts "Successfully published to #{url}".green
42
- end
43
- rescue Vendor::API::Error => e
44
- puts "Error: #{e.message}".red
45
- end
46
- end
47
-
48
- desc "console", "Load an interactive shell with the Vendor classes loaded"
49
- def console
50
- # Need to clear the arguments otherwise they are passed through to RIPL
51
- ARGV.clear
52
- Ripl.start :binding => Vendor::CLI.instance_eval{ binding }
53
- end
54
-
55
- # Exit with 1 if thor encounters an error (such as command missing)
56
- def self.exit_on_failure?
57
- true
58
- end
59
-
60
- end
61
-
62
- Vendor::App.start
14
+ Vendor::CLI::App.start
@@ -1,33 +1,44 @@
1
- $:.push File.expand_path("../", __FILE__)
2
-
3
1
  require "vendor/version"
4
- require "vendor/plist"
5
- require "vendor/config"
6
- require "vendor/api"
7
-
8
- require "vendor/vendor_spec/builder"
9
- require "vendor/vendor_spec/dsl"
10
- require "vendor/vendor_spec/loader"
11
2
 
12
3
  require "vendor/extensions/array"
13
4
  require "vendor/extensions/hash"
14
5
  require "vendor/extensions/fixnum"
15
6
  require "vendor/extensions/string"
16
7
 
17
- require "vendor/xcode/object"
18
- require "vendor/xcode/project"
19
-
20
- require "vendor/xcode/objects/pbx_project"
21
- require "vendor/xcode/objects/pbx_file_reference"
22
- require "vendor/xcode/objects/pbx_group"
23
- require "vendor/xcode/objects/pbx_sources_build_phase"
24
- require "vendor/xcode/objects/pbx_build_file"
25
- require "vendor/xcode/objects/pbx_frameworks_build_phase"
26
- require "vendor/xcode/objects/pbx_resources_build_phase"
27
- require "vendor/xcode/objects/pbx_native_target"
28
- require "vendor/xcode/objects/pbx_container_item_proxy"
29
- require "vendor/xcode/objects/pbx_target_dependency"
30
- require "vendor/xcode/objects/pbx_variant_group"
31
- require "vendor/xcode/objects/pbx_shell_script_build_phase"
32
- require "vendor/xcode/objects/xc_build_configuration"
33
- require "vendor/xcode/objects/xc_configuration_list"
8
+ module Vendor
9
+
10
+ autoload :UI, 'vendor/ui'
11
+ autoload :Plist, 'vendor/plist'
12
+ autoload :Config, 'vendor/config'
13
+ autoload :API, 'vendor/api'
14
+ autoload :Template, 'vendor/template'
15
+ autoload :VendorFile, 'vendor/vendor_file'
16
+ autoload :VendorSpec, 'vendor/vendor_spec'
17
+ autoload :XCode, 'vendor/xcode'
18
+ autoload :CLI, 'vendor/cli'
19
+
20
+ class << self
21
+
22
+ attr_writer :ui
23
+
24
+ def root
25
+ File.join File.expand_path("../", __FILE__)
26
+ end
27
+
28
+ def ui
29
+ @ui ||= UI.new
30
+ end
31
+
32
+ def library_path
33
+ unless @library_path
34
+ @library_path = File.expand_path("~/.vendor/libraries/")
35
+ FileUtils.mkdir_p @library_path
36
+ end
37
+ @library_path
38
+ end
39
+
40
+ end
41
+
42
+ end
43
+
44
+ $:.push Vendor.root
@@ -42,7 +42,7 @@ module Vendor
42
42
  end
43
43
 
44
44
  def resource(user = nil, pass = nil)
45
- RestClient::Resource.new(ENV["API_URI"] || 'http://vendorage.com', :user => user, :password => pass)
45
+ RestClient::Resource.new(ENV["API_URI"] || 'http://vendorforge.org', :user => user, :password => pass)
46
46
  end
47
47
 
48
48
  end
@@ -1,22 +1,10 @@
1
- require "vendor/cli/auth"
2
-
3
1
  module Vendor
4
2
 
5
3
  module CLI
6
4
 
7
- # This reload method kinda works. It works if you change/add methods, but if you
8
- # remove methods from a class, they still seem to hang around. I believe there is
9
- # a fair amount of magic in rails that lets you call a reload!, but for the save
10
- # of Vendor development, this will suffice.
11
- def self.reload!
12
- begin
13
- old_verbose, $VERBOSE = $VERBOSE, nil
14
- $".grep(/\/lib\/vendor/).each {|e| $".delete(e) && require(e) }
15
- ensure
16
- $VERBOSE = old_verbose
17
- end
18
- "Reloaded!"
19
- end
5
+ autoload :Auth, "vendor/cli/auth"
6
+ autoload :Console, "vendor/cli/console"
7
+ autoload :App, "vendor/cli/app"
20
8
 
21
9
  end
22
10
 
@@ -0,0 +1,140 @@
1
+ module Vendor
2
+
3
+ module CLI
4
+
5
+ class App < Thor
6
+
7
+ class Library < Thor
8
+
9
+ desc "init", "Generate a simple vendorspec, placed in the current directory"
10
+ def init
11
+ # Use the current folder name as the name of the vendorspec
12
+ name = File.basename(Dir.pwd)
13
+
14
+ # Figure out who should be the author
15
+ username = `git config --get github.user` ||
16
+ `git config --get github.user` ||
17
+ `whoami`
18
+ email = `git config --get user.email` ||
19
+ "#{username}@example.com"
20
+
21
+ Vendor::Template.copy "vendorspec", :name => "#{name.downcase}.vendorspec",
22
+ :locals => { :name => name,
23
+ :username => username.chomp,
24
+ :email => email.chomp }
25
+ end
26
+
27
+ desc "library build VENDORSPEC_FILE", "Build a vendor package from a vendorspec file"
28
+ def build(file)
29
+ builder = Vendor::VendorSpec::Builder.new(File.expand_path(file))
30
+ if builder.build
31
+ Vendor.ui.success "Successfully built library"
32
+ Vendor.ui.info "Name: #{builder.name}"
33
+ Vendor.ui.info "Version: #{builder.version}"
34
+ Vendor.ui.info "File: #{builder.filename}"
35
+ end
36
+ end
37
+
38
+ desc "library publish VENDOR_FILE", "Publish a vendor package to vendorforge.org"
39
+ def publish(file)
40
+ begin
41
+ Vendor::CLI::Auth.with_api_key do |api_key|
42
+ url = Vendor::API.publish :file => File.expand_path(file), :api_key => api_key
43
+ Vendor.ui.success "Successfully published to #{url}"
44
+ end
45
+ rescue Vendor::API::Error => e
46
+ Vendor.ui.error "Error: #{e.message}"
47
+ exit 1
48
+ end
49
+ end
50
+
51
+ # This is a hack so Thor doesn't output 2 help commands...
52
+ def self.printable_tasks(all = true, subcommand = false)
53
+ super.delete_if { |x| x[0].match(/vendor help/) }
54
+ end
55
+
56
+ end
57
+
58
+ def initialize(*)
59
+ super
60
+ the_shell = (options["no-color"] ? Thor::Shell::Basic.new : shell)
61
+ Vendor.ui = UI::Shell.new(the_shell)
62
+ Vendor.ui.debug! if options["verbose"]
63
+ end
64
+
65
+ default_task :install
66
+ class_option "no-color", :type => :boolean, :banner => "Disable colorization in output"
67
+ class_option "verbose", :type => :boolean, :banner => "Enable verbose output mode", :aliases => "-V"
68
+ map "--version" => :version
69
+
70
+ register Library, 'library', 'library <command>', 'Commands that will help you create and publish libraries', :hide => true
71
+
72
+ desc "install", "Install the libraries defined in your Vendorfile to the current project"
73
+ def install
74
+ vendorfile = File.expand_path("Vendorfile")
75
+
76
+ unless File.exist?(vendorfile)
77
+ Vendor.ui.error "Could not find Vendorfile"
78
+ exit 1
79
+ end
80
+
81
+ projects = Dir["*.xcodeproj"]
82
+
83
+ if projects.length > 1
84
+ Vendor.ui.error "Mutiple projects found #{projects.join(', ')}. I don't know how to deal with this yet."
85
+ exit 1
86
+ end
87
+
88
+ project = Vendor::XCode::Project.new(projects.first)
89
+
90
+ loader = Vendor::VendorFile::Loader.new
91
+ loader.load vendorfile
92
+ loader.download
93
+ loader.install project
94
+
95
+ if project.dirty?
96
+ project.save
97
+ Vendor.ui.success "Finished installing into #{project.name}"
98
+ else
99
+ Vendor.ui.info "No changes were made to #{project.name}"
100
+ end
101
+ end
102
+
103
+ desc "init", "Generate a simple Vendorfile, placed in the current directory"
104
+ def init
105
+ Vendor::Template.copy "Vendorfile"
106
+ end
107
+
108
+ desc "auth", "Login to your vendorforge.org account"
109
+ def auth
110
+ begin
111
+ Vendor::CLI::Auth.with_api_key do |api_key|
112
+ Vendor.ui.success "Successfully authenticated"
113
+ end
114
+ rescue Vendor::API::Error => e
115
+ Vendor.ui.error "Error: #{e.message}"
116
+ end
117
+ end
118
+
119
+ desc "console", "Load an interactive shell with the Vendor classes loaded (used for development)"
120
+ def console
121
+ # Need to clear the arguments otherwise they are passed through to RIPL
122
+ ARGV.clear
123
+ Ripl.start :binding => Vendor::CLI::Console.instance_eval{ binding }
124
+ end
125
+
126
+ desc "version", "Output the current version of vendor", :hide => true
127
+ def version
128
+ Vendor.ui.info Vendor::VERSION
129
+ end
130
+
131
+ # Exit with 1 if thor encounters an error (such as command missing)
132
+ def self.exit_on_failure?
133
+ true
134
+ end
135
+
136
+ end
137
+
138
+ end
139
+
140
+ end