zerg_xcode 0.2 → 0.2.1

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.2.1. Implemented lstargets.
2
+
1
3
  v0.2. Implemented import.
2
4
 
3
5
  v0.1. Initial release. Knows help, irb, ls, retarget.
data/Manifest CHANGED
@@ -18,6 +18,7 @@ lib/zerg_xcode/plugins/help.rb
18
18
  lib/zerg_xcode/plugins/import.rb
19
19
  lib/zerg_xcode/plugins/irb.rb
20
20
  lib/zerg_xcode/plugins/ls.rb
21
+ lib/zerg_xcode/plugins/lstargets.rb
21
22
  lib/zerg_xcode/plugins/retarget.rb
22
23
  lib/zerg_xcode/shortcuts.rb
23
24
  lib/zerg_xcode.rb
@@ -43,6 +44,7 @@ test/plugins/core/core_test.rb
43
44
  test/plugins/import_test.rb
44
45
  test/plugins/irb_test.rb
45
46
  test/plugins/ls_test.rb
47
+ test/plugins/lstargets_test.rb
46
48
  test/plugins/retarget_test.rb
47
49
  test/plugins/test_helper.rb
48
50
  test/shortcuts_test.rb
@@ -51,3 +53,4 @@ testdata/project.pbxproj
51
53
  testdata/project.pbxproj.compat
52
54
  testdata/TestApp/TestApp.xcodeproj/project.pbxproj
53
55
  testdata/ZergSupport.xcodeproj/project.pbxproj
56
+ zerg_xcode.gemspec
data/README.textile CHANGED
@@ -3,7 +3,9 @@ h1. ZergXcode
3
3
  ZergXcode is a tool and library for performing automated modifications to Xcode
4
4
  project files. It can be used to work around Xcode's limitations, such as
5
5
  * the cumbersome UI for assigning files to the main target vs the test target
6
+ (<code>zerg-xcode retarget</code>)
6
7
  * the impossibility to easily drop other people's code in your project
8
+ (<code>zerg-xcode import</code>)
7
9
  * a problem that annoys you enough to learn the API and write a ruby script
8
10
 
9
11
  h2. User Instructions
@@ -0,0 +1,29 @@
1
+ class ZergXcode::Plugins::Lstargets
2
+ def help
3
+ {:short => 'shows the targets in a project',
4
+ :long => <<"END" }
5
+ Usage: ls [path]
6
+
7
+ Lists all the targets in the project at the given path. If no path is given,
8
+ looks for a project in the current directory.
9
+ END
10
+ end
11
+
12
+ def run(args)
13
+ list = list_for(args.shift || '.')
14
+ output = ""
15
+ list.each do |entry|
16
+ type_match = /^com\.apple\.product\-type\.(.*)$/.match entry[2]
17
+ target_type = type_match ? type_match[1] : entry[2]
18
+ output << "%-20s %s > %s\n" % [target_type, entry[0], entry[1]]
19
+ end
20
+ print output
21
+ output
22
+ end
23
+
24
+ def list_for(project_name)
25
+ ZergXcode.load(project_name)['targets'].map do |target|
26
+ [target['name'], target['productName'], target['productType']]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,33 @@
1
+ require 'stringio'
2
+ require 'test/unit'
3
+ require 'test/plugins/test_helper.rb'
4
+
5
+ require 'zerg_xcode'
6
+
7
+ module Plugins; end
8
+
9
+ class Plugins::LstargetsTest < Test::Unit::TestCase
10
+ include Plugins::TestHelper
11
+
12
+ def setup
13
+ @plugin = ZergXcode.plugin 'lstargets'
14
+ end
15
+
16
+ def test_list
17
+ golden_list = [
18
+ ["ZergSupport", "ZergSupport", "com.apple.product-type.library.static"],
19
+ ["ZergTestSupport", "ZergTestSupport",
20
+ "com.apple.product-type.library.static"],
21
+ ["ZergSupportTests", "ZergSupportTests",
22
+ "com.apple.product-type.application"],
23
+ ]
24
+ file_list = @plugin.list_for 'testdata/ZergSupport'
25
+ assert_equal golden_list.sort, file_list.sort
26
+ end
27
+
28
+ def test_run
29
+ output = capture_output { @plugin.run(['testdata/ZergSupport']) }
30
+ assert_equal "library.static ZergSupport > ZergSupport",
31
+ output[/^(.*?)$/]
32
+ end
33
+ end
data/zerg_xcode.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{zerg_xcode}
5
- s.version = "0.2"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
9
- s.date = %q{2009-02-27}
9
+ s.date = %q{2009-02-28}
10
10
  s.default_executable = %q{bin/zerg-xcode}
