Commit f70d430d authored by Fabio Pelosin's avatar Fabio Pelosin

Added ActiveSupport as dependency.

parent c832f39b
...@@ -9,6 +9,7 @@ PATH ...@@ -9,6 +9,7 @@ PATH
remote: . remote: .
specs: specs:
cocoapods (0.6.1) cocoapods (0.6.1)
activesupport (~> 3.2.6)
colored (~> 1.2) colored (~> 1.2)
escape (~> 0.0.4) escape (~> 0.0.4)
faraday (~> 0.8.1) faraday (~> 0.8.1)
...@@ -21,6 +22,9 @@ PATH ...@@ -21,6 +22,9 @@ PATH
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
activesupport (3.2.6)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.8) addressable (2.2.8)
awesome_print (1.0.2) awesome_print (1.0.2)
bacon (1.1.0) bacon (1.1.0)
...@@ -35,6 +39,7 @@ GEM ...@@ -35,6 +39,7 @@ GEM
ffi (1.0.11) ffi (1.0.11)
github-markup (0.7.2) github-markup (0.7.2)
hashie (1.2.0) hashie (1.2.0)
i18n (0.6.0)
json (1.7.3) json (1.7.3)
kicker (2.6.0) kicker (2.6.0)
listen listen
......
...@@ -34,6 +34,7 @@ Gem::Specification.new do |s| ...@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'open4', '~> 1.3.0' s.add_runtime_dependency 'open4', '~> 1.3.0'
s.add_runtime_dependency 'rake', '~> 0.9.0' s.add_runtime_dependency 'rake', '~> 0.9.0'
s.add_runtime_dependency 'xcodeproj', '~> 0.2.1' s.add_runtime_dependency 'xcodeproj', '~> 0.2.1'
s.add_runtime_dependency 'activesupport', '~> 3.2.6'
s.add_development_dependency 'bacon', '~> 1.1' s.add_development_dependency 'bacon', '~> 1.1'
......
require 'xcodeproj/config' require 'xcodeproj/config'
require 'active_support/core_ext/string/strip.rb'
module Pod module Pod
extend Config::Mixin extend Config::Mixin
...@@ -190,29 +191,27 @@ module Pod ...@@ -190,29 +191,27 @@ module Pod
top_attr_accessor :documentation top_attr_accessor :documentation
top_attr_accessor :requires_arc top_attr_accessor :requires_arc
top_attr_accessor :version, lambda { |v| Version.new(v) } top_attr_accessor :version, lambda { |v| Version.new(v) }
top_attr_accessor :license, lambda { |l| parse_license(l) }
top_attr_accessor :authors, lambda { |a| parse_authors(a) } top_attr_accessor :authors, lambda { |a| parse_authors(a) }
top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary } top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary }
top_attr_writer :description, lambda { |d| strip_heredoc(d) } top_attr_writer :description, lambda { |d| d.strip_heredoc }
alias_method :author=, :authors= alias_method :author=, :authors=
# Strips indentation in heredocs. # @!method license
# #
# @note Adapted from Ruby on Rails. # @abstract
# The license of the pod.
# #
def self.strip_heredoc(string) # @example
min_indent = string.scan(/^[ \t]*(?=\S)/).min # s.license = 'MIT'
indent = min_indent ? min_indent.size : 0 # s.license = { :type => 'MIT', :file => 'license.txt', :text => 'Permission is granted to...' }
string.gsub(/^[ \t]{#{indent}}/, '') #
end top_attr_accessor :license, lambda { |license|
def self.parse_license(license)
license = ( license.kind_of? String ) ? { :type => license } : license license = ( license.kind_of? String ) ? { :type => license } : license
license[:text] = strip_heredoc(license[:text]) if license[:text] license[:text] = license[:text].strip_heredoc if license[:text]
license license
end }
def self.parse_authors(*names_and_email_addresses) def self.parse_authors(*names_and_email_addresses)
list = names_and_email_addresses.flatten list = names_and_email_addresses.flatten
......
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