vendor 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ ## 0.1.5 (January 27, 2012)
2
+
3
+ Bug Fixes:
4
+
5
+ - Improvements to the Plist converter
6
+ - Fixes for projects that have Aggregate Targets
7
+ - Use the correct PList converter on OSX
8
+
1
9
  ## 0.1.4 (January 13, 2012)
2
10
 
3
11
  Features:
data/Gemfile CHANGED
@@ -4,5 +4,5 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  # For testing
7
- gem 'ruby-debug', :platforms => :ruby_18
8
- gem 'ruby-debug19', :platforms => :ruby_19
7
+ # gem 'ruby-debug', :platforms => :ruby_18
8
+ # gem 'ruby-debug19', :platforms => :ruby_19
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vendor (0.1.3)
4
+ vendor (0.1.5)
5
5
  highline
6
6
  json
7
7
  rake
@@ -13,9 +13,7 @@ PATH
13
13
  GEM
14
14
  remote: http://rubygems.org/
15
15
  specs:
16
- archive-tar-minitar (0.5.2)
17
16
  bond (0.4.1)
18
- columnize (0.3.4)
19
17
  diff-lcs (1.1.2)
20
18
  fakeweb (1.3.0)
21
19
  growl (1.0.3)
@@ -24,14 +22,9 @@ GEM
24
22
  guard-rspec (0.5.0)
25
23
  guard (>= 0.8.4)
26
24
  highline (1.6.2)
27
- json (1.6.1)
28
- linecache (0.46)
29
- rbx-require-relative (> 0.0.4)
30
- linecache19 (0.5.12)
31
- ruby_core_source (>= 0.1.4)
25
+ json (1.6.5)
32
26
  mime-types (1.17.2)
33
27
  rake (0.9.2.2)
34
- rbx-require-relative (0.0.5)
35
28
  rest-client (1.6.7)
36
29
  mime-types (>= 1.16)
37
30
  ripl (0.5.1)
@@ -44,21 +37,6 @@ GEM
44
37
  rspec-expectations (2.6.0)
45
38
  diff-lcs (~> 1.1.2)
46
39
  rspec-mocks (2.6.0)
47
- ruby-debug (0.10.4)
48
- columnize (>= 0.1)
49
- ruby-debug-base (~> 0.10.4.0)
50
- ruby-debug-base (0.10.4)
51
- linecache (>= 0.3)
52
- ruby-debug-base19 (0.11.25)
53
- columnize (>= 0.3.1)
54
- linecache19 (>= 0.5.11)
55
- ruby_core_source (>= 0.1.4)
56
- ruby-debug19 (0.11.6)
57
- columnize (>= 0.3.1)
58
- linecache19 (>= 0.5.11)
59
- ruby-debug-base19 (>= 0.11.19)
60
- ruby_core_source (0.1.5)
61
- archive-tar-minitar (>= 0.5.2)
62
40
  rubyzip (0.9.4)
63
41
  thor (0.14.6)
64
42
 
@@ -71,6 +49,4 @@ DEPENDENCIES
71
49
  guard
72
50
  guard-rspec
73
51
  rspec
74
- ruby-debug
75
- ruby-debug19
76
52
  vendor!
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -11,7 +11,7 @@ module Vendor
11
11
  class Error < StandardError; end
12
12
 
13
13
  def api_uri
14
- ENV["API_URI"] || 'http://vendorforge.org'
14
+ ENV["API_URI"] || 'http://vendorkit.com'
15
15
  end
16
16
 
17
17
  def api_key(username, password)
@@ -35,7 +35,7 @@ module Vendor
35
35
  end
36
36
  end
37
37
 
38
- desc "library push VENDOR_FILE", "Push a vendor package to vendorforge.org"
38
+ desc "library push VENDOR_FILE", "Push a vendor package to vendorkit.com"
39
39
  def push(file)
40
40
  begin
41
41
  Vendor::CLI::Auth.with_api_key do |api_key|
@@ -105,7 +105,7 @@ module Vendor
105
105
  Vendor::Template.copy "Vendorfile"
106
106
  end
107
107
 
108
- desc "auth", "Login to your vendorforge.org account"
108
+ desc "auth", "Login to your vendorkit.com account"
109
109
  def auth
110
110
  begin
111
111
  Vendor::CLI::Auth.with_api_key do |api_key|
