Commit 575996d2 authored by Eloy Duran's avatar Eloy Duran

Cleaning

parent bb500057
#!/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'
......
......@@ -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
......@@ -18,13 +18,17 @@ module Pod
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
......
......@@ -5,5 +5,24 @@ require 'rubygems/dependency'
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
......@@ -24,6 +24,7 @@ module Pod
end
def install!
puts "Installing dependencies defined in: #{@top_level_specification.defined_in_file}"
install_dependent_specifications!
generate_project
write_files!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment