xcodeproject 0.3.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -28,6 +28,10 @@ Or you can find all projects are located in the specified directory:
28
28
 
29
29
  projs = XcodeProject::Project.find_projs('path/to/dir')
30
30
 
31
+ Or by specified directory pattern:
32
+
33
+ projs = XcodeProject::Project.find_projs('*/**')
34
+
31
35
  After creating the project object, you can read the data from it:
32
36
 
33
37
  data = proj.read
@@ -31,12 +31,11 @@ module XcodeProject
31
31
  attr_reader :file_path
32
32
  attr_reader :name
33
33
 
34
- def self.find_projs (path)
35
- projs = []
36
- Find.find path do |path|
37
- projs.push(Project.new(path)) if path =~ /\A.*\.xcodeproj\z/
38
- end
39
- projs
34
+ def self.find (pattern = nil)
35
+ pattern = Pathname.new(pattern.to_s)
36
+ pattern = pattern.join('*.xcodeproj') if pattern.extname != '.xcodeproj'
37
+
38
+ Dir[ pattern ].map {|path| self.new(path) }
40
39
  end
41
40
 
42
41
  def initialize (path)
@@ -4,15 +4,25 @@ module XcodeProject
4
4
  module Tasks
5
5
  class BuildTask < XcodeBuild::Tasks::BuildTask
6
6
  attr_accessor :with_build_opts
7
+ attr_accessor :build_to
7
8
 
8
- def initialize (project, &block)
9
- super(project.name, &block)
10
-
11
- @with_build_opts ||= []
12
- @formatter ||= XcodeBuild::Formatters::ProgressFormatter.new
9
+ def initialize (project, namespace = nil, &block)
10
+ namespace ||= project.name
11
+ super(namespace, &block)
13
12
 
14
13
  @project_name = project.bundle_path.basename.to_s
15
14
  @invoke_from_within = project.bundle_path.dirname
15
+
16
+ @formatter ||= XcodeBuild::Formatters::ProgressFormatter.new
17
+ @with_build_opts ||= []
18
+
19
+ unless @build_to.nil?
20
+ build_tmp_to = Pathname.new(@build_to).join('.tmp')
21
+
22
+ @with_build_opts << %{ CONFIGURATION_BUILD_DIR="#{@build_to}" }
23
+ @with_build_opts << %{ CONFIGURATION_TEMP_DIR="#{build_tmp_to}" }
24
+ @with_build_opts << %{ SYMROOT="#{build_tmp_to}" }
25
+ end
16
26
  end
17
27
 
18
28
  private
@@ -1,3 +1,3 @@
1
1
  module XcodeProject
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.5"
3
3
  end
data/spec/project_spec.rb CHANGED
@@ -30,18 +30,26 @@ describe XcodeProject::Project do
30
30
  end
31
31
  end
32
32
 
33
- describe "#find_projs" do
34
- context "if a path contains project files" do
33
+ describe "#find" do
34
+ context "if a specified directory contains project files" do
35
35
  it "returns an array of project objects" do
36
- projs = XcodeProject::Project.find_projs(example_sandbox_path)
36
+ projs = XcodeProject::Project.find(example_project_bundle_path)
37
+ projs.size.should eql(1)
38
+ projs.first.bundle_path.should eql(proj.bundle_path)
39
+ end
40
+ end
41
+
42
+ context "if a specified directory pattern contains project files" do
43
+ it "returns an array of project objects" do
44
+ projs = XcodeProject::Project.find("#{example_sandbox_path}/*")
37
45
  projs.size.should eql(1)
38
46
  projs.first.bundle_path.should eql(proj.bundle_path)
39
47
  end
40
48
  end
41
49
 
42
- context "if a path doesn't contain project files" do
50
+ context "if a specified directory doesn't contain project files" do
43
51
  it "returns an empty array" do
44
- projs = XcodeProject::Project.find_projs(example_empty_sandbox_path)
52
+ projs = XcodeProject::Project.find(example_empty_sandbox_path)
45
53
  projs.size.should eql(0)
46
54
  end
47
55
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 5
9
+ version: 0.3.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andrey Nesterov
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-06-27 00:00:00 +04:00
17
+ date: 2012-06-29 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency