Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaning

  • Loading branch information...
commit 575996d23f4fd2761a6b5d2c839b56ee9c357d32 1 parent bb50005
@alloy alloy authored
View
6 bin/pod
@@ -1,7 +1,9 @@
#!/usr/bin/env macruby
-$:.unshift File.expand_path('../../lib', __FILE__)
-$:.unshift File.expand_path('../../vendor/rubygems/lib', __FILE__)
+if $0 == __FILE__
+ $:.unshift File.expand_path('../../lib', __FILE__)
+ require 'rubygems'
+end
require 'cocoa_pods'
View
11 lib/cocoa_pods/command/install.rb
@@ -2,20 +2,13 @@ module Pod
class Command
class Install < Command
def run
- if spec = Specification.from_podfile(podfile)
+ if config.project_podfile.exist?
+ spec = Specification.from_podfile(config.project_podfile)
Installer.new(spec, config.project_pods_root).install!
else
$stderr.puts "No Podfile found in current working directory."
end
end
-
- def pods_root
- Pathname.new(Dir.pwd) + 'Pods'
- end
-
- def podfile
- File.join(Dir.pwd, 'Podfile')
- end
end
end
end
View
6 lib/cocoa_pods/config.rb
@@ -18,13 +18,17 @@ def initialize
end
def project_root
- Pathname.new(Dir.pwd)
+ Pathname.pwd
end
def project_pods_root
project_root + 'Pods'
end
+ def project_podfile
+ project_root + 'Podfile'
+ end
+
module Mixin
def config
Config.instance
View
19 lib/cocoa_pods/dependency.rb
@@ -5,5 +5,24 @@ module Gem
module Pod
class Dependency < Gem::Dependency
attr_accessor :part_of_other_pod
+
+ unless public_method_defined?(:merge)
+ def merge other
+ unless name == other.name then
+ raise ArgumentError,
+ "#{self} and #{other} have different names"
+ end
+
+ default = Gem::Requirement.default
+ self_req = self.requirement
+ other_req = other.requirement
+
+ return self.class.new name, self_req if other_req == default
+ return self.class.new name, other_req if self_req == default
+
+ self.class.new name, self_req.as_list.concat(other_req.as_list)
+ end
+ end
+
end
end
View
1  lib/cocoa_pods/installer.rb
@@ -24,6 +24,7 @@ def xproj
end
def install!
+ puts "Installing dependencies defined in: #{@top_level_specification.defined_in_file}"
install_dependent_specifications!
generate_project
write_files!
Please sign in to comment.
Something went wrong with that request. Please try again.