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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Vendor::XCode::Proxy
|
|
2
|
+
|
|
3
|
+
class PBXFileReference < Vendor::XCode::Proxy::Base
|
|
4
|
+
|
|
5
|
+
reference :file_ref
|
|
6
|
+
|
|
7
|
+
def file?
|
|
8
|
+
true
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def full_path
|
|
12
|
+
parts = []
|
|
13
|
+
current = self
|
|
14
|
+
|
|
15
|
+
while current
|
|
16
|
+
parts.push current.path if current.respond_to?(:path) && !current.path.nil?
|
|
17
|
+
current = current.parent
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
parts.reverse.join("/")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.file_type_from_extension(extension)
|
|
24
|
+
case extension
|
|
25
|
+
when /.(png|jpg)/ then "image.#{$1}"
|
|
26
|
+
when ".h" then "sourcecode.c.h"
|
|
27
|
+
when ".m" then "sourcecode.c.objc"
|
|
28
|
+
when ".bundle" then "wrapper.plug-in"
|
|
29
|
+
when ".framework" then "wrapper.framework"
|
|
30
|
+
when ".a" then "archive.ar"
|
|
31
|
+
when ".strings" then "text.plist.strings"
|
|
32
|
+
when ".plist" then "text.plist.xml"
|
|
33
|
+
else "unknown"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Vendor::XCode::Proxy
|
|
2
|
+
|
|
3
|
+
class PBXGroup < Vendor::XCode::Proxy::Base
|
|
4
|
+
|
|
5
|
+
reference :children
|
|
6
|
+
|
|
7
|
+
def name
|
|
8
|
+
@attributes['name'] || @attributes['path']
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def full_path
|
|
12
|
+
parts = []
|
|
13
|
+
current = self
|
|
14
|
+
|
|
15
|
+
while current
|
|
16
|
+
parts.push current.name
|
|
17
|
+
current = current.parent
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
parts.reverse.compact.join("/")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def group?
|
|
24
|
+
true
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
def after_initialize
|
|
30
|
+
children.each { |child| child.parent = self }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
File without changes
|
|
@@ -43,7 +43,7 @@ describe Vendor::CLI::Auth do
|
|
|
43
43
|
it "should ask for their username and password" do
|
|
44
44
|
STDIN.should_receive(:gets).once.ordered.and_return "keithpitt"
|
|
45
45
|
STDIN.should_receive(:gets).once.ordered.and_return "password"
|
|
46
|
-
Vendor
|
|
46
|
+
Vendor.ui.should_receive(:warn).once
|
|
47
47
|
Vendor::CLI::Auth.should_receive(:printf).twice
|
|
48
48
|
|
|
49
49
|
Vendor::CLI::Auth.fetch_api_key.should == "secret"
|
|
@@ -5,7 +5,7 @@ describe Vendor::Config do
|
|
|
5
5
|
context "#directory" do
|
|
6
6
|
|
|
7
7
|
it "should return the development directory" do
|
|
8
|
-
Vendor::Config.directory.should == File.expand_path(File.join(
|
|
8
|
+
Vendor::Config.directory.should == File.expand_path(File.join(Vendor.root, "..", "tmp", "config"))
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Vendor::Template do
|
|
4
|
+
|
|
5
|
+
let(:template) { File.join(Vendor.root, "vendor", "templates", "Vendorfile") }
|
|
6
|
+
let(:target) { File.join(File.expand_path(Dir.pwd), "Vendorfile") }
|
|
7
|
+
let(:contents) { File.read(template) }
|
|
8
|
+
|
|
9
|
+
context "#copy" do
|
|
10
|
+
|
|
11
|
+
it "should write a file to the current directory" do
|
|
12
|
+
file = mock('file')
|
|
13
|
+
File.should_receive(:open).with(target, "w").and_yield(file)
|
|
14
|
+
file.should_receive(:write).with(contents)
|
|
15
|
+
|
|
16
|
+
Vendor::Template.copy "Vendorfile"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should not copy if the file already exists" do
|
|
20
|
+
File.should_receive(:exist?).with(target).and_return(true)
|
|
21
|
+
File.should_not_receive(:open)
|
|
22
|
+
|
|
23
|
+
Vendor::Template.copy "Vendorfile"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
context "#parse" do
|
|
29
|
+
|
|
30
|
+
it "should parse ERB" do
|
|
31
|
+
Vendor::Template.parse("This is <%= foo %>", :foo => "awesome!").should == "This is awesome!"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Vendor::VendorFile::Library::Base do
|
|
4
|
+
|
|
5
|
+
let(:lib) { Vendor::VendorFile::Library::Base.new(:name => "ExampleLib") }
|
|
6
|
+
|
|
7
|
+
let(:temp_path) { TempProject.create(File.join(PROJECT_RESOURCE_PATH, "UtilityApplication")) }
|
|
8
|
+
let(:project) { Vendor::XCode::Project.new(File.join(temp_path, "UtilityApplication.xcodeproj")) }
|
|
9
|
+
|
|
10
|
+
it "should have a name attribute" do
|
|
11
|
+
lib.name = "lib"
|
|
12
|
+
|
|
13
|
+
lib.name.should == "lib"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should have a target attribute" do
|
|
17
|
+
lib.targets = "Specs"
|
|
18
|
+
|
|
19
|
+
lib.targets.should == [ "Specs" ]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe "#install" do
|
|
23
|
+
|
|
24
|
+
context "with an existing installation" do
|
|
25
|
+
|
|
26
|
+
it "should remove the existing group from XCode"
|
|
27
|
+
|
|
28
|
+
it "should add the new files to the project"
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
context "with a fresh installation" do
|
|
33
|
+
|
|
34
|
+
it "should add the new files to the project"
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe "#cache_path" do
|
|
41
|
+
|
|
42
|
+
it "should return the location where the lib is to be stored" do
|
|
43
|
+
lib.cache_path.should == File.join(Vendor.library_path, "base", "ExampleLib")
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe "#files" do
|
|
49
|
+
|
|
50
|
+
let(:no_manifest_or_vendorspec) { Vendor::VendorFile::Library::Base.new(:name => "BingMapsIOS", :require => "MapControl") }
|
|
51
|
+
let(:with_manifest) { Vendor::VendorFile::Library::Base.new(:name => "DKBenchmark-Manifest") }
|
|
52
|
+
let(:with_vendorspec) { Vendor::VendorFile::Library::Base.new(:name => "DKBenchmark-Vendorspec") }
|
|
53
|
+
|
|
54
|
+
before :each do
|
|
55
|
+
Vendor.stub(:library_path).and_return CACHED_VENDOR_RESOURCE_PATH
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
context "with no manifest or vendorspec" do
|
|
59
|
+
|
|
60
|
+
let(:files) { no_manifest_or_vendorspec.files }
|
|
61
|
+
let(:names) { files.map { |file| File.basename(file) } }
|
|
62
|
+
|
|
63
|
+
it "should return the correct files" do
|
|
64
|
+
# This test is a little ugly, but meh, the Bing maps library has a good selection
|
|
65
|
+
# of file types to test (including a ".a" and a ".bundle")
|
|
66
|
+
["BingMaps.h", "BMEntity.h", "BMGeometry.h", "BMMapView.h", "BMMarker.h",
|
|
67
|
+
"BMMarkerView.h", "BMPushpinView.h", "BMReverseGeocoder.h", "BMTypes.h",
|
|
68
|
+
"BMUserLocation.h", "BingMaps.Resources.bundle", "libBingMaps.a"].each do |file|
|
|
69
|
+
names.should include(file)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it "should return files in the correct location" do
|
|
74
|
+
path = File.join(CACHED_VENDOR_RESOURCE_PATH, "base/BingMapsIOS/MapControl/")
|
|
75
|
+
regex_path = /^#{path}.+$/
|
|
76
|
+
|
|
77
|
+
files.each do |file|
|
|
78
|
+
file.should =~ regex_path
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
it "should return files that exist" do
|
|
83
|
+
files.each do |file|
|
|
84
|
+
File.exist?(file).should be_true
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
context "with a vendorspec" do
|
|
91
|
+
|
|
92
|
+
let(:files) { with_vendorspec.files }
|
|
93
|
+
let(:names) { files.map { |file| File.basename(file) } }
|
|
94
|
+
|
|
95
|
+
it "should return the correct files" do
|
|
96
|
+
["DKBenchmark.h", "DKBenchmark.m"].each do |file|
|
|
97
|
+
names.should include(file)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it "should return files in the correct location" do
|
|
102
|
+
path = File.join(CACHED_VENDOR_RESOURCE_PATH, "base/DKBenchmark-Vendorspec/")
|
|
103
|
+
regex_path = /^#{path}.+$/
|
|
104
|
+
|
|
105
|
+
files.each do |file|
|
|
106
|
+
file.should =~ regex_path
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
it "should return files that exist" do
|
|
111
|
+
files.each do |file|
|
|
112
|
+
File.exist?(file).should be_true
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
context "with a manifest" do
|
|
119
|
+
|
|
120
|
+
let(:files) { with_manifest.files }
|
|
121
|
+
let(:names) { files.map { |file| File.basename(file) } }
|
|
122
|
+
|
|
123
|
+
it "should return the correct files" do
|
|
124
|
+
["DKBenchmark.h", "DKBenchmark.m"].each do |file|
|
|
125
|
+
names.should include(file)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
it "should return files in the correct location" do
|
|
130
|
+
path = File.join(CACHED_VENDOR_RESOURCE_PATH, "base/DKBenchmark-Manifest/data/")
|
|
131
|
+
regex_path = /^#{path}.+$/
|
|
132
|
+
|
|
133
|
+
files.each do |file|
|
|
134
|
+
file.should =~ regex_path
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
it "should return files that exist" do
|
|
139
|
+
files.each do |file|
|
|
140
|
+
File.exist?(file).should be_true
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Vendor::VendorFile::Library::Git do
|
|
4
|
+
|
|
5
|
+
it "should default the tag to 'master'" do
|
|
6
|
+
lib = Vendor::VendorFile::Library::Git.new
|
|
7
|
+
|
|
8
|
+
lib.tag.should == "master"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "setting a branch should set the tag" do
|
|
12
|
+
lib = Vendor::VendorFile::Library::Git.new(:branch => "develop")
|
|
13
|
+
|
|
14
|
+
lib.tag.should == "develop"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "setting a ref should set the tag" do
|
|
18
|
+
lib = Vendor::VendorFile::Library::Git.new(:ref => "3g34g34")
|
|
19
|
+
|
|
20
|
+
lib.tag.should == "3g34g34"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe "#cache_path" do
|
|
24
|
+
|
|
25
|
+
it "should use a hash for the repo url, instead of the name of the lib" do
|
|
26
|
+
lib = Vendor::VendorFile::Library::Git.new(:git => "git@github.com:/foo/bar")
|
|
27
|
+
|
|
28
|
+
lib.cache_path.should == File.join(Vendor.library_path, "git", "a77462af23c7ce7d5599c5428e41a11b")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|