pbxplorer 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b1ad5bd24111edaf2c3c324ecfe4772acd6f387e
4
+ data.tar.gz: 5c640508e0d099855c7f017ab4304ddeb0ffa817
5
+ SHA512:
6
+ metadata.gz: 85f732fe2278610e18d0211517540c2ddc3257fef9ec2371e81a9354f31f74dd00c15501272bb49f52f9c09181e9961b9119ee40bfbe90ab562ea777efe5c5e5
7
+ data.tar.gz: 1a5b74fe2add50a874e99ea97c79ebd0df6fa768b6988d543164b744f7a618fa6c4f89ee0c83dcb45afdecad08aa29d9fb074cb007be8b431d2f6033d5f0653a
data/README.md CHANGED
@@ -26,6 +26,7 @@ PBXObject
26
26
  PBXSourcesBuildPhase
27
27
  PBXFileReference
28
28
  PBXGroup
29
+ PBXVariantGroup
29
30
  PBXProject
30
31
  PBXNativeTarget
31
32
  XCBuildConfiguration
@@ -50,6 +51,7 @@ PBXGroup
50
51
  children: [PBXGroup|PBXFileReference]
51
52
  subgroups: [PBXGroup]
52
53
  file_refs: [PBXFileReference]
54
+ variant_groups: [PBXVariantGroup]
53
55
 
54
56
  PBXNativeTarget
55
57
  build_configuration_list: XCBuildConfigurationList
data/lib/pbxplorer.rb CHANGED
@@ -110,6 +110,10 @@ class PBXGroup < PBXObject
110
110
  def subgroups recursive=false
111
111
  PBXGroup.objects_of_class self.children(recursive)
112
112
  end
113
+
114
+ def variant_groups recursive=false
115
+ PBXVariantGroup.objects_of_class self.children(recursive)
116
+ end
113
117
 
114
118
  def help
115
119
  puts "file_ref = group.file_refs.first\n=> " + PBXFileReference.to_s
@@ -118,6 +122,9 @@ class PBXGroup < PBXObject
118
122
  end
119
123
  end
120
124
 
125
+ class PBXVariantGroup < PBXGroup
126
+ end
127
+
121
128
  class PBXNativeTarget < PBXObject
122
129
  def build_phases
123
130
  self.project_file.objects_with_uuids self["buildPhases"]
data/pbxplorer.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "pbxplorer"
3
- s.version = "1.0.0"
4
- s.date = "2013-03-19"
3
+ s.version = "1.1.0"
4
+ s.date = "2016-03-17"
5
5
  s.summary = "Xcode project file editor"
6
6
  s.description = "pbxplorer is a set of Ruby classes for parsing, editing, and saving Xcode project (.pbxproj) files. It can also be used to explore the contents of a project using the interactive Ruby shell."
7
7
  s.authors = ["Mark Smith"]
@@ -4,129 +4,129 @@ require "test/unit"
4
4
  require "pbxplorer"
5
5
 
6
6
  class XCProjectFileTest < Test::Unit::TestCase
7
- def setup
8
- @pf = XCProjectFile.new "test"
9
- end
7
+ def setup
8
+ @pf = XCProjectFile.new "test"
9
+ end
10
10
 
11
- def test_read
12
- assert_not_nil @pf.project
13
- assert_equal @pf.uuids.length, 63
14
- assert_equal @pf.objects.length, 63
15
- end
16
-
17
- def test_objects_of_class
18
- assert_equal @pf.objects_of_class(PBXObject).length, 63
19
- assert_equal @pf.objects_of_class(PBXBuildPhase).length, 7
20
- assert_equal @pf.objects_of_class(PBXSourcesBuildPhase).length, 2
21
-
22
- assert_equal @pf.objects_of_class(PBXFileReference).length, 19
23
- objs = @pf.objects_of_class PBXFileReference, {"name" => "Foundation.framework"}
24
- assert_equal objs.length, 1
25
- assert_equal @pf.objects_of_class(PBXBuildFile, {"fileRef" => objs.first.uuid}).length, 2
26
- end
27
-
28
- def test_objects_with_uuids
29
- fr = @pf.objects_of_class(PBXFileReference, {"name" => "Foundation.framework"}).first
30
- objs = @pf.objects_of_class(PBXBuildFile, {"fileRef" => fr.uuid})
31
- uuids = objs.map {|obj| obj.uuid}
32
-
33
- assert_equal @pf.objects_with_uuids(uuids).length, 2
34
- uuids << "garbage"
35
- assert_equal @pf.objects_with_uuids(uuids).length, 2
36
- end
37
-
38
- def test_object_with_uuid
39
- assert_not_nil @pf.object_with_uuid(@pf.project.uuid)
40
- assert_nil @pf.object_with_uuid("garbage")
41
- end
42
-
43
- def test_create_remove_object
44
- obj = @pf.add_object PBXFileReference.new
45
- assert_equal @pf.objects.length, 64
46
- assert_not_nil @pf.object_with_uuid(obj.uuid)
11
+ def test_read
12
+ assert_not_nil @pf.project
13
+ assert_equal @pf.uuids.length, 63
14
+ assert_equal @pf.objects.length, 63
15
+ end
16
+
17
+ def test_objects_of_class
18
+ assert_equal @pf.objects_of_class(PBXObject).length, 63
19
+ assert_equal @pf.objects_of_class(PBXBuildPhase).length, 7
20
+ assert_equal @pf.objects_of_class(PBXSourcesBuildPhase).length, 2
21
+
22
+ assert_equal @pf.objects_of_class(PBXFileReference).length, 19
23
+ objs = @pf.objects_of_class PBXFileReference, {"name" => "Foundation.framework"}
24
+ assert_equal objs.length, 1
25
+ assert_equal @pf.objects_of_class(PBXBuildFile, {"fileRef" => objs.first.uuid}).length, 2
26
+ end
27
+
28
+ def test_objects_with_uuids
29
+ fr = @pf.objects_of_class(PBXFileReference, {"name" => "Foundation.framework"}).first
30
+ objs = @pf.objects_of_class(PBXBuildFile, {"fileRef" => fr.uuid})
31
+ uuids = objs.map {|obj| obj.uuid}
32
+
33
+ assert_equal @pf.objects_with_uuids(uuids).length, 2
34
+ uuids << "garbage"
35
+ assert_equal @pf.objects_with_uuids(uuids).length, 2
36
+ end
37
+
38
+ def test_object_with_uuid
39
+ assert_not_nil @pf.object_with_uuid(@pf.project.uuid)
40
+ assert_nil @pf.object_with_uuid("garbage")
41
+ end
42
+
43
+ def test_create_remove_object
44
+ obj = @pf.add_object PBXFileReference.new
45
+ assert_equal @pf.objects.length, 64
46
+ assert_not_nil @pf.object_with_uuid(obj.uuid)
47
47
 