@@ -17,7 +17,7 @@ module Vendor
17
17
  end
18
18
 
19
19
  def fetch_api_key
20
- Vendor.ui.warn "Please enter your vendorforge.org login and password"
20
+ Vendor.ui.warn "Please enter your vendorkit.com login and password"
21
21
 
22
22
  username = ask("Login: ")
23
23
  password = ask("Password: ") { |q| q.echo = false }
@@ -4,7 +4,14 @@ class String
4
4
  if length == 0
5
5
  "\"\""
6
6
  else
7
- match(/\-|\s|\+|\<|\$|\"|\[|\=|\*|@/) ? self.inspect : self
7
+ # This is really fucking ugly. So the thing is, I hae no idea what
8
+ # triggers quotes around string values in an ascii plist. If
9
+ # anyone knows how, please let me know. I can't just put quotes
10
+ # around everything, because for some reason, it doesn't work. So
11
+ # as I find characters that seem to trigger quotes, I drop them in
12
+ # here. Yes, this isn't a sustainable solution, but it works for
13
+ # now.
14
+ match(/\-|\s|\+|\<|\$|\"|\[|\=|\*|@|\,|\./) ? self.inspect : self
8
15
  end
9
16
  end
10
17
 
@@ -3,7 +3,7 @@ module Vendor
3
3
 
4
4
  class Source
5
5
 
6
- MAPPING = { :vendorforge => "http://vendorforge.com" }
6
+ MAPPING = { :vendorforge => "http://vendorkit.com", :vendorkit => "http://vendorkit.com" }
7
7
 
8
8
  attr_accessor :uri
9
9
 
@@ -34,7 +34,7 @@ module Vendor::XCode
34
34
  # because the custom implementation isn't very reliable. We use it mainly
35
35
  # so the gem can run on systems that don't have plutil installed (like our
36
36
  # CI server). The plutil app is far more reliable.
37
- if RUBY_PLATFORM !=~ /darwin/ || ENV['PARSER'] == 'custom'
37
+ if RUBY_PLATFORM !~ /darwin/ || ENV['PARSER'] == 'custom'
38
38
  contents = File.readlines(@pbxproject).join("\n")
39
39
  parsed = Vendor::Plist.parse_ascii(contents)
40
40
  else
@@ -47,7 +47,11 @@ module Vendor::XCode
47
47
  @objects_by_id = {}
48
48
 
49
49
  @objects = parsed['objects'].map do |id, attributes|
50
- klass = Vendor::XCode::Proxy.const_get(attributes['isa'])
50
+ begin
51
+ klass = Vendor::XCode::Proxy.const_get(attributes['isa'])
52
+ rescue NameError => e
53
+ klass = Vendor::XCode::Proxy::Unknown
54
+ end
51
55
 
52
56
  @objects_by_id[id] = klass.new(:project => self, :id => id, :attributes => attributes)
53
57
  end
@@ -163,8 +167,10 @@ module Vendor::XCode
163
167
  end
164
168
 
165
169
  def add_framework(framework, options = {})
166
- # Find targets
167
- targets = targets_from_options(options)
170
+ # Find targets and filter out aggregate targets (we can't add files to
171
+ # those bad boys)
172
+ targets = targets_from_options(options, :ignore_aggregates => true)
173
+
168
174
  Vendor.ui.debug %{Adding #{framework} to targets "#{targets.map(&:name)}"}
169
175
 
170
176
  path = if framework.match(/\.dylib/)
@@ -262,8 +268,9 @@ module Vendor::XCode
262
268
  raise StandardError.new("Could not find file `#{options[:file]}`") unless File.exists?(options[:file])
263
269
  end
264
270
 
265
- # Find targets
266
- targets = targets_from_options(options)
271
+ # Find targets and filter out aggregate targets (we can't add files to
272
+ # those bad boys)
273
+ targets = targets_from_options(options, :ignore_aggregates => true)
267
274
 
268
275
  # Create the group
269
276
  group = create_group(options[:path])
@@ -433,6 +440,7 @@ module Vendor::XCode
433
440
  rescue Vendor::Plist::AsciiParser::ParseError => e
434
441
  Vendor.ui.error "There was an error converting the XCode project back to a Plist"
435
442
  Vendor.ui.error e.inspect
443
+ Vendor.ui.debug to_ascii_plist
436
444
 
437
445
  false
438
446
  end
@@ -468,8 +476,8 @@ module Vendor::XCode
468
476
  keys.each { |k| raise StandardError.new("Missing :#{k} option") unless options[k] }
469
477
  end
470
478
 
471
- def targets_from_options(options)
472
- if options[:targets]
479
+ def targets_from_options(options, opts = {})
480
+ targets = if options[:targets]
473
481
  [ *options[:targets] ].map do |t|
474
482
  if t == :all
475
483
  root_object.targets
@@ -482,6 +490,12 @@ module Vendor::XCode
482
490
  else
483
491
  root_object.targets
484
492
  end
493
+
494
+ if opts[:ignore_aggregates]
495
+ targets.reject { |t| t.kind_of? Vendor::XCode::Proxy::PBXAggregateTarget }
496
+ else
497
+ targets
498
+ end
485
499
  end
486
500
 
487
501
  end
@@ -5,6 +5,7 @@ module Vendor
5
5
  module Proxy
6
6
 
7
7
  autoload :Base, "vendor/xcode/proxy/base"
8
+ autoload :PBXAggregateTarget, "vendor/xcode/proxy/pbx_aggregate_target"
8
9
  autoload :PBXProject, "vendor/xcode/proxy/pbx_project"
9
10
  autoload :PBXFileReference, "vendor/xcode/proxy/pbx_file_reference"
10
11
  autoload :PBXGroup, "vendor/xcode/proxy/pbx_group"
@@ -21,6 +22,7 @@ module Vendor
21
22
  autoload :XCBuildConfiguration, "vendor/xcode/proxy/xc_build_configuration"
22
23
  autoload :XCConfigurationList, "vendor/xcode/proxy/xc_configuration_list"
23
24
  autoload :XCVersionGroup, "vendor/xcode/proxy/xc_version_group"
25
+ autoload :Unknown, "vendor/xcode/proxy/unknown"
24
26
 
25
27
  end
26
28
 
@@ -0,0 +1,11 @@
1
+ module Vendor::XCode::Proxy
2
+
3
+ class PBXAggregateTarget < Vendor::XCode::Proxy::Base
4
+
5
+ reference :build_phases
6
+ reference :dependencies
7
+ reference :build_configuration_list
8
+
9
+ end
10
+
11
+ end
@@ -0,0 +1,8 @@
1
+ module Vendor::XCode::Proxy
2
+
3
+ # This is a wrapper for any object that I haven't already covered
4
+ class Unknown < Vendor::XCode::Proxy::Base
5
+
6
+ end
7
+
8
+ end
@@ -22,7 +22,7 @@ describe Vendor::VendorFile::Loader do
22
22
  end
23
23
 
24
24
  it "should load all the sources" do
25
- @sources.map(&:uri).should == [ "http://vendorforge.com", "http://vendorage.com" ]
25
+ @sources.map(&:uri).should == [ "http://vendorkit.com", "http://vendorage.com" ]
26
26
  end
27
27
 
28
28
  it "should load all the libraries" do
@@ -11,7 +11,7 @@ describe Vendor::VendorFile::Source do
11
11
  it "should allow you to set a uri via a symbol" do
12
12
  source = Vendor::VendorFile::Source.new(:vendorforge)
13
13
 
14
- source.uri.should == "http://vendorforge.com"
14
+ source.uri.should == "http://vendorkit.com"
15
15
  end
16
16
 
17
17
  end
@@ -11,7 +11,7 @@ describe Vendor::XCode::Project do
11
11
  context "ProjectWithSpecs.xcodeproj" do
12
12
 
13
13
  it "should load all the objects" do
14
- @project.objects.length.should == 48
14
+ @project.objects.length.should == 52
15
15
  end
16
16
 
17
17
  it "should load the object version" do
@@ -52,6 +52,23 @@ describe Vendor::XCode::Project do
52
52
 
53
53
  end
54
54
 
55
+ context "other projects in the ProjectsToTestParsing folder" do
56
+
57
+ projects = Dir[File.join(PROJECT_RESOURCE_PATH, "ProjectsToTestParsing/*.xcodeproj")]
58
+
59
+ projects.each do |p|
60
+ it "should correctly load and save '#{p}'" do
61
+ project = Vendor::XCode::Project.new(p)
62
+ contents = File.readlines(File.join(p, "project.pbxproj")).join("\n")
63
+ original = Vendor::Plist.parse_ascii(contents)
64
+ saved = Vendor::Plist.parse_ascii(project.to_ascii_plist)
65
+
66
+ original.should == saved
67
+ end
68
+ end
69
+
70
+ end
71
+
55
72
  end
56
73
 
57
74
  context "#name" do
@@ -244,7 +261,7 @@ describe Vendor::XCode::Project do
244
261
  :path => "Frameworks", :name => "KeithPitt.framework",
245
262
  :source_tree => :sdkroot })
246
263
 
247
- @temp_project.add_framework "KeithPitt.framework", :targets => "Integration"
264
+ @temp_project.add_framework "KeithPitt.framework", :targets => [ "Integration", "AggregateTarget" ]
248
265
  end
249
266
 
250
267
  it "should add the dylibs to the right targets" do
@@ -563,7 +580,7 @@ describe Vendor::XCode::Project do
563
580
  end
564
581
 
565
582
  it "should raise an error if there is an invalid format" do
566
- @project.should_receive(:to_ascii_plist).and_return { "asd; { f5him" }
583
+ @project.should_receive(:to_ascii_plist).twice.and_return { "asd; { f5him" }
567
584
 
568
585
  @project.valid?.should be_false
569
586
  end
@@ -20,7 +20,10 @@ describe Vendor::XCode::Proxy::PBXProject do
20
20
  end
21
21
 
22
22
  it "should reference the targets" do
23
- @pbx_project.targets.should == [ @project.find_object("5378749E14010A0A00D9B746") ]
23
+ @pbx_project.targets.should == [
24
+ @project.find_object("5378749E14010A0A00D9B746"),
25
+ @project.find_object("53BD73C714D0AF9A00E30313")
26
+ ]
24
27
  end
25
28
 
26
29
  end
@@ -24,47 +24,47 @@ VENDOR_JSON[:LibWithError] = { :name => "LibWithError",
24
24
  :versions => [ [ "0.1", { :dependencies => [ ] } ] ]
25
25
  }
26
26
 
27
- FakeWeb.register_uri :get, "http://keithpitt:password@vendorforge.org/users/keithpitt/api_key.json",
27
+ FakeWeb.register_uri :get, "http://keithpitt:password@vendorkit.com/users/keithpitt/api_key.json",
28
28
  :body => { :api_key => "secret" }.to_json
29
29
 
30
- FakeWeb.register_uri :get, "http://keithpitt:wrong@vendorforge.org/users/keithpitt/api_key.json",
30
+ FakeWeb.register_uri :get, "http://keithpitt:wrong@vendorkit.com/users/keithpitt/api_key.json",
31
31
  :status => 401
32
32
 
33
- FakeWeb.register_uri :get, "http://keithpitt:error@vendorforge.org/users/keithpitt/api_key.json",
33
+ FakeWeb.register_uri :get, "http://keithpitt:error@vendorkit.com/users/keithpitt/api_key.json",
34
34
  :status => 500
35
35
 
36
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DKBenchmark.json",
36
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DKBenchmark.json",
37
37
  :body => VENDOR_JSON[:DKBenchmark].to_json
38
38
 
39
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DKBenchmark-With-Some-Crazy-Number-Name-.json",
39
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DKBenchmark-With-Some-Crazy-Number-Name-.json",
40
40
  :body => VENDOR_JSON[:DKBenchmarkCrazyName].to_json
41
41
 
42
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/WithAnError.json",
42
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/WithAnError.json",
43
43
  :status => 500
44
44
 
45
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DoesNotExist.json",
45
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DoesNotExist.json",
46
46
  :status => 404
47
47
 
48
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DKBenchmark/versions/0.1/download",
48
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DKBenchmark/versions/0.1/download",
49
49
  :body => File.read(File.join(PACKAGED_VENDOR_PATH, "DKBenchmark-0.1.vendor"))
50
50
 
51
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DKBenchmark/versions/0.2/download",
51
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DKBenchmark/versions/0.2/download",
52
52
  :body => File.read(File.join(PACKAGED_VENDOR_PATH, "DKBenchmark-0.1.vendor"))
53
53
 
54
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/LibWithError.json",
54
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/LibWithError.json",
55
55
  :body => VENDOR_JSON[:LibWithError].to_json
56
56
 
57
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/LibWithError/versions/0.1/download",
57
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/LibWithError/versions/0.1/download",
58
58
  :status => 500
59
59
 
60
60
  ###
61
61
  # DEPENDENCY CALLS
62
62
  ###
63
63
 
64
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DKRest.json",
64
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DKRest.json",
65
65
  :body => %{{"name":"DKRest","description":"Classes that make it easy to work with REST Services","release":"0.1","versions":[["0.1",{"dependencies":[["DKAPIRequest","0.1"],["DKCoreData","0.1"],["DKFile","0.1"],["DKPredicateBuilder","0.1"],["DKSupport","0.1"]]}]]}}
66
66
 
67
- FakeWeb.register_uri :get, "http://vendorforge.org/vendors/DKCoreData.json",
67
+ FakeWeb.register_uri :get, "http://vendorkit.com/vendors/DKCoreData.json",
68
68
  :body => %{{"name":"DKCoreData","description":"A set of classes that make it easy to work with the Core Data framework on iOS and OSX","release":"0.1","versions":[["1.5.2",{"dependencies":[["DKFile","0.1"],["DKPredicateBuilder","0.1"],["DKSupport","0.1"]]}]]}}
69
69
 
70
70
  FakeWeb.allow_net_connect = false
@@ -6,6 +6,19 @@
6
6
  objectVersion = 46;
7
7
  objects = {
8
8
 
9
+ /* Begin PBXAggregateTarget section */
10
+ 53A7DCC114D0B3AE00A4FE42 /* AggregateTarget */ = {
11
+ isa = PBXAggregateTarget;
12
+ buildConfigurationList = 53A7DCC414D0B3AE00A4FE42 /* Build configuration list for PBXAggregateTarget "AggregateTarget" */;
13
+ buildPhases = (
14
+ );
15
+ dependencies = (
16
+ );
17
+ name = AggregateTarget;
18
+ productName = AggregateTarget;
19
+ };
20
+ /* End PBXAggregateTarget section */
21
+
9
22
  /* Begin PBXBuildFile section */
10
23
  53F42B5E14667527006B8F7C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53F42B5D14667527006B8F7C /* UIKit.framework */; };
11
24
  53F42B6014667527006B8F7C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53F42B5F14667527006B8F7C /* Foundation.framework */; };
