cocoaseeds 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdb06a6e2f28269050091e98cf14e62cdf70c25e
4
- data.tar.gz: c36dcd7038e7fbd2ff1198b25ef57ad08524bd06
3
+ metadata.gz: 886c78815e21ba590aa79fc3de8747fa5368571f
4
+ data.tar.gz: 0dfaa0809236b86c81e3a408c6cdfe5b1743375a
5
5
  SHA512:
6
- metadata.gz: c9c2ee3d69bc4360d08f15f1b1c714c69756c58ecd13d9d89a4cf0f457cae10d240c99ac35bab8758bd051ef097665efa85e080859be2236e24ceeb1d61c0245
7
- data.tar.gz: fdd266dbc38cbe9abc6b5f027df2edc071619d2b45cad7cfba3308162ad7df177623ad74780e7e16eca7294b657fcf31d8003be8f7fe3fa23d911f59493da315
6
+ metadata.gz: 65a198e29c1ff5f71c2ef9c76bc52ef90118e2f4902a595689249654ed8a7d39e0d742d92ab24a0c7e96c3150029aac7c3a29ba9c7bfa8993a69abfab1c9b681
7
+ data.tar.gz: d4102131c54cb2bdb7ba23a476601f89044ac6ee47aae69db8e406cc401bc02672f8622305d0f78d46fb0a0d13c76ef2b7aa4f9298f6bdf472a25d13d036cd35
data/README.md CHANGED
@@ -86,6 +86,18 @@ target :MyAppTest do
86
86
  end
87
87
  ```
88
88
 
89
+ #### Specifying Xcode project file path
90
+
91
+ If the .xcodeproj file is located in other location, you can specify the path in Seedfile.
92
+
93
+ ```ruby
94
+ xcodeproj "path/to/Project.xcodeproj"
95
+
96
+ target :MyApp do
97
+ github "devxoul/JLToast", "1.2.5", :files => "JLToast/*.{swift,h}"
98
+ end
99
+ ```
100
+
89
101
  ### 2. Install dependencies
90
102
 
91
103
  After you are done with your Seedfile, it's time to load those libraries into your project. This is pretty simple. Just open the terminal, cd to your project directory and execute `seed install` command.
@@ -126,10 +126,9 @@ module Seeds
126
126
  def prepare_requirements
127
127
  # .xcodeproj
128
128
  project_filename = Dir.glob("#{root_path}/*.xcodeproj")[0]
129
- if not project_filename
130
- raise Seeds::Exception.new "Couldn't find .xcodeproj file."
129
+ if project_filename
130
+ self.project = Xcodeproj::Project.open(project_filename)
131
131
  end
132
- self.project = Xcodeproj::Project.open(project_filename)
133
132
 
134
133
  # Seedfile
135
134
  begin
@@ -186,6 +185,17 @@ module Seeds
186
185
  @swift_seedname_prefix = true
187
186
  end
188
187
 
188
+ # Set current Xcode project with given path.
189
+ #
190
+ # @!scope method
191
+ # @!visibility private
192
+ #
193
+ def xcodeproj(path)
194
+ proejct_filename = File.join(self.root_path, path)
195
+ self.project = Xcodeproj::Project.open(proejct_filename)
196
+ self.validate_project
197
+ end
198
+
189
199
  # Sets `@current_target_name` and executes code block.
190
200
  #
191
201
  # @param [String] names The name of target.
@@ -194,6 +204,7 @@ module Seeds
194
204
  # @!visibility private
195
205
  #
196
206
  def target(*names, &code)
207
+ self.validate_project
197
208
  names.each do |name|
198
209
  name = name.to_s # use string instead of symbol
199
210
  target = self.project.target_named(name)
@@ -216,6 +227,7 @@ module Seeds
216
227
  # @!visibility private
217
228
  #
218
229
  def github(repo, tag, options={})
230
+ self.validate_project
219
231
  if not @current_target_name # apply to all targets
220
232
  target *self.project.targets.map(&:name) do
221
233
  send(__callee__, repo, tag, options)
@@ -262,6 +274,7 @@ module Seeds
262
274
  # @!visibility private
263
275
  #
264
276
  def bitbucket(repo, tag, options={})
277
+ self.validate_project
265
278
  if not @current_target_name # apply to all targets
266
279
  target *self.project.targets.map(&:name) do
267
280
  send(__callee__, repo, tag, options)
@@ -567,6 +580,12 @@ module Seeds
567
580
  File.write(self.lockfile_path, YAML.dump(tree))
568
581
  end
569
582
 
583
+ def validate_project
584
+ if self.project.nil?
585
+ raise Seeds::Exception.new "Couldn't find .xcodeproj file."
586
+ end
587
+ end
588
+
570
589
  # Prints a message if {#mute} is `false`.
571
590
  #
572
591
  # @see #mute
@@ -1,3 +1,3 @@
1
1
  module Seeds
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoaseeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyeol Jeon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj