xcoder 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/spec/TestProject/TestProject.xcodeproj/project.pbxproj +801 -433
  2. data/spec/build_phase_spec.rb +1 -1
  3. data/spec/builder_spec.rb +54 -32
  4. data/spec/configuration_list_spec.rb +38 -0
  5. data/spec/configuration_spec.rb +5 -6
  6. data/spec/group_spec.rb +43 -32
  7. data/spec/integration/builder_spec.rb +60 -0
  8. data/spec/integration/cedar_install_spec.rb +107 -0
  9. data/spec/integration/pull_to_refresh_install_spec.rb +36 -0
  10. data/spec/integration/reachability_install_spec.rb +43 -0
  11. data/spec/keychain_spec.rb +2 -2
  12. data/spec/project_spec.rb +55 -6
  13. data/spec/scheme_spec.rb +1 -2
  14. data/spec/spec_helper.rb +2 -1
  15. data/spec/target_spec.rb +93 -3
  16. data/spec/test_report_spec.rb +2 -2
  17. data/spec/workspace_spec.rb +1 -2
  18. metadata +25 -48
  19. data/.gitignore +0 -7
  20. data/.rvmrc +0 -4
  21. data/Gemfile +0 -11
  22. data/Guardfile +0 -13
  23. data/README.md +0 -125
  24. data/Rakefile +0 -16
  25. data/lib/xcode/build_file.rb +0 -22
  26. data/lib/xcode/build_phase.rb +0 -46
  27. data/lib/xcode/builder.rb +0 -182
  28. data/lib/xcode/buildfile.rb +0 -101
  29. data/lib/xcode/configuration.rb +0 -129
  30. data/lib/xcode/core_ext/array.rb +0 -23
  31. data/lib/xcode/core_ext/boolean.rb +0 -21
  32. data/lib/xcode/core_ext/fixnum.rb +0 -5
  33. data/lib/xcode/core_ext/hash.rb +0 -27
  34. data/lib/xcode/core_ext/string.rb +0 -11
  35. data/lib/xcode/file_reference.rb +0 -29
  36. data/lib/xcode/group.rb +0 -118
  37. data/lib/xcode/info_plist.rb +0 -41
  38. data/lib/xcode/keychain.rb +0 -77
  39. data/lib/xcode/parsers/plutil_project_parser.rb +0 -20
  40. data/lib/xcode/project.rb +0 -190
  41. data/lib/xcode/provisioning_profile.rb +0 -53
  42. data/lib/xcode/registry.rb +0 -120
  43. data/lib/xcode/resource.rb +0 -187
  44. data/lib/xcode/scheme.rb +0 -36
  45. data/lib/xcode/shell.rb +0 -21
  46. data/lib/xcode/target.rb +0 -94
  47. data/lib/xcode/test/report_parser.rb +0 -172
  48. data/lib/xcode/testflight.rb +0 -56
  49. data/lib/xcode/variant_group.rb +0 -8
  50. data/lib/xcode/version.rb +0 -3
  51. data/lib/xcode/workspace.rb +0 -40
  52. data/lib/xcoder.rb +0 -105
  53. data/xcoder.gemspec +0 -26
