vendor 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,27 @@
1
+ ## 0.1.4 (January 13, 2012)
2
+
3
+ Features:
4
+
5
+ - Updated default Vendorfile
6
+ - Added support for files with .c extensions (@rauluranga)
7
+
8
+ Bug Fixes:
9
+
10
+ - Don't allow libraries with no vendor files
11
+ - Renamed vendorforge.org to vendorkit.com in various places
12
+
13
+ ## 0.1.2 (November 8, 2011)
14
+
15
+ Bug Fixes:
16
+
17
+ - When adding dylibs and framworks ensure they have the correct name
18
+
19
+ ## 0.1.2 (November 8, 2011)
20
+
21
+ Features:
22
+
23
+ - Added support for adding dylibs to the frameworks build phase
24
+
1
25
  ## 0.1.1 (November 8, 2011)
2
26
 
3
27
  Bug Fixes:
@@ -31,11 +31,11 @@ Specify your dependencies in a Vendors file in your project's root.
31
31
 
32
32
  ```ruby
33
33
  # Downloads the latest version of DKBenchmark from
34
- # http://vendorforge.com
34
+ # http://vendorkit.com
35
35
  lib "DKBenchmark"
36
36
 
37
37
  # Downloads version 0.5 of DKPredicateBuilder from
38
- # http://vendorforge.com
38
+ # http://vendorkit.com
39
39
  lib "DKPredicateBuilder", '0.5'
40
40
 
41
41
  # Include all the source files found in ~/Development/DKRest/Classes
@@ -45,7 +45,7 @@ lib "DKRest", :path => "~/Development/DKRest", :require => "Classes"
45
45
  # Checks out the git repo and includes all the files found in the
46
46
  # AFNetworking folder in the repo. The require option is handy for
47
47
  # repo's that haven't created vendor libraries and pushed them to
48
- # Vendorforge
48
+ # VendorKit.com
49
49
  lib "DKRest", :git => "git://github.com/gowalla/AFNetworking.git", :require => "AFNetworking"
50
50
 
51
51
  # The Vendorfile allows you to specify targets to add your libraries to.
@@ -137,40 +137,13 @@ vendor library by running:
137
137
  $ vendor library build my_library.vendorspec
138
138
  ```
139
139
 
