Skip to content

Commit

Permalink
Merge branch 'master' into dedicated-targets
Browse files Browse the repository at this point in the history
* master:
  [ErrorReport] Fix issues search url
  Pods-resources.sh: Generate newlines between install_resource calls
  [Sandbox] Try to make an educated guess as to where the MacPorts prefix is.
  [Sandbox] Small cleanup.
  [Changelog] Add note about the path option and the sandbox [ci skip]
  [Command::Help] Show root help with 'pod help'
  [Specs] Use pretty bacon
  [Command] default to install
  [CHANGELOG] Add note about other package managers than Homebrew.
  [CHANGELOG] Cleanup last addition regarding sandbox.
  [CHANGELOG] Introduce the experimental sandbox feature.
  [Gemfile] Adopt local git repos feature of Bunlder
  [CopyResourcesScript] Fix permissions
  Update CHANGELOG.md
  [CopyResourcesScript] Restore compatiblity with Ruby 1.8.7
  [SpecHelper] Use Coveralls only in Ruby > 1.8
  [Gemspec] Bump json dep
  [SpecHelper] Don't require simplecov in Ruby 1.8.x
  • Loading branch information
fabiopelosin committed May 21, 2013
2 parents 806463e + be7e588 commit 24b0a27
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 246 deletions.
36 changes: 34 additions & 2 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,38 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides

###### Enhancements