@@ -0,0 +1,36 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe "EGORefreshTableHeaderView", :integration => true do
4
+
5
+ let(:project) { Xcode.project 'TestProject' }
6
+
7
+ it "should install without error" do
8
+
9
+ # Copy the files necessary for the project to the correct destination
10
+
11
+ FileUtils.cp_r "examples/EGORefreshTableHeaderView/Vendor", "spec/TestProject"
12
+
13
+ # Add the source and header file to the project
14
+
15
+ source_files = [ { 'name' => 'EGORefreshTableHeaderView.m', 'path' => 'Vendor/EGORefreshTableHeaderView/EGORefreshTableHeaderView.m' },
16
+ { 'name' => 'EGORefreshTableHeaderView.h', 'path' => 'Vendor/EGORefreshTableHeaderView/EGORefreshTableHeaderView.h' } ]
17
+
18
+ # Create or traverse to the group to install the source files
19
+
20
+ project.group('Vendor/EGORefreshTableHeaderView') do
21
+ source_files.each {|source| create_file source }
22
+ end
23
+
24
+ ptr_source = project.file('Vendor/EGORefreshTableHeaderView/EGORefreshTableHeaderView.m')
25
+
26
+ # Select the main target of the project and add the source file to the build
27
+ # phase.
28
+
29
+ project.target('TestProject').sources_build_phase do
30
+ add_build_file ptr_source
31
+ end
32
+
33
+ project.save!
34
+ end
35
+
36
+ end
@@ -0,0 +1,43 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe "Reachability", :integration => true do
4
+
5
+ let(:project) { Xcode.project 'TestProject' }
6
+
7
+ it "should update a project with a working installation of Reachability" do
8
+
9
+ # Copy the files necessary for the project to the correct destination
10
+
11
+ FileUtils.cp_r "examples/Reachability/Vendor", "spec/TestProject"
12
+
13
+
14
+ # Add the source and header file to the project
15
+
16
+ source_files = [ { 'name' => 'Reachability.m', 'path' => 'Vendor/Reachability/Reachability.m' },
17
+ { 'name' => 'Reachability.h', 'path' => 'Vendor/Reachability/Reachability.h' } ]
18
+
19
+
20
+ # Create or traverse to the group to install the source files
21
+ project.group('Vendor/Reachability') do
22
+ source_files.each {|source| create_file source }
23
+ end
24
+
25
+ source_file = project.file('Vendor/Reachability/Reachability.m')
26
+
27
+ # Select the main target of the project and add the source file to the build phase.
28
+
29
+ project.target('TestProject').sources_build_phase do
30
+ add_build_file source_file
31
+ end
32
+
33
+ cfnetwork_framework = project.frameworks_group.create_system_framework 'CFNetwork'
34
+
35
+ project.target('TestProject').framework_build_phase do
36
+ add_build_file cfnetwork_framework
37
+ end
38
+
39
+ project.save!
40
+
41
+ end
42
+
43
+ end
@@ -13,8 +13,8 @@ describe Xcode::Keychain do
13
13
  it "should import a certificate" do
14
14
  Xcode::Keychain.temp_keychain('Test2.keychain') do |kc|
15
15
  kc.import "#{File.dirname(__FILE__)}/Provisioning/TestUser.p12", 'testpassword'
16
- kc.certificates.size.should==1
17
- kc.certificates[0].should=="Test User"
16
+ kc.identities.size.should==1
17
+ kc.identities[0].should=="Test User"
18
18
  end
19
19
  end
20
20
 
data/spec/project_spec.rb CHANGED
@@ -4,7 +4,6 @@ describe Xcode::Project do
4
4
 
5
5
  let(:project) { Xcode.project 'TestProject' }
6
6
 
7
-
8
7
  describe "Targets" do
9
8
 
10
9
  let(:expected_first_target) { "TestProject" }
@@ -14,10 +13,6 @@ describe Xcode::Project do
14
13
 
15
14
  let(:subject) { project.targets }
16
15
 
17
- it "should give the correct number of targets" do
18
- subject.size.should == 2
19
- end
20
-
21
16
  it "should return the correct targets" do
22
17
  subject[0].name.should == expected_first_target
23
18
  subject[1].name.should == expected_second_target
@@ -47,10 +42,38 @@ describe Xcode::Project do
47
42
  end
48
43
 
49
44
  end
45
+
46
+ describe "#create_target" do
47
+
48
+ let(:subject) { project.create_target('SuperNewTestTarget') }
49
+
50
+ it "should generate a target with the name specified" do
51
+ subject.name.should == 'SuperNewTestTarget'
52
+ end
53
+
54
+ it "should be available in the list of project targets" do
55
+ project.target('SuperNewTestTarget').should_not be_nil
56
+ end
57
+
58
+ it "should generate a target that knows the project" do
59
+ subject.project.should == project
60
+ end
61
+ end
62
+
63
+ describe "#remove_target" do
64
+
65
+ let(:subject) { project.create_target('SoonToBeRetiredTarget') }
66
+
67
+ it "should remove the target created" do
68
+ project.remove_target(subject.name)
69
+ project.targets.find {|target| target.name == subject.name }.should be_nil
70
+
71
+ end
72
+
73
+ end
50
74
 
