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.
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -4
- data/LICENSE +20 -0
- data/Readme.markdown +91 -10
- data/bin/vendor +5 -53
- data/lib/vendor.rb +37 -26
- data/lib/vendor/api.rb +1 -1
- data/lib/vendor/cli.rb +3 -15
- data/lib/vendor/cli/app.rb +140 -0
- data/lib/vendor/cli/auth.rb +6 -4
- data/lib/vendor/cli/console.rb +25 -0
- data/lib/vendor/extensions/string.rb +1 -1
- data/lib/vendor/template.rb +55 -0
- data/lib/vendor/templates/Vendorfile +3 -0
- data/lib/vendor/templates/vendorspec +15 -0
- data/lib/vendor/ui.rb +62 -0
- data/lib/vendor/vendor_file.rb +12 -0
- data/lib/vendor/vendor_file/dsl.rb +54 -0
- data/lib/vendor/vendor_file/library.rb +16 -0
- data/lib/vendor/vendor_file/library/base.rb +95 -0
- data/lib/vendor/vendor_file/library/git.rb +71 -0
- data/lib/vendor/vendor_file/library/local.rb +22 -0
- data/lib/vendor/vendor_file/library/remote.rb +18 -0
- data/lib/vendor/vendor_file/loader.rb +36 -0
- data/lib/vendor/vendor_file/source.rb +21 -0
- data/lib/vendor/vendor_spec.rb +11 -0
- data/lib/vendor/vendor_spec/builder.rb +10 -3
- data/lib/vendor/version.rb +1 -1
- data/lib/vendor/xcode.rb +10 -0
- data/lib/vendor/xcode/project.rb +132 -19
- data/lib/vendor/xcode/proxy.rb +28 -0
- data/lib/vendor/xcode/{object.rb → proxy/base.rb} +52 -25
- data/lib/vendor/xcode/proxy/pbx_build_file.rb +9 -0
- data/lib/vendor/xcode/proxy/pbx_container_item_proxy.rb +8 -0
- data/lib/vendor/xcode/proxy/pbx_file_reference.rb +39 -0
- data/lib/vendor/xcode/proxy/pbx_frameworks_build_phase.rb +9 -0
- data/lib/vendor/xcode/proxy/pbx_group.rb +35 -0
- data/lib/vendor/xcode/{objects → proxy}/pbx_native_target.rb +2 -2
- data/lib/vendor/xcode/{objects → proxy}/pbx_project.rb +2 -2
- data/lib/vendor/xcode/proxy/pbx_resources_build_phase.rb +7 -0
- data/lib/vendor/xcode/proxy/pbx_shell_script_build_phase.rb +7 -0
- data/lib/vendor/xcode/proxy/pbx_sources_build_phase.rb +9 -0
- data/lib/vendor/xcode/proxy/pbx_target_dependency.rb +7 -0
- data/lib/vendor/xcode/proxy/pbx_variant_group.rb +7 -0
- data/lib/vendor/xcode/proxy/xc_build_configuration.rb +7 -0
- data/lib/vendor/xcode/proxy/xc_configuration_list.rb +9 -0
- data/lib/vendor/xcode/proxy/xc_version_group.rb +7 -0
- data/spec/{vendor → lib/vendor}/api_spec.rb +0 -0
- data/spec/{vendor → lib/vendor}/cli/auth_spec.rb +1 -1
- data/spec/{vendor → lib/vendor}/config_spec.rb +1 -1
- data/spec/lib/vendor/template_spec.rb +36 -0
- data/spec/lib/vendor/vendor_file/dsl_spec.rb +5 -0
- data/spec/lib/vendor/vendor_file/library/base_spec.rb +148 -0
- data/spec/lib/vendor/vendor_file/library/git_spec.rb +33 -0
- data/spec/lib/vendor/vendor_file/library/local_spec.rb +19 -0
- data/spec/lib/vendor/vendor_file/library/remote_spec.rb +13 -0
- data/spec/lib/vendor/vendor_file/loader_spec.rb +102 -0
- data/spec/lib/vendor/vendor_file/source_spec.rb +17 -0
- data/spec/{vendor → lib/vendor}/vendor_spec/builder_spec.rb +0 -0
- data/spec/{vendor → lib/vendor}/vendor_spec/dsl_spec.rb +0 -0
- data/spec/{vendor → lib/vendor}/vendor_spec/loader_spec.rb +1 -1
- data/spec/lib/vendor/xcode/project_spec.rb +400 -0
- data/spec/{vendor/xcode/object_spec.rb → lib/vendor/xcode/proxy/base_spec.rb} +15 -3
- data/spec/lib/vendor/xcode/proxy/pbx_file_reference_spec.rb +25 -0
- data/spec/lib/vendor/xcode/proxy/pbx_group_spec.rb +27 -0
- data/spec/{vendor/xcode/objects → lib/vendor/xcode/proxy}/pbx_project_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -3
- data/spec/support/api_stubs.rb +4 -3
- data/spec/support/resources/Vendorfile +22 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/BICoreDataCache.mom +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/BMMapCalloutView.nib +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/Info.plist +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/bingmaps_logo.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/bingmaps_logo@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_selected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_selected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/callout_white.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/callout_white@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_selected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_selected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/mapConfiguration.plist +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/me_dot_128.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/networkDefaults.plist +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_selected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_selected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_selected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_selected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_selected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_selected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/shadow.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/shadow@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_selected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_selected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected_comp.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected_comp@2x.png +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMEntity.h +34 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMGeometry.h +67 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMapView.h +159 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMarker.h +41 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMarkerView.h +47 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMPushpinView.h +31 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMReverseGeocoder.h +63 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMTypes.h +25 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMUserLocation.h +26 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BingMaps.h +210 -0
- data/spec/support/resources/cache/base/BingMapsIOS/MapControl/libBingMaps.a +0 -0
- data/spec/support/resources/cache/base/BingMapsIOS/README.html +8 -0
- data/spec/support/resources/cache/base/DKBenchmark-Manifest/data/DKBenchmark.h +18 -0
- data/spec/support/resources/cache/base/DKBenchmark-Manifest/data/DKBenchmark.m +73 -0
- data/spec/support/resources/cache/base/DKBenchmark-Manifest/vendor.json +1 -0
- data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.h +18 -0
- data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.m +73 -0
- data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.vendorspec +11 -0
- data/spec/support/resources/projects/TabBarWithUnitTests/TabBarWithUnitTests.xcodeproj/project.pbxproj +10 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication.xcodeproj/project.pbxproj +288 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAAppDelegate.h +15 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAAppDelegate.m +60 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAFlipsideViewController.h +23 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAFlipsideViewController.m +69 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAMainViewController.h +13 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAMainViewController.m +75 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UtilityApplication-Info.plist +42 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UtilityApplication-Prefix.pch +14 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/en.lproj/InfoPlist.strings +2 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/en.lproj/MainStoryboard.storyboard +90 -0
- data/spec/support/resources/projects/UtilityApplication/UtilityApplication/main.m +18 -0
- data/spec/support/resources/{files → source}/SecondViewController.h +0 -0
- data/spec/support/resources/{files → source}/SecondViewController.m +0 -0
- data/vendor.gemspec +0 -1
- metadata +254 -74
- data/LICENCE +0 -19
- data/lib/vendor/xcode/objects/pbx_build_file.rb +0 -9
- data/lib/vendor/xcode/objects/pbx_container_item_proxy.rb +0 -8
- data/lib/vendor/xcode/objects/pbx_file_reference.rb +0 -21
- data/lib/vendor/xcode/objects/pbx_frameworks_build_phase.rb +0 -9
- data/lib/vendor/xcode/objects/pbx_group.rb +0 -13
- data/lib/vendor/xcode/objects/pbx_resources_build_phase.rb +0 -7
- data/lib/vendor/xcode/objects/pbx_shell_script_build_phase.rb +0 -7
- data/lib/vendor/xcode/objects/pbx_sources_build_phase.rb +0 -9
- data/lib/vendor/xcode/objects/pbx_target_dependency.rb +0 -7
- data/lib/vendor/xcode/objects/pbx_variant_group.rb +0 -7
- data/lib/vendor/xcode/objects/xc_build_configuration.rb +0 -7
- data/lib/vendor/xcode/objects/xc_configuration_list.rb +0 -9
- data/spec/vendor/xcode/project_spec.rb +0 -211
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
data/Readme.markdown
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Vendor – an iOS library management system
|
|
2
2
|
|
|
3
|
+
[](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://
|
|
28
|
+
source "https://vendorforge.com"
|
|
27
29
|
|
|
30
|
+
# Downloads the latest version of DKBenchmark from
|
|
31
|
+
# http://vendorforge.com
|
|
28
32
|
lib "DKBenchmark"
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
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
|
|
95
|
+
$ vendor library init
|
|
58
96
|
```
|
|
59
97
|
|
|
60
|
-
|
|
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,
|
|
77
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
data/lib/vendor.rb
CHANGED
|
@@ -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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
data/lib/vendor/api.rb
CHANGED
|
@@ -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://
|
|
45
|
+
RestClient::Resource.new(ENV["API_URI"] || 'http://vendorforge.org', :user => user, :password => pass)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
end
|
data/lib/vendor/cli.rb
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
require "vendor/cli/auth"
|
|
2
|
-
|
|
3
1
|
module Vendor
|
|
4
2
|
|
|
5
3
|
module CLI
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|