vendor 0.0.4 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/CHANGELOG.md +22 -0
  2. data/Gemfile.lock +9 -1
  3. data/Guardfile +12 -0
  4. data/LICENSE +2 -0
  5. data/Readme.markdown +39 -23
  6. data/TODO.md +26 -0
  7. data/VERSION +1 -0
  8. data/lib/vendor.rb +6 -0
  9. data/lib/vendor/api.rb +61 -7
  10. data/lib/vendor/cli/app.rb +4 -4
  11. data/lib/vendor/cli/console.rb +7 -0
  12. data/lib/vendor/spec.rb +98 -0
  13. data/lib/vendor/templates/Vendorfile +3 -1
  14. data/lib/vendor/templates/vendorspec +15 -10
  15. data/lib/vendor/vendor_file.rb +5 -4
  16. data/lib/vendor/vendor_file/dependency_graph.rb +135 -0
  17. data/lib/vendor/vendor_file/dsl.rb +2 -0
  18. data/lib/vendor/vendor_file/library/base.rb +178 -29
  19. data/lib/vendor/vendor_file/library/git.rb +5 -1
  20. data/lib/vendor/vendor_file/library/local.rb +11 -1
  21. data/lib/vendor/vendor_file/library/remote.rb +134 -2
  22. data/lib/vendor/vendor_file/loader.rb +13 -11
  23. data/lib/vendor/vendor_spec/builder.rb +4 -7
  24. data/lib/vendor/version.rb +172 -1
  25. data/lib/vendor/xcode/project.rb +213 -4
  26. data/lib/vendor/xcode/proxy.rb +1 -0
  27. data/lib/vendor/xcode/proxy/pbx_frameworks_build_phase.rb +6 -0
  28. data/lib/vendor/xcode/proxy/pbx_reference_proxy.rb +7 -0
  29. data/lib/vendor/xcode/proxy/pbx_resources_build_phase.rb +8 -0
  30. data/lib/vendor/xcode/proxy/pbx_shell_script_build_phase.rb +8 -0
  31. data/lib/vendor/xcode/proxy/pbx_sources_build_phase.rb +6 -0
  32. data/spec/lib/vendor/api_spec.rb +54 -0
  33. data/spec/lib/vendor/spec_spec.rb +121 -0
  34. data/spec/lib/vendor/vendor_file/dependency_graph_spec.rb +129 -0
  35. data/spec/lib/vendor/vendor_file/library/base_spec.rb +174 -14
  36. data/spec/lib/vendor/vendor_file/library/remote_spec.rb +154 -4
  37. data/spec/lib/vendor/vendor_file/loader_spec.rb +4 -2
  38. data/spec/lib/vendor/vendor_spec/builder_spec.rb +2 -2
  39. data/spec/lib/vendor/version_spec.rb +168 -0
  40. data/spec/lib/vendor/xcode/project_spec.rb +175 -4
  41. data/spec/lib/vendor_spec.rb +15 -0
  42. data/spec/spec_helper.rb +3 -2
  43. data/spec/support/api_stubs.rb +57 -0
  44. data/spec/support/resources/cache/base/{DKBenchmark-Manifest → DKBenchmark-0.1-Manifest}/data/DKBenchmark.h +0 -0
  45. data/spec/support/resources/cache/base/{DKBenchmark-Manifest → DKBenchmark-0.1-Manifest}/data/DKBenchmark.m +0 -0
  46. data/spec/support/resources/cache/base/DKBenchmark-0.1-Manifest/vendor.json +1 -0
  47. data/spec/support/resources/cache/base/{DKBenchmark-Vendorspec → DKBenchmark-0.1-Nothing}/DKBenchmark.h +0 -0
  48. data/spec/support/resources/cache/base/{DKBenchmark-Vendorspec → DKBenchmark-0.1-Nothing}/DKBenchmark.m +0 -0
  49. data/spec/support/resources/cache/base/DKBenchmark-0.1-Nothing/DKBenchmark.vendorspec +16 -0
  50. data/spec/support/resources/cache/base/DKBenchmark-0.1-Vendorspec/DKBenchmark.h +18 -0
  51. data/spec/support/resources/cache/base/DKBenchmark-0.1-Vendorspec/DKBenchmark.m +73 -0
  52. data/spec/support/resources/cache/base/DKBenchmark-0.1-Vendorspec/DKBenchmark.vendorspec +24 -0
  53. data/spec/support/resources/projects/MultipleTargets/MultipleTargets.xcodeproj/project.pbxproj +624 -0
  54. data/spec/support/resources/projects/RestKitProject/RestKitProject.xcodeproj/project.pbxproj +479 -0
  55. data/spec/support/resources/projects/UtilityApplication/UtilityApplication.xcodeproj/project.pbxproj +16 -7
  56. data/spec/support/resources/vendors/DKBenchmark/DKBenchmark.vendorspec +24 -8
  57. data/spec/support/resources/vendors/DKBenchmarkUnsafe/DKBenchmark.vendorspec +17 -8
  58. data/vendor.gemspec +4 -2
  59. metadata +93 -39
  60. data/lib/vendor/vendor_spec/dsl.rb +0 -39
  61. data/lib/vendor/vendor_spec/loader.rb +0 -23
  62. data/spec/lib/vendor/vendor_spec/dsl_spec.rb +0 -67
  63. data/spec/lib/vendor/vendor_spec/loader_spec.rb +0 -41
  64. data/spec/support/resources/cache/base/DKBenchmark-Manifest/vendor.json +0 -1
  65. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.vendorspec +0 -11