11
11
  s.description = %q{Automated modifications for Xcode project files}
12
12
  s.email = %q{victor@zergling.net}
13
13
  s.executables = ["zerg-xcode"]
14
- s.extra_rdoc_files = ["bin/zerg-xcode", "CHANGELOG", "lib/zerg_xcode/file_format/archiver.rb", "lib/zerg_xcode/file_format/encoder.rb", "lib/zerg_xcode/file_format/lexer.rb", "lib/zerg_xcode/file_format/parser.rb", "lib/zerg_xcode/file_format/paths.rb", "lib/zerg_xcode/objects/pbx_build_file.rb", "lib/zerg_xcode/objects/pbx_container_item_proxy.rb", "lib/zerg_xcode/objects/pbx_group.rb", "lib/zerg_xcode/objects/pbx_native_target.rb", "lib/zerg_xcode/objects/pbx_project.rb", "lib/zerg_xcode/objects/pbx_target_dependency.rb", "lib/zerg_xcode/objects/xc_configuration_list.rb", "lib/zerg_xcode/objects/xcode_object.rb", "lib/zerg_xcode/plugins/core/core.rb", "lib/zerg_xcode/plugins/help.rb", "lib/zerg_xcode/plugins/import.rb", "lib/zerg_xcode/plugins/irb.rb", "lib/zerg_xcode/plugins/ls.rb", "lib/zerg_xcode/plugins/retarget.rb", "lib/zerg_xcode/shortcuts.rb", "lib/zerg_xcode.rb", "LICENSE", "README.textile"]
15
- s.files = ["bin/zerg-xcode", "CHANGELOG", "lib/zerg_xcode/file_format/archiver.rb", "lib/zerg_xcode/file_format/encoder.rb", "lib/zerg_xcode/file_format/lexer.rb", "lib/zerg_xcode/file_format/parser.rb", "lib/zerg_xcode/file_format/paths.rb", "lib/zerg_xcode/objects/pbx_build_file.rb", "lib/zerg_xcode/objects/pbx_container_item_proxy.rb", "lib/zerg_xcode/objects/pbx_group.rb", "lib/zerg_xcode/objects/pbx_native_target.rb", "lib/zerg_xcode/objects/pbx_project.rb", "lib/zerg_xcode/objects/pbx_target_dependency.rb", "lib/zerg_xcode/objects/xc_configuration_list.rb", "lib/zerg_xcode/objects/xcode_object.rb", "lib/zerg_xcode/plugins/core/core.rb", "lib/zerg_xcode/plugins/help.rb", "lib/zerg_xcode/plugins/import.rb", "lib/zerg_xcode/plugins/irb.rb", "lib/zerg_xcode/plugins/ls.rb", "lib/zerg_xcode/plugins/retarget.rb", "lib/zerg_xcode/shortcuts.rb", "lib/zerg_xcode.rb", "LICENSE", "Manifest", "Rakefile", "README.textile", "RUBYFORGE", "test/file_format/archiver_test.rb", "test/file_format/encoder_test.rb", "test/file_format/lexer_test.rb", "test/file_format/parser_test.rb", "test/file_format/path_test.rb", "test/objects/pbx_build_file_test.rb", "test/objects/pbx_container_item_proxy_test.rb", "test/objects/pbx_group_test.rb", "test/objects/pbx_native_target_test.rb", "test/objects/pbx_project_test.rb", "test/objects/pbx_target_dependency_test.rb", "test/objects/xc_configuration_list_test.rb", "test/objects/xcode_object_test.rb", "test/plugins/core/core_test.rb", "test/plugins/import_test.rb", "test/plugins/irb_test.rb", "test/plugins/ls_test.rb", "test/plugins/retarget_test.rb", "test/plugins/test_helper.rb", "test/shortcuts_test.rb", "testdata/FlatTestApp/FlatTestApp.xcodeproj/project.pbxproj", "testdata/project.pbxproj", "testdata/project.pbxproj.compat", "testdata/TestApp/TestApp.xcodeproj/project.pbxproj", "testdata/ZergSupport.xcodeproj/project.pbxproj", "zerg_xcode.gemspec"]
14
+ s.extra_rdoc_files = ["bin/zerg-xcode", "CHANGELOG", "lib/zerg_xcode/file_format/archiver.rb", "lib/zerg_xcode/file_format/encoder.rb", "lib/zerg_xcode/file_format/lexer.rb", "lib/zerg_xcode/file_format/parser.rb", "lib/zerg_xcode/file_format/paths.rb", "lib/zerg_xcode/objects/pbx_build_file.rb", "lib/zerg_xcode/objects/pbx_container_item_proxy.rb", "lib/zerg_xcode/objects/pbx_group.rb", "lib/zerg_xcode/objects/pbx_native_target.rb", "lib/zerg_xcode/objects/pbx_project.rb", "lib/zerg_xcode/objects/pbx_target_dependency.rb", "lib/zerg_xcode/objects/xc_configuration_list.rb", "lib/zerg_xcode/objects/xcode_object.rb", "lib/zerg_xcode/plugins/core/core.rb", "lib/zerg_xcode/plugins/help.rb", "lib/zerg_xcode/plugins/import.rb", "lib/zerg_xcode/plugins/irb.rb", "lib/zerg_xcode/plugins/ls.rb", "lib/zerg_xcode/plugins/lstargets.rb", "lib/zerg_xcode/plugins/retarget.rb", "lib/zerg_xcode/shortcuts.rb", "lib/zerg_xcode.rb", "LICENSE", "README.textile"]
15
+ s.files = ["bin/zerg-xcode", "CHANGELOG", "lib/zerg_xcode/file_format/archiver.rb", "lib/zerg_xcode/file_format/encoder.rb", "lib/zerg_xcode/file_format/lexer.rb", "lib/zerg_xcode/file_format/parser.rb", "lib/zerg_xcode/file_format/paths.rb", "lib/zerg_xcode/objects/pbx_build_file.rb", "lib/zerg_xcode/objects/pbx_container_item_proxy.rb", "lib/zerg_xcode/objects/pbx_group.rb", "lib/zerg_xcode/objects/pbx_native_target.rb", "lib/zerg_xcode/objects/pbx_project.rb", "lib/zerg_xcode/objects/pbx_target_dependency.rb", "lib/zerg_xcode/objects/xc_configuration_list.rb", "lib/zerg_xcode/objects/xcode_object.rb", "lib/zerg_xcode/plugins/core/core.rb", "lib/zerg_xcode/plugins/help.rb", "lib/zerg_xcode/plugins/import.rb", "lib/zerg_xcode/plugins/irb.rb", "lib/zerg_xcode/plugins/ls.rb", "lib/zerg_xcode/plugins/lstargets.rb", "lib/zerg_xcode/plugins/retarget.rb", "lib/zerg_xcode/shortcuts.rb", "lib/zerg_xcode.rb", "LICENSE", "Manifest", "Rakefile", "README.textile", "RUBYFORGE", "test/file_format/archiver_test.rb", "test/file_format/encoder_test.rb", "test/file_format/lexer_test.rb", "test/file_format/parser_test.rb", "test/file_format/path_test.rb", "test/objects/pbx_build_file_test.rb", "test/objects/pbx_container_item_proxy_test.rb", "test/objects/pbx_group_test.rb", "test/objects/pbx_native_target_test.rb", "test/objects/pbx_project_test.rb", "test/objects/pbx_target_dependency_test.rb", "test/objects/xc_configuration_list_test.rb", "test/objects/xcode_object_test.rb", "test/plugins/core/core_test.rb", "test/plugins/import_test.rb", "test/plugins/irb_test.rb", "test/plugins/ls_test.rb", "test/plugins/lstargets_test.rb", "test/plugins/retarget_test.rb", "test/plugins/test_helper.rb", "test/shortcuts_test.rb", "testdata/FlatTestApp/FlatTestApp.xcodeproj/project.pbxproj", "testdata/project.pbxproj", "testdata/project.pbxproj.compat", "testdata/TestApp/TestApp.xcodeproj/project.pbxproj", "testdata/ZergSupport.xcodeproj/project.pbxproj", "zerg_xcode.gemspec"]
16
16
  s.has_rdoc = true