140
- Now that you have a packaged library, you can push it to [http://vendorforge.org](http://vendorforge.org) by
140
+ Now that you have a packaged library, you can push it to [http://vendorkit.com](http://vendorkit.com) by
141
141
  running:
142
142
 
143
143
  ```bash
144
144
  $ vendor library push my_library.vendor
145
145
  ```
146
146
 
147
- ## What about CocoaPods?
148
-
149
- During the early days of Vendor development, another dependency/package
150
- manager called [CocoaPods](https://github.com/alloy/cocoapods) came on the seen. I had a look into the
151
- project, but there were a few things that I didn't quite like.
152
- I prefer all the source files for my dependencies to be stored in the project itself - not hidden in a static
153
- library. I tend to tweak and read through those libraries, so having
154
- the source readily available is handy. I also don't like the approach of requiring all the libraries to
155
- be commited to a centralized git repo (similar to [homebrew](https://github.com/mxcl/homebrew)).
156
- I think it puts alot of pressure on the maintainer to make sure that he reviews all the libs and that they're
157
- not doing anything smelly. It also fattens the git repo :D
158
-
159
- In saying that, trying to solve the problem of iOS dependency
160
- management, is tough, and a big shout out to anyone that tries to solve
161
- the problem. I should also mention another library that I admire that is
162
- also trying to solve this problem: [Kit](https://github.com/nkpart/kit)
163
-
164
- I wrote Vendor the way I think dependency management should be handled,
165
- and in a way that I like. Vendor can work with any lib, even if it
166
- doesn't have a compiled vendorspec - which I think is one of the
167
- strengths of Vendor.
168
-
169
- I also like the idea of a central site where people can upload their own
170
- libraries - just like Rubygems. There isn't much of an ecosystem
171
- around open source iOS/OSX development, just lots of isolated Github repos and blog posts. I hope
172
- Vendor can fix this.
173
-
174
147
  ## History
175
148
 
176
149
  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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -1,5 +1,6 @@
1
1
  # This is an example Vendorfile for you to start editing and add your
2
- # own dependencies. Check out http://github.com/keithpitt/vendor for
2
+ # own dependencies. Check out http://vendorkit.com/documentation for
3
3
  # more information on how to use this file.
4
4
 
5
- lib "DKBenchmark", "0.2"
5
+ # lib "ASIHTTPRequest", "~> 1.8"
6
+ # lib "JSONKit", "~> 1.4"
@@ -3,6 +3,8 @@ module Vendor
3
3
 
4
4
  class Builder
5
5
 
6
+ class NoFilesError < StandardError; end
7
+
6
8
  require 'fileutils'
7
9
  require 'tmpdir'
8
10
  require 'find'
@@ -44,10 +46,14 @@ module Vendor
44
46
  def copy_files(data_dir)
45
47
  data_files = []
46
48
 
49
+ raise NoFilesError.new("No file definition found for #{@name}") if @vendor_spec.files.nil?
50
+
47
51
  # Remove files that are within folders with a ".", such as ".bundle"
48
52
  # and ".frameworks"
49
53
  copy_files = @vendor_spec.files.reject { |file| file =~ /\/?[^\/]+\.[^\/]+\// }
50
54
 
55
+ raise NoFilesError.new("No files found for packaging") if copy_files.empty?
56
+
51
57
  copy_files.each do |file|
52
58
  dir = File.dirname(file)
53
59
  path = File.join(@folder, file)
@@ -443,7 +443,7 @@ module Vendor::XCode
443
443
  def build_phase_for_file(file_type, target)
444
444
  # Which build phase does this file belong?
445
445
  klass = case file_type
446
- when "sourcecode.c.objc"
446
+ when "sourcecode.c.objc", "sourcecode.c.c"
447
447
  Vendor::XCode::Proxy::PBXSourcesBuildPhase
448
448
  when "wrapper.framework"
449
449
  Vendor::XCode::Proxy::PBXFrameworksBuildPhase
@@ -25,6 +25,7 @@ module Vendor::XCode::Proxy
25
25
  when /.(png|jpg)/ then "image.#{$1}"
26
26
  when ".h" then "sourcecode.c.h"
27
27
  when ".m" then "sourcecode.c.objc"
28
+ when ".c" then "sourcecode.c.c"
28
29
  when ".bundle" then "wrapper.plug-in"
29
30
  when ".framework" then "wrapper.framework"
30
31
  when ".a" then "archive.ar"
@@ -52,33 +52,49 @@ describe Vendor::VendorSpec::Builder do
52
52
 
53
53
  context "#build" do
54
54
 
55
- let (:builder) { Vendor::VendorSpec::Builder.new(File.join(VENDOR_RESOURCE_PATH, "DKBenchmark", "DKBenchmark.vendorspec")) }
55
+ context "with a valid vendor spec" do
56
56
 
57
- before :all do
58
- builder.build
59
- end
57
+ let (:builder) { Vendor::VendorSpec::Builder.new(File.join(VENDOR_RESOURCE_PATH, "DKBenchmark", "DKBenchmark.vendorspec")) }
60
58
 
61
- it "should create the .vendor file" do
62
- File.exist?(builder.filename).should be_true
63
- end
59
+ before :all do
60
+ builder.build
61
+ end
64
62
 
65
- it "should be a zip file" do
66
- mimetype = `file #{builder.filename} --mime-type`.chomp
63
+ it "should create the .vendor file" do
64
+ File.exist?(builder.filename).should be_true
65
+ end
67
66
 
68
- mimetype.should =~ /application\/zip/
69
- end
67
+ it "should be a zip file" do
68
+ mimetype = `file #{builder.filename} --mime-type`.chomp
70
69
 
71
- it "should contain a vendor.json file" do
72
- Zip::ZipFile.open(builder.filename) do |zipfile|
73
- zipfile.file.read("vendor.json").should == builder.vendor_spec.to_json
70
+ mimetype.should =~ /application\/zip/
74
71
  end
72
+
73
+ it "should contain a vendor.json file" do
74
+ Zip::ZipFile.open(builder.filename) do |zipfile|
75
+ zipfile.file.read("vendor.json").should == builder.vendor_spec.to_json
76
+ end
77
+ end
78
+
79
+ it "should contain the files contained in the vendor spec" do
80
+ Zip::ZipFile.open(builder.filename) do |zipfile|
81
+ zipfile.file.read("data/DKBenchmark.h") =~ /DKBenchmark\.h/
82
+ zipfile.file.read("data/DKBenchmark.m") =~ /DKBenchmark\.m/
83
+ end
84
+ end
85
+
75
86
  end
76
87
 
77
- it "should contain the files contained in the vendor spec" do
78
- Zip::ZipFile.open(builder.filename) do |zipfile|
79
- zipfile.file.read("data/DKBenchmark.h") =~ /DKBenchmark\.h/
80
- zipfile.file.read("data/DKBenchmark.m") =~ /DKBenchmark\.m/
88
+ context "with no files" do
89
+
90
+ let (:builder) { Vendor::VendorSpec::Builder.new(File.join(VENDOR_RESOURCE_PATH, "EmptyVendor", "EmptyVendor.vendorspec")) }
91
+
92
+ it "should not allow you to build" do
93
+ expect do
94
+ builder.build
95
+ end.should raise_error(Vendor::VendorSpec::Builder::NoFilesError, "No files found for packaging")
81
96
  end
97
+
82
98
  end
83
99
 
84
100
  end
@@ -6,6 +6,7 @@ describe Vendor::XCode::Proxy::PBXFileReference do
6
6
 
7
7
  { ".h" => "sourcecode.c.h",
8
8
  ".m" => "sourcecode.c.objc",
9
+ ".c" => "sourcecode.c.c",
9
10
  ".bundle" => "wrapper.plug-in",
10
11
  ".framework" => "wrapper.framework",
11
12
  ".a" => "archive.ar",
@@ -0,0 +1,12 @@
1
+ Vendor::Spec.new do |s|
2
+
3
+ s.name "EmptyVendor"
4
+ s.version "0.1"
5
+
6
+ s.authors "keithpitt"
7
+ s.email "me@keithpitt.com"
8
+ s.description "Blah"
9
+
10
+ s.files [ ]
11
+
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vendor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-10 00:00:00.000000000Z
12
+ date: 2012-01-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70207634134280 !ruby/object:Gem::Requirement
16
+ requirement: &70321378681860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70207634134280
24
+ version_requirements: *70321378681860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard
27
- requirement: &70207634133580 !ruby/object:Gem::Requirement
27
+ requirement: &70321378672060 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70207634133580
35
+ version_requirements: *70321378672060
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: guard-rspec
38
- requirement: &70207634132860 !ruby/object:Gem::Requirement
38
+ requirement: &70321378671240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70207634132860
46
+ version_requirements: *70321378671240
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: fakeweb
49
- requirement: &70207634132220 !ruby/object:Gem::Requirement
49
+ requirement: &70321378670780 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70207634132220
57
+ version_requirements: *70321378670780
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: growl
60
- requirement: &70207634131640 !ruby/object:Gem::Requirement
60
+ requirement: &70321378670060 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70207634131640
68
+ version_requirements: *70321378670060
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ripl
71
- requirement: &70207634131160 !ruby/object:Gem::Requirement
71
+ requirement: &70321378669140 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70207634131160
79
+ version_requirements: *70321378669140
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rake
82
- requirement: &70207634130680 !ruby/object:Gem::Requirement
82
+ requirement: &70321378667000 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70207634130680
90
+ version_requirements: *70321378667000
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: json
93
- requirement: &70207634130080 !ruby/object:Gem::Requirement
93
+ requirement: &70321378665360 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70207634130080
101
+ version_requirements: *70321378665360
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: thor
104
- requirement: &70207634129500 !ruby/object:Gem::Requirement
104
+ requirement: &70321378664500 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70207634129500
112
+ version_requirements: *70321378664500
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rubyzip
115
- requirement: &70207634128920 !ruby/object:Gem::Requirement
115
+ requirement: &70321378663160 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *70207634128920
123
+ version_requirements: *70321378663160
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: rest-client
126
- requirement: &70207634128320 !ruby/object:Gem::Requirement
126
+ requirement: &70321378661440 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *70207634128320
134
+ version_requirements: *70321378661440
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: highline
137
- requirement: &70207634127900 !ruby/object:Gem::Requirement
137
+ requirement: &70321378660300 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,7 +142,7 @@ dependencies:
142
142
  version: '0'
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *70207634127900
145
+ version_requirements: *70321378660300
146
146
  description: Vendor manages an application's dependencies
147
147
  email:
148
148
  - me@keithpitt.com
@@ -331,6 +331,7 @@ files:
331
331
  - spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.h
332
332
  - spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.m
333
333
  - spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.vendorspec
334
+ - spec/support/resources/vendors/EmptyVendor/EmptyVendor.vendorspec
334
335
  - spec/support/temp_project.rb
335
336
  - vendor.gemspec
336
337
  homepage: http://www.vendorforge.org
@@ -476,4 +477,5 @@ test_files:
476
477
  - spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.h
477
478
  - spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.m
478
479
  - spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.vendorspec
480
+ - spec/support/resources/vendors/EmptyVendor/EmptyVendor.vendorspec
479
481
  - spec/support/temp_project.rb