48
- @pf.remove_object obj
49
- assert_equal @pf.objects.length, 63
50
- assert_nil @pf.object_with_uuid(obj.uuid)
51
- end
52
-
53
- def test_add_remove_object
54
- obj = PBXFileReference.new
55
- @pf.add_object obj
56
- assert_equal @pf.objects.length, 64
57
- assert_not_nil @pf.object_with_uuid(obj.uuid)
58
-
59
- @pf.remove_object obj
60
- assert_equal @pf.objects.length, 63
61
- assert_nil @pf.object_with_uuid(obj.uuid)
62
- end
63
-
64
- def test_save
65
- path = nil
66
- Tempfile.open("test_save_") { |f| path = f.path }
67
- @pf.save path
68
- new_pf = XCProjectFile.new path
48
+ @pf.remove_object obj
49
+ assert_equal @pf.objects.length, 63
50
+ assert_nil @pf.object_with_uuid(obj.uuid)
51
+ end
52
+
53
+ def test_add_remove_object
54
+ obj = PBXFileReference.new
55
+ @pf.add_object obj
56
+ assert_equal @pf.objects.length, 64
57
+ assert_not_nil @pf.object_with_uuid(obj.uuid)
58
+
59
+ @pf.remove_object obj
60
+ assert_equal @pf.objects.length, 63
61
+ assert_nil @pf.object_with_uuid(obj.uuid)
62
+ end
63
+
64
+ def test_save
65
+ path = nil
66
+ Tempfile.open("test_save_") { |f| path = f.path }
67
+ @pf.save path
68
+ new_pf = XCProjectFile.new path
69
69
 
70
- assert_not_nil new_pf
71
- assert_equal @pf.objects.length, new_pf.objects.length
72
- end
73
-
74
- def test_edit_save
75
- path = nil
76
- Tempfile.open("test_save_") { |f| path = f.path }
70
+ assert_not_nil new_pf
71
+ assert_equal @pf.objects.length, new_pf.objects.length
72
+ end
73
+
74
+ def test_edit_save
75
+ path = nil
76
+ Tempfile.open("test_save_") { |f| path = f.path }
77
77
 
78
- obj = @pf.add_object PBXFileReference.new
79
- @pf.save path
78
+ obj = @pf.add_object PBXFileReference.new
79
+ @pf.save path
80
80
 
81
- old_pf = XCProjectFile.new "test"
82
- new_pf = XCProjectFile.new path
83
-
84
- assert_not_nil new_pf
85
- assert_equal (old_pf.objects.length + 1), new_pf.objects.length
86
- assert_nil old_pf.object_with_uuid obj.uuid
87
- assert_not_nil new_pf.object_with_uuid obj.uuid
88
- end
89
-
90
- def test_remove_file_ref
91
- path = nil
92
- Tempfile.open("test_save_") { |f| path = f.path }
81
+ old_pf = XCProjectFile.new "test"
82
+ new_pf = XCProjectFile.new path
83
+
84
+ assert_not_nil new_pf
85
+ assert_equal (old_pf.objects.length + 1), new_pf.objects.length
86
+ assert_nil old_pf.object_with_uuid obj.uuid
87
+ assert_not_nil new_pf.object_with_uuid obj.uuid
88
+ end
89
+
90
+ def test_remove_file_ref
91
+ path = nil
92
+ Tempfile.open("test_save_") { |f| path = f.path }
93
93
 