* Introduces an experimental sandbox feature.
[#939](https://github.com/CocoaPods/CocoaPods/issues/939)

Let’s face it, even though we have a great community that spends an amazing
amount of time on curating the specifications, the internet can be a hostile
place and the community is growing too large to take a naive approach any
longer.

As such, we have started leveraging OS X’s sandbox facilities to disallow
unsanctioned operations. This is still very experimental and therefore has to
be used explicitely, for now, but that does **not** mean we don’t want you to
start using it and **report issues**.

To use the sandbox, simply use the `sandbox-pod` command instead. E.g.:

$ sandbox-pod install

In case of issues, be sure to check `/var/log/system.log` for ‘deny’ messages.
For instance, here’s an example where the sandbox denies read access to `/`:

May 16 00:23:35 Khaos kernel[0]: Sandbox: ruby(98430) deny file-read-data /

**NOTE**: _The above example is actually one that we know of. We’re not sure
yet which process causes this, but there shouldn’t be a need for any process
to read data from the root path anyways._

**NOTE 2**: _At the moment the sandbox is not compatible with the `:path` option
when referencing Pods that are not stored within the directory of the Podfile._

* The naked `pod` command now defaults to `pod install`.
[#958](https://github.com/CocoaPods/CocoaPods/issues/958)

* Documentation generation has been removed from CocoaPods as it graduated
to CocoaDocs. This decision was taken because CocoaDocs is a much better
solution which doesn't clutter Xcode's docsets while still allowing
Expand Down Expand Up @@ -69,8 +101,8 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides

###### Deprecations

* The `:local` flag in Podfile has been renamed to `:path` and has been
deprecated.
* The `:local` flag in Podfile has been renamed to `:path` and the old syntax
has been deprecated.
[#971](https://github.com/CocoaPods/CocoaPods/issues/971)

###### Bug fixes
Expand Down
15 changes: 6 additions & 9 deletions Gemfile
Expand Up @@ -6,19 +6,16 @@ end
gemspec

group :development do
if ENV['COCOA_PODS_DEPENDENCIES'] == 'local'
gem 'cocoapods-core', :path => '../Core'
gem 'xcodeproj', :path => '../Xcodeproj'
gem 'cocoapods-downloader', :path => '../cocoapods-downloader'
else
gem 'cocoapods-core', :git => "https://github.com/CocoaPods/Core.git", :branch => 'master'
gem 'xcodeproj', :git => "https://github.com/CocoaPods/Xcodeproj.git"
gem 'cocoapods-downloader', :git => "https://github.com/CocoaPods/cocoapods-downloader.git"
end
# To develop the deps in tandem use the `LOCAL GIT REPOS` feature of Bundler.
gem 'cocoapods-core', :git => "https://github.com/CocoaPods/Core.git", :branch => 'master'
gem 'xcodeproj', :git => "https://github.com/CocoaPods/Xcodeproj.git", :branch => 'master'
gem 'cocoapods-downloader', :git => "https://github.com/CocoaPods/cocoapods-downloader.git", :branch => 'master'
gem 'claide', :git => 'https://github.com/CocoaPods/CLAide.git', :branch => 'master'

gem "mocha"
gem "bacon"
gem "mocha-on-bacon"
gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
gem "rake"
gem 'coveralls', :require => false, :git => 'https://github.com/lemurheavy/coveralls-ruby.git'
end
Expand Down
10 changes: 6 additions & 4 deletions bin/sandbox-pod
Expand Up @@ -37,18 +37,20 @@ ruby_prefix = RbConfig::CONFIG['prefix']

prefixes = ['/bin', '/usr/bin', '/usr/libexec']
prefixes << `brew --prefix`.strip unless `which brew`.strip.empty?
# TODO add MacPorts. More?
# From asking people, it seems MacPorts does not have a `prefix` command, like
# Homebrew does, so make an educated guess:
unless (port = `which port`.strip).empty?
prefixes << File.dirname(File.dirname(port))
end

developer_prefix = `xcode-select --print-path`.strip
xcode_app_path = File.expand_path('../..', developer_prefix)


require 'erb'
profile = ERB.new(DATA.read, 0, '>').result(TOPLEVEL_BINDING)
puts profile
#puts profile

command = ['/usr/bin/sandbox-exec', '-p', profile, pod_bin, *ARGV]
#puts command
exec *command


Expand Down
2 changes: 1 addition & 1 deletion cocoapods.gemspec
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'octokit', '~> 1.7'
s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'json', '~> 1.7.3'
s.add_runtime_dependency 'json', '~> 1.8.0'
s.add_runtime_dependency 'open4', '~> 1.3.0'
s.add_runtime_dependency 'rake', '~> 10.0.0'
s.add_runtime_dependency 'activesupport', '~> 3.2.13'
Expand Down
1 change: 1 addition & 0 deletions lib/cocoapods/command.rb
Expand Up @@ -21,6 +21,7 @@ class Command < CLAide::Command
require 'cocoapods/command/podfile_info'

self.abstract_command = true
self.default_subcommand = 'install'
self.command = 'pod'
self.description = 'CocoaPods, the Objective-C library package manager.'

Expand Down
4 changes: 2 additions & 2 deletions lib/cocoapods/command/help.rb
Expand Up @@ -5,7 +5,7 @@ class Help < Command
self.arguments = '[COMMAND]'

def initialize(argv)
@help_command = Pod::Command.parse(argv) unless argv.empty?
@help_command = Pod::Command.parse(argv)
super
end

Expand All @@ -16,7 +16,7 @@ def run
private

def help_command
@help_command || self
@help_command
end
end
end
Expand Down
6 changes: 2 additions & 4 deletions lib/cocoapods/generator/copy_resources_script.rb
Expand Up @@ -2,8 +2,6 @@ module Pod
module Generator
class CopyResourcesScript

require 'fileutils'

# @return [Array<#to_s>] A list of files relative to the project pods
# root.
#
Expand Down Expand Up @@ -33,7 +31,7 @@ def save_as(pathname)
pathname.open('w') do |file|
file.puts(script)
end
FileUtils.chmod('+x', pathname.to_s)
File.chmod(0755, pathname.to_s)
end

private
Expand Down Expand Up @@ -72,7 +70,7 @@ def install_resources_function
def script
script = install_resources_function
resources.each do |resource|
script += "install_resource '#{resource}'"
script += "install_resource '#{resource}'\n"
end
script
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods/user_interface/error_report.rb
Expand Up @@ -45,7 +45,7 @@ def report(exception)
#{'[!] Oh no, an error occurred.'.red}
#{error_from_podfile(exception)}
#{'Search for existing github issues similar to yours:'.yellow}
#{"https://github.com/CocoaPods/CocoaPods/issues/search?q=#{CGI.escape(exception.message)}"}
#{"https://github.com/CocoaPods/CocoaPods/search?q=#{CGI.escape(exception.message)}&type=Issues"}
#{'If none exists, create a ticket, with the template displayed above, on:'.yellow}
https://github.com/CocoaPods/CocoaPods/issues/new
Expand Down
5 changes: 3 additions & 2 deletions spec/integration_2.rb
Expand Up @@ -47,8 +47,9 @@
#
ROOT = Pathname.new(File.expand_path('../../', __FILE__)) unless defined? ROOT

$:.unshift((ROOT + 'spec').to_s)
require 'spec_helper/bacon'
require 'rubygems'
require 'bundler/setup'
require 'pretty_bacon'
require 'colored'
require 'diffy'
require 'Xcodeproj' # For Differ
Expand Down
26 changes: 14 additions & 12 deletions spec/spec_helper.rb
Expand Up @@ -2,17 +2,19 @@
#-----------------------------------------------------------------------------#


if ENV['CI'] || ENV['GENERATE_COVERAGE']
require 'simplecov'
require 'coveralls'

if ENV['CI']
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
elsif ENV['GENERATE_COVERAGE']
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
end
SimpleCov.start do
add_filter "/spec_helper/"
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("1.9")
if ENV['CI'] || ENV['GENERATE_COVERAGE']
require 'simplecov'
require 'coveralls'

if ENV['CI']
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
elsif ENV['GENERATE_COVERAGE']
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
end
SimpleCov.start do
add_filter "/spec_helper/"
end
end
end

Expand All @@ -23,6 +25,7 @@
require 'bundler/setup'
require 'bacon'
require 'mocha-on-bacon'
require 'pretty_bacon'
require 'pathname'
require "active_support/core_ext/string/strip"

Expand All @@ -34,7 +37,6 @@
require 'claide'
require 'awesome_print'

require 'spec_helper/bacon' # Prettifies the bacon output and adds support for `xit`.
require 'spec_helper/command' # Allows to run Pod commands and returns their output.
require 'spec_helper/fixture' # Provides access to the fixtures and unpacks them if needed.
require 'spec_helper/temporary_repos' # Allows to create and modify temporary spec repositories.
Expand Down

0 comments on commit 24b0a27

Please sign in to comment.