17
17
  s.homepage = %q{http://www.zergling.net/}
18
18
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Zerg_xcode", "--main", "README.textile"]
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.rubyforge_project = %q{zerglings}
21
21
  s.rubygems_version = %q{1.3.1}
22
22
  s.summary = %q{Automated modifications for Xcode project files}
23
- s.test_files = ["test/file_format/archiver_test.rb", "test/file_format/encoder_test.rb", "test/file_format/lexer_test.rb", "test/file_format/parser_test.rb", "test/file_format/path_test.rb", "test/objects/pbx_build_file_test.rb", "test/objects/pbx_container_item_proxy_test.rb", "test/objects/pbx_group_test.rb", "test/objects/pbx_native_target_test.rb", "test/objects/pbx_project_test.rb", "test/objects/pbx_target_dependency_test.rb", "test/objects/xc_configuration_list_test.rb", "test/objects/xcode_object_test.rb", "test/plugins/core/core_test.rb", "test/plugins/import_test.rb", "test/plugins/irb_test.rb", "test/plugins/ls_test.rb", "test/plugins/retarget_test.rb", "test/plugins/test_helper.rb", "test/shortcuts_test.rb"]
23
+ s.test_files = ["test/file_format/archiver_test.rb", "test/file_format/encoder_test.rb", "test/file_format/lexer_test.rb", "test/file_format/parser_test.rb", "test/file_format/path_test.rb", "test/objects/pbx_build_file_test.rb", "test/objects/pbx_container_item_proxy_test.rb", "test/objects/pbx_group_test.rb", "test/objects/pbx_native_target_test.rb", "test/objects/pbx_project_test.rb", "test/objects/pbx_target_dependency_test.rb", "test/objects/xc_configuration_list_test.rb", "test/objects/xcode_object_test.rb", "test/plugins/core/core_test.rb", "test/plugins/import_test.rb", "test/plugins/irb_test.rb", "test/plugins/ls_test.rb", "test/plugins/lstargets_test.rb", "test/plugins/retarget_test.rb", "test/plugins/test_helper.rb", "test/shortcuts_test.rb"]
24
24
 
25
25
  if s.respond_to? :specification_version then
26
26
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zerg_xcode
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.2"
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-27 00:00:00 -05:00
12
+ date: 2009-02-28 00:00:00 -05:00
13
13
  default_executable: bin/zerg-xcode
14
14
  dependencies: []
15
15
 
@@ -40,6 +40,7 @@ extra_rdoc_files:
40
40
  - lib/zerg_xcode/plugins/import.rb
41
41
  - lib/zerg_xcode/plugins/irb.rb
42
42
  - lib/zerg_xcode/plugins/ls.rb
43
+ - lib/zerg_xcode/plugins/lstargets.rb
43
44
  - lib/zerg_xcode/plugins/retarget.rb
44
45
  - lib/zerg_xcode/shortcuts.rb
45
46
  - lib/zerg_xcode.rb
@@ -66,6 +67,7 @@ files:
66
67
  - lib/zerg_xcode/plugins/import.rb
67
68
  - lib/zerg_xcode/plugins/irb.rb
68
69
  - lib/zerg_xcode/plugins/ls.rb
70
+ - lib/zerg_xcode/plugins/lstargets.rb
69
71
  - lib/zerg_xcode/plugins/retarget.rb
70
72
  - lib/zerg_xcode/shortcuts.rb
71
73
  - lib/zerg_xcode.rb
@@ -91,6 +93,7 @@ files:
91
93
  - test/plugins/import_test.rb
92
94
  - test/plugins/irb_test.rb
93
95
  - test/plugins/ls_test.rb
96
+ - test/plugins/lstargets_test.rb
94
97
  - test/plugins/retarget_test.rb
95
98
  - test/plugins/test_helper.rb
96
99
  - test/shortcuts_test.rb
@@ -149,6 +152,7 @@ test_files:
149
152
  - test/plugins/import_test.rb
150
153
  - test/plugins/irb_test.rb
151
154
  - test/plugins/ls_test.rb
155
+ - test/plugins/lstargets_test.rb
152
156
  - test/plugins/retarget_test.rb
153
157
  - test/plugins/test_helper.rb
154
158
  - test/shortcuts_test.rb