vendor 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vendor (0.0.1)
4
+ vendor (0.0.2)
5
5
  json
6
6
  rake
7
7
  rest-client
data/Readme.markdown CHANGED
@@ -125,16 +125,17 @@ running:
125
125
  $ vendor library publish my_library.vendor
126
126
  ```
127
127
 
128
- ## Why not CocoaPods?
128
+ ## What about CocoaPods?
129
129
 
130
130
  During the early days of Vendor development, another dependency/package
131
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)).
132
+ project, but there were a few things that I didn't quite like.
133
+ I prefer all the source files for my dependencies to be stored in the project itself - not hidden in a static
134
+ library. I tend to tweak and read through those libraries, so having
135
+ the source readily available is handy. I also don't like the approach of requiring all the libraries to
136
+ be commited to a centralized git repo (similar to [homebrew](https://github.com/mxcl/homebrew)).
136
137
  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
+ not doing anything smelly. It also fattens the git repo :D
138
139
 
139
140
  In saying that, trying to solve the problem of iOS dependency
140
141
  management, is tough, and a big shout out to anyone that tries to solve
@@ -148,7 +149,7 @@ strengths of Vendor.
148
149
 
149
150
  I also like the idea of a central site where people can upload their own
150
151
  libraries - just like Rubygems. There isn't much of an ecosystem
151
- around iOS development, just lots of isolated Github repos. I hope
152
+ around open source iOS/OSX development, just lots of isolated Github repos and blog posts. I hope
152
153
  Vendor can fix this.
153
154
 
154
155
  ## History
@@ -11,7 +11,7 @@ module Vendor
11
11
  attr_accessor :require
12
12
 
13
13
  def initialize(attributes = {})
14
- @source_tree = :relative
14
+ @source_tree = :group
15
15
  attributes.each { |k, v| self.send("#{k}=", v) }
16
16
  end
17
17
 
@@ -1,5 +1,5 @@
1
1
  module Vendor
2
2
 
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
 
5
5
  end
@@ -81,6 +81,9 @@ module Vendor::XCode
81
81
  :id => Vendor::XCode::Proxy::Base.generate_id,
82
82
  :attributes => { 'path' => name, 'sourceTree' => '<group>', 'children' => [] })
83
83
 
84
+ # Set the parent
85
+ group.parent = current
86
+
84
87
  @objects_by_id[group.id] = group
85
88
 
86
89
  # This is hacky
@@ -183,6 +186,9 @@ module Vendor::XCode
183
186
  :id => Vendor::XCode::Proxy::Base.generate_id,
184
187
  :attributes => attributes)
185
188
 
189
+ # Set the parent
190
+ file.parent = group
191
+
186
192
  # Add the file id to the groups children
187
193
  group.attributes['children'] << file.id
188
194
 
@@ -7,6 +7,10 @@ describe Vendor::VendorFile::Library::Base do
7
7
  let(:temp_path) { TempProject.create(File.join(PROJECT_RESOURCE_PATH, "UtilityApplication")) }
8
8
  let(:project) { Vendor::XCode::Project.new(File.join(temp_path, "UtilityApplication.xcodeproj")) }
9
9
 
10
+ let(:lib_with_no_manifest_or_vendorspec) { Vendor::VendorFile::Library::Base.new(:name => "BingMapsIOS", :require => "MapControl") }
11
+ let(:lib_with_manifest) { Vendor::VendorFile::Library::Base.new(:name => "DKBenchmark-Manifest") }
12
+ let(:lib_with_vendorspec) { Vendor::VendorFile::Library::Base.new(:name => "DKBenchmark-Vendorspec") }
13
+
10
14
  it "should have a name attribute" do
11
15
  lib.name = "lib"
12
16
 
@@ -21,17 +25,42 @@ describe Vendor::VendorFile::Library::Base do
21
25
 
22
26
  describe "#install" do
23
27
 
28
+ before :each do
29
+ Vendor.stub(:library_path).and_return CACHED_VENDOR_RESOURCE_PATH
30
+
31
+ lib_with_manifest.install project
32
+ end
33
+
24
34
  context "with an existing installation" do
25
35
 
26
- it "should remove the existing group from XCode"
36
+ before :each do
37
+ # Install it again
38
+ lib_with_manifest.install project
39
+ end
40
+
41
+ it "should add the group to the project" do
42
+ group = project.find_group("Vendor/DKBenchmark-Manifest")
43
+ group.should_not be_nil
44
+ end
27
45
 
28
- it "should add the new files to the project"
46
+ it "should add the files to the project" do
47
+ children = project.find_group("Vendor/DKBenchmark-Manifest").children
48
+ children.length.should == 2
49
+ end
29
50
 
30
51
  end
31
52
 
32
53
  context "with a fresh installation" do
33
54
 
34
- it "should add the new files to the project"
55
+ it "should add the group to the project" do
56
+ group = project.find_group("Vendor/DKBenchmark-Manifest")
57
+ group.should_not be_nil
58
+ end
59
+
60
+ it "should add the files to the project" do
61
+ children = project.find_group("Vendor/DKBenchmark-Manifest").children
62
+ children.length.should == 2
63
+ end
35
64
 
36
65
  end
37
66
 
@@ -47,17 +76,13 @@ describe Vendor::VendorFile::Library::Base do
47
76
 
48
77
  describe "#files" do
49
78
 
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
79
  before :each do
55
80
  Vendor.stub(:library_path).and_return CACHED_VENDOR_RESOURCE_PATH
56
81
  end
57
82
 
58
83
  context "with no manifest or vendorspec" do
59
84
 
60
- let(:files) { no_manifest_or_vendorspec.files }
85
+ let(:files) { lib_with_no_manifest_or_vendorspec.files }
61
86
  let(:names) { files.map { |file| File.basename(file) } }
62
87
 
63
88
  it "should return the correct files" do
@@ -89,7 +114,7 @@ describe Vendor::VendorFile::Library::Base do
89
114
 
90
115
  context "with a vendorspec" do
91
116
 
92
- let(:files) { with_vendorspec.files }
117
+ let(:files) { lib_with_vendorspec.files }
93
118
  let(:names) { files.map { |file| File.basename(file) } }
94
119
 
95
120
  it "should return the correct files" do
@@ -117,7 +142,7 @@ describe Vendor::VendorFile::Library::Base do
117
142
 
118
143
  context "with a manifest" do
119
144
 
120
- let(:files) { with_manifest.files }
145
+ let(:files) { lib_with_manifest.files }
121
146
  let(:names) { files.map { |file| File.basename(file) } }
122
147
 
123
148
  it "should return the correct files" do
@@ -139,6 +139,10 @@ describe Vendor::XCode::Project do
139
139
  @here_group.isa.should == 'PBXGroup'
140
140
  end
141
141
 
142
+ it "should set the parent" do
143
+ @here_group.parent.should == @inside_group
144
+ end
145
+
142
146
  end
143
147
 
144
148
  end
@@ -268,6 +272,10 @@ describe Vendor::XCode::Project do
268
272
  group.children[1].should == @second_file_added
269
273
  end
270
274
 
275
+ it "should set the parent" do
276
+ @first_file_added.parent.should == @temp_project.find_group("Controllers/SecondViewController")
277
+ end
278
+
271
279
  it 'should still save' do
272
280
  @temp_project.save
273
281
  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.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70151953911140 !ruby/object:Gem::Requirement
16
+ requirement: &70306350501080 !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: *70151953911140
24
+ version_requirements: *70306350501080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fakeweb
27
- requirement: &70151953910260 !ruby/object:Gem::Requirement
27
+ requirement: &70306350500220 !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: *70151953910260
35
+ version_requirements: *70306350500220
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ripl
38
- requirement: &70151953908840 !ruby/object:Gem::Requirement
38
+ requirement: &70306350498880 !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: :runtime
45
45
  prerelease: false
46
- version_requirements: *70151953908840
46
+ version_requirements: *70306350498880
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70151953906920 !ruby/object:Gem::Requirement
49
+ requirement: &70306350496500 !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: :runtime
56
56
  prerelease: false
57
- version_requirements: *70151953906920
57
+ version_requirements: *70306350496500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: json
60
- requirement: &70151953906000 !ruby/object:Gem::Requirement
60
+ requirement: &70306350495200 !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: :runtime
67
67
  prerelease: false
68
- version_requirements: *70151953906000
68
+ version_requirements: *70306350495200
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
- requirement: &70151953905220 !ruby/object:Gem::Requirement
71
+ requirement: &70306350494060 !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: *70151953905220
79
+ version_requirements: *70306350494060
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rubyzip
82
- requirement: &70151953903980 !ruby/object:Gem::Requirement
82
+ requirement: &70306350491180 !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: *70151953903980
90
+ version_requirements: *70306350491180
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rest-client
93
- requirement: &70151953903100 !ruby/object:Gem::Requirement
93
+ requirement: &70306350490260 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70151953903100
101
+ version_requirements: *70306350490260
102
102
  description: Vendor manages an application's dependencies
103
103
  email:
104
104
  - me@keithpitt.com