cocoapods 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -60,6 +60,10 @@ The load time can be improved a bit by compiling the Ruby source files:
60
60
 
61
61
  ## Contact
62
62
 
63
+ IRC:
64
+
65
+ * #cocoapods on `irc.freenode.net`
66
+
63
67
  Eloy Durán:
64
68
 
65
69
  * http://github.com/alloy
@@ -1,5 +1,5 @@
1
1
  module Pod
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
 
4
4
  class Informative < StandardError
5
5
  end
@@ -36,7 +36,8 @@ module Pod
36
36
  " * $ pod setup --help\n" \
37
37
  " * $ pod search --help\n" \
38
38
  " * $ pod install --help\n" \
39
- " * $ pod repo --help"
39
+ " * $ pod repo --help\n" \
40
+ " * $ pod spec --help"
40
41
  end
41
42
 
42
43
  def self.options
@@ -89,3 +90,4 @@ module Pod
89
90
  end
90
91
  end
91
92
  end
93
+
@@ -7,21 +7,57 @@ module Pod
7
7
  $ pod help spec
8
8
 
9
9
  pod spec create NAME
10
- Creates a directory for your new pod, named `NAME', with a default
11
- directory structure and accompanying `NAME.podspec'.
12
-
13
- pod spec init NAME
14
10
  Creates a PodSpec, in the current working dir, called `NAME.podspec'.
15
- Use this for existing libraries.
16
11
 
17
- pod spec lint NAME
18
- Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
19
- omitted, it defaults to the PodSpec in the current working dir.
12
+ pod spec lint NAME.podspec
13
+ Validates `NAME.podspec'. In case `NAME.podspec' is omitted, it defaults
14
+ to `*.podspec' in the current working dir.}
15
+ end
16
+
17
+ def initialize(argv)
18
+ args = argv.arguments
19
+ unless (args[0] == 'create' && args.size == 2) ||
20
+ (args[0] == 'lint' && args.size <= 2)
21
+ super
22
+ end
23
+ @action, @name = args.first(2)
24
+ end
25
+
26
+ def run
27
+ send @action
28
+ end
29
+
30
+ def create
31
+ author = `git config --get user.name`.strip
32
+ email = `git config --get user.email`.strip
33
+ spec = <<-SPEC.gsub(/^ /, '')
34
+ Pod::Spec.new do
35
+ name '#{@name}'
36
+ version '1.0.0'
37
+ summary 'A short description of #{@name}.'
38
+ homepage 'http://example.com/#{@name}'
39
+ author '#{author}' => '#{email}'
40
+ source :git => 'http://example.com/#{@name}.git',
41
+ :tag => '1.0.0'
42
+
43
+ description 'An optional longer description of #{@name}.'
44
+
45
+ # A list of file patterns. If the pattern is a directory then the path will
46
+ # automatically have '*.{h,m,mm,c,cpp' appended.
47
+ source_files 'Classes', 'Classes/**/*.{h,m}'
48
+
49
+ xcconfig 'OTHER_LDFLAGS' => '-framework SomeRequiredFramework'
50
+
51
+ dependency 'SomeLibraryThat#{@name}DependsOn', '>= 1.0.0'
52
+ end
53
+ SPEC
54
+ (Pathname.pwd + "#{@name}.podspec").open('w') { |f| f << spec }
55
+ end
20
56
 
21
- pod spec push REMOTE
22
- Validates `NAME.podspec' in the current working dir, copies it to the
23
- local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
24
- spec-repo. In case `REMOTE' is omitted, it defaults to `master'.}
57
+ def lint
58
+ file = @name ? Pathname.new(@name) : Pathname.pwd.glob('*.podspec').first
59
+ spec = Specification.from_podspec(file)
60
+ spec.validate!
25
61
  end
26
62
  end
27
63
  end
@@ -21,7 +21,7 @@ module Pod
21
21
 
22
22
  def initialize(&block)
23
23
  @dependencies = []
24
- @xcconfig = {}
24
+ @xcconfig = Xcode::Config.new
25
25
  instance_eval(&block) if block_given?
26
26
  end
27
27
 
@@ -45,7 +45,7 @@ module Pod
45
45
  authors = list.last.is_a?(Hash) ? list.pop : {}
46
46
  list.each { |name| authors[name] = nil }
47
47
  end
48
- @authors = authors || list
48
+ @authors = authors || list.first
49
49
  end
50
50
  alias_method :author, :authors
51
51
 
@@ -87,9 +87,21 @@ module Pod
87
87
  end
88
88
 
89
89
  def xcconfig(hash)
90
- @xcconfig = hash
90
+ @xcconfig.merge!(hash)
91
91
  end
92
92
 