51
75
  end
52
76
 
53
-
54
77
  describe "Schemes" do
55
78
 
56
79
  let(:expected_scheme) { "TestProject" }
@@ -97,4 +120,30 @@ describe Xcode::Project do
97
120
 
98
121
  end
99
122
 
123
+ describe "#group" do
124
+ it "should find or create the entire path specified" do
125
+ group = project.group('fe/fi/fo/fum')
126
+ group.name.should == "fum"
127
+ group.supergroup.name.should == "fo"
128
+ end
129
+ end
130
+
131
+ describe "#products_group" do
132
+ it "should find the 'Products' group" do
133
+ project.products_group.should_not be_nil
134
+ end
135
+ end
136
+
137
+ describe "#frameworks_group" do
138
+ it "should find the 'Frameworks' group" do
139
+ project.products_group.should_not be_nil
140
+ end
141
+ end
142
+
143
+ describe "#to_xcplist" do
144
+ it "should respond to this method" do
145
+ project.should respond_to :to_xcplist
146
+ end
147
+ end
148
+
100
149
  end
data/spec/scheme_spec.rb CHANGED
@@ -1,5 +1,4 @@
1
- require 'rspec'
2
- require 'xcoder'
1
+ require_relative 'spec_helper'
3
2
 
4
3
  describe Xcode::Scheme do
5
4
  before do
data/spec/spec_helper.rb CHANGED
@@ -1 +1,2 @@
1
- require_relative '../lib/xcoder'
1
+ require_relative '../lib/xcoder'
2
+ require 'fileutils'
data/spec/target_spec.rb CHANGED
@@ -17,15 +17,36 @@ describe Xcode::Target do
17
17
  end
18
18
  end
19
19
 
20
- describe "#productName" do
20
+ describe "#product_name" do
21
21
 
22
22
  let(:expected_product_name) { "TestProject" }
23
23
 
24
- it "should have the correct productName" do
25
- subject.name == expected_product_name
24
+ it "should have the correct product_name" do
25
+ subject.product_name == expected_product_name
26
26
  end
27
27
  end
28
28
 
29
+ describe "#build_configuration_list" do
30
+
31
+ it "should return a build configurations list" do
32
+ subject.build_configuration_list.should_not be_nil
33
+ end
34
+
35
+ it "should create a configration list if one does not exist" do
36
+
37
+ test_project = project.create_target "CreateBuildConfigurationTarget"
38
+ test_project.build_configuration_list.should_not be_nil
39
+ end
40
+
41
+ describe "build configurations" do
42
+
43
+ it "should have the correct configs" do
44
+ subject.build_configuration_list.build_configurations.count.should == 2
45
+ end
46
+ end
47
+
48
+ end
49
+
29
50
  describe "#configs" do
30
51
  it "should return the correct number of configurations" do
31
52
  subject.configs.length.should == 2
@@ -64,6 +85,16 @@ describe Xcode::Target do
64
85
  it "should return the correct build phase" do
65
86
  subject.framework_build_phase.should_not be_nil
66
87
  end
88
+
89
+ it "should allow a block to be passed to it" do
90
+
91
+ test_file = project.groups.create_file 'name' => 'TestFile.m', 'path' => 'TestFile.m'
92
+
93
+ subject.framework_build_phase do
94
+ add_build_file test_file
95
+ end
96
+ end
97
+
67
98
  end
68
99
 
69
100
  describe "#sources_build_phase" do
@@ -78,4 +109,63 @@ describe Xcode::Target do
78
109
  end
79
110
  end
80
111
 