@@ -1,39 +0,0 @@
1
- module Vendor
2
- module VendorSpec
3
-
4
- class DSL
5
-
6
- attr_reader :vendor_spec
7
-
8
- def initialize
9
- @vendor_spec = Hash.new
10
- end
11
-
12
- def method_missing(name, *args)
13
- if name.to_s.match(/\=$/) || args.length > 0
14
- without_equals = name.to_s.gsub(/=$/, '')
15
-
16
- @vendor_spec[without_equals.to_sym] = args.length == 1 ? args.first : args
17
- else
18
- @vendor_spec[name.to_sym]
19
- end
20
- end
21
-
22
- def validate!
23
- [ :name, :version, :email, :files ].each do |key|
24
- value = @vendor_spec[key]
25
-
26
- if value.respond_to?(:empty?) ? value.empty? : !value
27
- raise StandardError.new("Specification is missing the `#{key}` option")
28
- end
29
- end
30
- end
31
-
32
- def to_json
33
- vendor_spec.to_json
34
- end
35
-
36
- end
37
-
38
- end
39
- end
@@ -1,23 +0,0 @@
1
- module Vendor
2
- module VendorSpec
3
-
4
- class Loader
5
-
6
- attr_reader :dsl
7
-
8
- def initialize
9
- @dsl = Vendor::VendorSpec::DSL.new
10
- end
11
-
12
- def vendor(&block)
13
- @dsl.instance_eval &block
14
- end
15
-
16
- def load(filename)
17
- @dsl.instance_eval(File.read(filename), filename)
18
- end
19
-
20
- end
21
-
22
- end
23
- end
@@ -1,67 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Vendor::VendorSpec::DSL do
4
-
5
- let! (:dsl) { Vendor::VendorSpec::DSL.new }
6
-
7
- context '#vendor_spec' do
8
-
9
- it 'should load all the properties into the vendor spec' do
10
- dsl.foo "foo"
11
- dsl.cheese "is good"
12
-
13
- dsl.vendor_spec.should == { :foo => "foo", :cheese => "is good" }
14
- end
15
-
16
- end
17
-
18
- context '#validate' do
19
-
20
- before :each do
21
- dsl.name = "Vendor"
22
- dsl.files = "Something"
23
- dsl.email = "foo@bar.com"
24
- dsl.version = "0.1"
25
- end
26
-
27
- it 'should thorw an error if no name is defined' do
28
- expect do
29
- dsl.name = nil
30
- dsl.validate!
31
- end.should raise_error("Specification is missing the `name` option")
32
- end
33
-
34
- it 'should thorw an error if no email is defined' do
35
- expect do
36
- dsl.email = nil
37
- dsl.validate!
38
- end.should raise_error("Specification is missing the `email` option")
39
- end
40
-
41
- it 'should thorw an error if no version is defined' do
42
- expect do
43
- dsl.version = nil
44
- dsl.validate!
45
- end.should raise_error("Specification is missing the `version` option")
46
- end
47
-
48
- it 'should thorw an error if no files are defined' do
49
- expect do
50
- dsl.files = nil
51
- dsl.validate!
52
- end.should raise_error("Specification is missing the `files` option")
53
- end
54
-
55
- end
56
-
57
- context '#to_json' do
58
-
59
- it 'should return the vendor spec as a JSON string' do
60
- dsl.foo "foo"
61
-
62
- dsl.to_json.should == dsl.vendor_spec.to_json
63
- end
64
-
65
- end
66
-
67
- end
@@ -1,41 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Vendor::VendorSpec::Loader do
4
-
5
- let (:loader) { Vendor::VendorSpec::Loader.new }
6
-
7
- context "#initialize" do
8
-
9
- it "should create a dsl" do
10
- loader.dsl.should be_kind_of(Vendor::VendorSpec::DSL)
11
- end
12
-
13
- end
14
-
15
- context "#vendor" do
16
-
17
- it "should allow you to pass a block and define vendor spec properties" do
18
- loader.vendor do
19
- name "Something"
20
- files [ "Foo", "Bar" ]
21
- end
22
-
23
- loader.dsl.name.should == "Something"
24
- loader.dsl.files.should == [ "Foo", "Bar" ]
25
- end
26
-
27
- end
28
-
29
- context "#load" do
30
-
31
- it "should allow you to load from a file" do
32
- loader.load File.join(VENDOR_RESOURCE_PATH, "DKBenchmark", "DKBenchmark.vendorspec")
33
-
34
- loader.dsl.name.should == "DKBenchmark"
35
- loader.dsl.authors.should == "keithpitt"
36
- loader.dsl.email.should == "me@keithpitt.com"
37
- end
38
-
39
- end
40
-
41
- end
@@ -1 +0,0 @@
1
- {"name":"DKBenchmark","version":"0.1","authors":"keithpitt","email":"me@keithpitt.com","homepage":"http://www.keithpitt.com","description":"Easy benchmarking in Objective-C using blocks","github":"https://github.com/keithpitt/DKBenchmark","files":["DKBenchmark.h","DKBenchmark.m"]}
@@ -1,11 +0,0 @@
1
- name "DKBenchmark"
2
- version "0.1"
3
-
4
- authors "keithpitt"
5
- email "me@keithpitt.com"
6
- homepage "http://www.keithpitt.com"
7
- description "Easy benchmarking in Objective-C using blocks"
8
-
9
- github "https://github.com/keithpitt/DKBenchmark"
10
-
11
- files [ "DKBenchmark.h", "DKBenchmark.m" ]