94
- fr = @pf.objects_of_class(PBXFileReference, {"name" => "Foundation.framework"}).first
95
- bfs = @pf.objects_of_class(PBXBuildFile, {"fileRef" => fr.uuid})
96
- @pf.remove_file_ref fr
97
- @pf.save path
98
-
99
- old_pf = XCProjectFile.new "test"
100
- new_pf = XCProjectFile.new path
101
-
102
- assert_not_nil new_pf
103
- assert_equal (old_pf.objects.length - 3), new_pf.objects.length
104
- (bfs + [fr]).each do |obj|
105
- assert_not_nil old_pf.object_with_uuid obj.uuid
106
- assert_nil new_pf.object_with_uuid obj.uuid
107
- end
108
- end
94
+ fr = @pf.objects_of_class(PBXFileReference, {"name" => "Foundation.framework"}).first
95
+ bfs = @pf.objects_of_class(PBXBuildFile, {"fileRef" => fr.uuid})
96
+ @pf.remove_file_ref fr
97
+ @pf.save path
98
+
99
+ old_pf = XCProjectFile.new "test"
100
+ new_pf = XCProjectFile.new path
101
+
102
+ assert_not_nil new_pf
103
+ assert_equal (old_pf.objects.length - 3), new_pf.objects.length
104
+ (bfs + [fr]).each do |obj|
105
+ assert_not_nil old_pf.object_with_uuid obj.uuid
106
+ assert_nil new_pf.object_with_uuid obj.uuid
107
+ end
108
+ end
109
109
  end
110
110
 
111
111
  class PBXProjectTest < Test::Unit::TestCase
112
- def setup
113
- @project = XCProjectFile.new("test").project
114
- end
112
+ def setup
113
+ @project = XCProjectFile.new("test").project
114
+ end
115
115
 
116
- def test_properties
117
- assert_equal @project.targets.length, 2
118
- assert_equal @project.build_configuration_list.uuid, "4D0B81861657473000DEF560"
119
- assert_equal @project.main_group.uuid, "4D0B81811657473000DEF560"
120
- end
116
+ def test_properties
117
+ assert_equal @project.targets.length, 2
118
+ assert_equal @project.build_configuration_list.uuid, "4D0B81861657473000DEF560"
119
+ assert_equal @project.main_group.uuid, "4D0B81811657473000DEF560"
120
+ end
121
121
  end
122
122
 
123
123
  class XCConfigurationListTest < Test::Unit::TestCase
124
- def setup
125
- @list = XCProjectFile.new("test").project.build_configuration_list
126
- end
127
-
128
- def test_properties
129
- assert_equal @list.build_configurations.length, 2
130
- end
124
+ def setup
125
+ @list = XCProjectFile.new("test").project.build_configuration_list
126
+ end
127
+
128
+ def test_properties
129
+ assert_equal @list.build_configurations.length, 2
130
+ end
131
131
  end
132
132
 
metadata CHANGED
@@ -1,67 +1,50 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pbxplorer
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 0
9
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Mark Smith
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2013-03-19 00:00:00 -04:00
18
- default_executable:
11
+ date: 2016-03-17 00:00:00.000000000 Z
19
12
  dependencies: []
20
-
21
- description: pbxplorer is a set of Ruby classes for parsing, editing, and saving Xcode project (.pbxproj) files. It can also be used to explore the contents of a project using the interactive Ruby shell.
13
+ description: pbxplorer is a set of Ruby classes for parsing, editing, and saving Xcode
14
+ project (.pbxproj) files. It can also be used to explore the contents of a project
15
+ using the interactive Ruby shell.
22
16
  email: mark@camazotz.com
23
17
  executables: []
24
-
25
18
  extensions: []
26
-
27
19
  extra_rdoc_files: []
28
-
29
- files:
20
+ files:
30
21
  - test/project.pbxproj
31
22
  - test/test_pbxplorer.rb
32
23
  - lib/pbxplorer.rb
33
24
  - README.md
34
25
  - Rakefile
35
26
  - pbxplorer.gemspec
36
- has_rdoc: true
37
27
  homepage: http://github.com/mjmsmith/pbxplorer
38
28
  licenses: []
39
-
29
+ metadata: {}
40
30
  post_install_message:
41
31
  rdoc_options: []
42
-
43
- require_paths:
32
+ require_paths:
44
33
  - lib
45
- required_ruby_version: !ruby/object:Gem::Requirement
46
- requirements:
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
47
36
  - - ">="
48
- - !ruby/object:Gem::Version
49
- segments:
50
- - 0
51
- version: "0"
52
- required_rubygems_version: !ruby/object:Gem::Requirement
53
- requirements:
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
54
41
  - - ">="
55
- - !ruby/object:Gem::Version
56
- segments:
57
- - 0
58
- version: "0"
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
59
44
  requirements: []
60
-
61
45
  rubyforge_project:
62
- rubygems_version: 1.3.6
46
+ rubygems_version: 2.0.14
63
47
  signing_key:
64
- specification_version: 3
48
+ specification_version: 4
65
49
  summary: Xcode project file editor
66
50
  test_files: []
67
-