93
+ def frameworks(*frameworks)
94
+ frameworks.unshift('')
95
+ xcconfig 'OTHER_LDFLAGS' => frameworks.join(' -framework ').strip
96
+ end
97
+ alias_method :framework, :frameworks
98
+
99
+ def libraries(*libraries)
100
+ libraries.unshift('')
101
+ xcconfig 'OTHER_LDFLAGS' => libraries.join(' -l ').strip
102
+ end
103
+ alias_method :library, :libraries
104
+
93
105
  # Not attributes
94
106
 
95
107
  include Config::Mixin
@@ -144,6 +156,22 @@ module Pod
144
156
  "#<#{self.class.name} for #{to_s}>"
145
157
  end
146
158
 
159
+ def validate!
160
+ attrs = []
161
+ attrs << "`name'" unless @name
162
+ attrs << "`version'" unless @version
163
+ attrs << "`summary'" unless @summary
164
+ attrs << "`homepage'" unless @homepage
165
+ attrs << "`author(s)'" unless @authors
166
+ attrs << "either `source' or `part_of'" unless @source || @part_of
167
+ attrs << "`source_files'" unless @source_files
168
+ unless attrs.empty?
169
+ raise Informative, "The following required " \
170
+ "#{attrs.size == 1 ? 'attribute is' : 'attributes are'} " \
171
+ "missing: #{attrs.join(", ")}"
172
+ end
173
+ end
174
+
147
175
  # Install and download hooks
148
176
 
149
177
  # Places the activated specification in the project's pods directory.
@@ -1,17 +1,17 @@
1
1
  module Pod
2
2
  module Xcode
3
3
  class Config
4
- def initialize(xcconfig_hash = {})
4
+ def initialize(xcconfig = {})
5
5
  @attributes = {}
6
- merge!(xcconfig_hash)
6
+ merge!(xcconfig)
7
7
  end
8
8
 
9
9
  def to_hash
10
10
  @attributes
11
11
  end
12
12
 
13
- def merge!(xcconfig_hash)
14
- xcconfig_hash.each do |key, value|
13
+ def merge!(xcconfig)
14
+ xcconfig.to_hash.each do |key, value|
15
15
  if existing_value = @attributes[key]
16
16
  @attributes[key] = "#{existing_value} #{value}"
17
17
  else
@@ -186,6 +186,7 @@
186
186
  DSTROOT = /tmp/Pods.dst;
187
187
  GCC_PRECOMPILE_PREFIX_HEADER = YES;
188
188
  GCC_PREFIX_HEADER = "Pods-Prefix.pch";
189
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
189
190
  OTHER_LDFLAGS = "-ObjC";
190
191
  PRODUCT_NAME = "$(TARGET_NAME)";
191
192
  SKIP_INSTALL = YES;
@@ -199,6 +200,7 @@
199
200
  DSTROOT = /tmp/Pods.dst;
200
201
  GCC_PRECOMPILE_PREFIX_HEADER = YES;
201
202
  GCC_PREFIX_HEADER = "Pods-Prefix.pch";
203
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
202
204
  OTHER_LDFLAGS = "-ObjC";
203
205
  PRODUCT_NAME = "$(TARGET_NAME)";
204
206
  SKIP_INSTALL = YES;
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 3
10
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
11
10
  platform: ruby
12
11
  authors:
13
12
  - Eloy Duran
@@ -15,7 +14,8 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-09-17 00:00:00 Z
17
+ date: 2011-09-17 00:00:00 +02:00
18
+ default_executable:
19
19
  dependencies: []
20
20
 
21
21
  description: |-
@@ -54,6 +54,7 @@ files:
54
54
  - bin/pod
55
55
  - README.md
56
56
  - LICENSE
57
+ has_rdoc: true
57
58
  homepage: https://github.com/alloy/cocoapods
58
59
  licenses:
59
60
  - MIT
@@ -68,27 +69,23 @@ rdoc_options: []
68
69
  require_paths:
69
70
  - lib
70
71
  required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- hash: 3
76
75
  segments:
77
76
  - 0
78
77
  version: "0"
79
78
  required_rubygems_version: !ruby/object:Gem::Requirement
80
- none: false
81
79
  requirements:
82
80
  - - ">="
83
81
  - !ruby/object:Gem::Version
84
- hash: 3
85
82
  segments:
86
83
  - 0
87
84
  version: "0"
88
85
  requirements: []
89
86
 
90
87
  rubyforge_project:
91
- rubygems_version: 1.8.7
88
+ rubygems_version: 1.3.6
92
89
  signing_key:
93
90
  specification_version: 3
94
91
  summary: A simple Objective-C library package manager. (Requires MacRuby.)