112
+ describe "#create_build_phases" do
113
+
114
+ let(:subject) do
115
+ project.create_target "CreateBuildPhasesTarget"
116
+ end
117
+
118
+ context "when one phase is created" do
119
+
120
+ it "should only create the one build phase" do
121
+ build_phase = subject.create_build_phases :sources
122
+ build_phase.count.should == 1
123
+ subject.build_phases.count.should == 1
124
+ end
125
+
126
+ it "should create the build phase" do
127
+ build_phase = subject.create_build_phases :sources
128
+ subject.sources_build_phase.identifier.should == build_phase.first.identifier
129
+ end
130
+
131
+ it "should allow for the build phase to be customized" do
132
+ subject.create_build_phases :sources do |phase|
133
+ # Add files to the build phases
134
+ end
135
+ end
136
+
137
+ end
138
+
139
+ it "should create all the phases specified" do
140
+ build_phases = subject.create_build_phases :resources, :framework, :sources
141
+ subject.build_phases.count.should == 3
142
+ end
143
+
144
+ context "when the target is saved and reloaded" do
145
+
146
+ let(:subject) do
147
+ new_target = project.create_target "ReloadedBuildPhaseTarget"
148
+ end
149
+
150
+ it "should save the build phases to the target if the target is saved" do
151
+
152
+ subject.create_build_phases :resources, :framework
153
+ subject.save!
154
+
155
+ reloaded_target = project.target('ReloadedBuildPhaseTarget')
156
+ reloaded_target.build_phases.count.should == 2
157
+ end
158
+
159
+ end
160
+
161
+ end
162
+
163
+ describe "#product_reference" do
164
+ context "when a product reference is present" do
165
+ it "should return the product reference" do
166
+ subject.product_reference.should_not be_nil
167
+ end
168
+ end
169
+ end
170
+
81
171
  end
@@ -1,10 +1,10 @@
1
1
  require 'rspec'
2
2
  require 'xcoder'
3
3
 
4
- describe Xcode::Test::ReportParser do
4
+ describe Xcode::Test::OCUnitReportParser do
5
5
 
6
6
  def example_report
7
- t = Xcode::Test::ReportParser.new
7
+ t = Xcode::Test::OCUnitReportParser.new
8
8
  t << "Run test suite AnExampleTestSuite"
9
9
  t << "Test Suite 'AnExampleTestSuite' started at 2012-02-10 00:37:04 +0000"
10
10
 
@@ -1,5 +1,4 @@
1
- require 'rspec'
2
- require 'xcoder'
1
+ require_relative 'spec_helper'
3
2
 
4
3
  describe Xcode::Workspace do
5
4
  it "should enumerate all workspaces in current directory" do
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ray Hilton
9
+ - Frank Webber
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2012-02-11 00:00:00.000000000Z
13
+ date: 2012-02-12 00:00:00.000000000Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: json
16
- requirement: &70180396509420 !ruby/object:Gem::Requirement
17
+ requirement: &70236846787340 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ! '>='
@@ -21,10 +22,10 @@ dependencies:
21
22
  version: '0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *70180396509420
25
+ version_requirements: *70236846787340
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: plist
27
- requirement: &70180396509000 !ruby/object:Gem::Requirement
28
+ requirement: &70236846786920 !ruby/object:Gem::Requirement
28
29
  none: false
29
30
  requirements:
30
31
  - - ! '>='
@@ -32,10 +33,10 @@ dependencies:
32
33
  version: '0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70180396509000
36
+ version_requirements: *70236846786920
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: nokogiri
38
- requirement: &70180396508580 !ruby/object:Gem::Requirement
39
+ requirement: &70236846786500 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
41
42
  - - ! '>='
@@ -43,10 +44,10 @@ dependencies:
43
44
  version: '0'
44
45
  type: :runtime
45
46
  prerelease: false
46
- version_requirements: *70180396508580
47
+ version_requirements: *70236846786500
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: builder
49
- requirement: &70180396508160 !ruby/object:Gem::Requirement
50
+ requirement: &70236846809600 !ruby/object:Gem::Requirement
50
51
  none: false
51
52
  requirements:
52
53
  - - ! '>='
@@ -54,10 +55,10 @@ dependencies:
54
55
  version: '0'
55
56
  type: :runtime
56
57
  prerelease: false
57
- version_requirements: *70180396508160
58
+ version_requirements: *70236846809600
58
59
  - !ruby/object:Gem::Dependency
59
60
  name: rest-client
60
- requirement: &70180396507740 !ruby/object:Gem::Requirement
61
+ requirement: &70236846809180 !ruby/object:Gem::Requirement
61
62
  none: false
62
63
  requirements:
63
64
  - - ! '>='
@@ -65,51 +66,17 @@ dependencies:
65
66
  version: '0'
66
67
  type: :runtime