@@ -285,6 +298,7 @@
285
298
  53F42B8014667530006B8F7C /* MultipleTargets-iPad */,
286
299
  53F42B9B14667536006B8F7C /* Specs */,
287
300
  53F42BAF1466753B006B8F7C /* Integration */,
301
+ 53A7DCC114D0B3AE00A4FE42 /* AggregateTarget */,
288
302
  );
289
303
  };
290
304
  /* End PBXProject section */
@@ -423,6 +437,20 @@
423
437
  /* End PBXVariantGroup section */
424
438
 
425
439
  /* Begin XCBuildConfiguration section */
440
+ 53A7DCC214D0B3AE00A4FE42 /* Debug */ = {
441
+ isa = XCBuildConfiguration;
442
+ buildSettings = {
443
+ PRODUCT_NAME = "$(TARGET_NAME)";
444
+ };
445
+ name = Debug;
446
+ };
447
+ 53A7DCC314D0B3AE00A4FE42 /* Release */ = {
448
+ isa = XCBuildConfiguration;
449
+ buildSettings = {
450
+ PRODUCT_NAME = "$(TARGET_NAME)";
451
+ };
452
+ name = Release;
453
+ };
426
454
  53F42B7B14667527006B8F7C /* Debug */ = {
427
455
  isa = XCBuildConfiguration;
428
456
  buildSettings = {
@@ -573,6 +601,14 @@
573
601
  /* End XCBuildConfiguration section */
574
602
 
575
603
  /* Begin XCConfigurationList section */
604
+ 53A7DCC414D0B3AE00A4FE42 /* Build configuration list for PBXAggregateTarget "AggregateTarget" */ = {
605
+ isa = XCConfigurationList;
606
+ buildConfigurations = (
607
+ 53A7DCC214D0B3AE00A4FE42 /* Debug */,
608
+ 53A7DCC314D0B3AE00A4FE42 /* Release */,
609
+ );
610
+ defaultConfigurationIsVisible = 0;
611
+ };
576
612
  53F42B5314667526006B8F7C /* Build configuration list for PBXProject "MultipleTargets" */ = {
577
613
  isa = XCConfigurationList;
578
614
  buildConfigurations = (