67
68
  prerelease: false
68
- version_requirements: *70180396507740
69
+ version_requirements: *70236846809180
69
70
  description: Provides a ruby based object-model for parsing project structures and
70
71
  invoking builds
71
72
  email:
72
73
  - ray@wirestorm.net
74
+ - franklin.webber@gmail.com
73
75
  executables:
74
76
  - xcoder-build
75
77
  extensions: []
76
78
  extra_rdoc_files: []
77
79
  files:
78
- - .gitignore
79
- - .rvmrc
80
- - Gemfile
81
- - Guardfile
82
- - README.md
83
- - Rakefile
84
- - bin/xcoder-build
85
- - lib/xcode/build_file.rb
86
- - lib/xcode/build_phase.rb
87
- - lib/xcode/builder.rb
88
- - lib/xcode/buildfile.rb
89
- - lib/xcode/configuration.rb
90
- - lib/xcode/core_ext/array.rb
91
- - lib/xcode/core_ext/boolean.rb
92
- - lib/xcode/core_ext/fixnum.rb
93
- - lib/xcode/core_ext/hash.rb
94
- - lib/xcode/core_ext/string.rb
95
- - lib/xcode/file_reference.rb
96
- - lib/xcode/group.rb
97
- - lib/xcode/info_plist.rb
98
- - lib/xcode/keychain.rb
99
- - lib/xcode/parsers/plutil_project_parser.rb
100
- - lib/xcode/project.rb
101
- - lib/xcode/provisioning_profile.rb
102
- - lib/xcode/registry.rb
103
- - lib/xcode/resource.rb
104
- - lib/xcode/scheme.rb
105
- - lib/xcode/shell.rb
106
- - lib/xcode/target.rb
107
- - lib/xcode/test/report_parser.rb
108
- - lib/xcode/testflight.rb
109
- - lib/xcode/variant_group.rb
110
- - lib/xcode/version.rb
111
- - lib/xcode/workspace.rb
112
- - lib/xcoder.rb
113
80
  - spec/Provisioning/TestUser.p12
114
81
  - spec/TestProject/Buildfile
115
82
  - spec/TestProject/TestProject.xcodeproj/project.pbxproj
@@ -130,8 +97,13 @@ files:
130
97
  - spec/TestWorkspace.xcworkspace/xcuserdata/ray.xcuserdatad/UserInterfaceState.xcuserstate
131
98
  - spec/build_phase_spec.rb
132
99
  - spec/builder_spec.rb
100
+ - spec/configuration_list_spec.rb
133
101
  - spec/configuration_spec.rb
134
102
  - spec/group_spec.rb
103
+ - spec/integration/builder_spec.rb
104
+ - spec/integration/cedar_install_spec.rb
105
+ - spec/integration/pull_to_refresh_install_spec.rb
106
+ - spec/integration/reachability_install_spec.rb
135
107
  - spec/keychain_spec.rb
136
108
  - spec/project_spec.rb
137
109
  - spec/scheme_spec.rb
@@ -140,7 +112,7 @@ files:
140
112
  - spec/test_report_spec.rb
141
113
  - spec/workspace_spec.rb
142
114
  - spec/xcode_spec.rb
143
- - xcoder.gemspec
115
+ - bin/xcoder-build
144
116
  homepage: https://github.com/rayh/xcoder
145
117
  licenses: []
146
118
  post_install_message:
@@ -186,8 +158,13 @@ test_files:
186
158
  - spec/TestWorkspace.xcworkspace/xcuserdata/ray.xcuserdatad/UserInterfaceState.xcuserstate
187
159
  - spec/build_phase_spec.rb
188
160
  - spec/builder_spec.rb
161
+ - spec/configuration_list_spec.rb
189
162
  - spec/configuration_spec.rb
190
163
  - spec/group_spec.rb
164
+ - spec/integration/builder_spec.rb
165
+ - spec/integration/cedar_install_spec.rb
166
+ - spec/integration/pull_to_refresh_install_spec.rb
167
+ - spec/integration/reachability_install_spec.rb
191
168
  - spec/keychain_spec.rb
192
169
  - spec/project_spec.rb
193
170
  - spec/scheme_spec.rb