xcody 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 513ef68b72eb3faf7db723da85e8134ba570fff1
4
- data.tar.gz: 249ead6156a1ef3f7f629ac893139b343699f859
3
+ metadata.gz: d0bf4fd8ef5313140981d5b3fc7090f36bc3f4ea
4
+ data.tar.gz: 5fdbdf31338cadfa49b124c76a521b61cb25b4c3
5
5
  SHA512:
6
- metadata.gz: d8723599caf54c0df4da609c3732b1b0c3282793856f5b39198e8e53ef29b81d97accd2cce5ac71b727cbbff00c12648b32150d0af889c0d5bea3075b198edce
7
- data.tar.gz: bf6bbda352611dd3574c51186a1e44f2fe6feb7e324eed79a9defdd7ac5349797d29739b6d79cafdf5869190ff63718440318019b5570a02cc65f213a15e7670
6
+ metadata.gz: 49de766173aaf12008ef0cf7fb80247ab98d5fead5d1865721cbfe2e6ec5bc734790d58bba4c41d00c0ed2e79bbd440b308ce5a7a6f7c4245fc39b8557bca44d
7
+ data.tar.gz: 0d3ec459fbc1944ceaba5106e411b5af05ac4808d2566c10419e343b61407c53ed4320f32bc541b9c79b0d6d90b486aa608c30d0730ef46bedd489aeff284373
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Xcody
2
2
 
3
- TODO: Write a gem description
3
+ Simple wrapper for Xcode commands with Ruby.
4
+ Please use other library if you would like to use rich features.
5
+ e.g. https://github.com/CocoaPods/Xcodeproj
4
6
 
5
7
  ## Installation
6
8
 
@@ -20,11 +22,14 @@ Or install it yourself as:
20
22
 
21
23
  ## Usage
22
24
 
23
- TODO: Write usage instructions here
25
+ ```
26
+ # Build "your_project.xcodeproj"
27
+ Xcody.new.xcode_build.project("your_project.xcodeproj").build.run
28
+ ```
24
29
 
25
30
  ## Contributing
26
31
 
27
- 1. Fork it ( https://github.com/[my-github-username]/xcody/fork )
32
+ 1. Fork it ( https://github.com/KazuCocoa/xcody/fork )
28
33
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
34
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
35
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,5 +1,7 @@
1
1
  require "xcody/version"
2
2
  require "pathname"
3
+ require "fileutils"
4
+ require "Open3"
3
5
 
4
6
  class Xcody
5
7
  def initialize
@@ -155,12 +157,32 @@ class Xcody
155
157
  # @return [String] xcode build command
156
158
  def build
157
159
  @xcode_build_cmd.concat(%( build))
160
+ self
158
161
  end
159
162
 
160
163
  def clear_cmd
161
164
  @xcode_build_cmd = ""
162
165
  end
163
166
 
167
+ def run(log_file = "./tmp/build_log.txt")
168
+ puts "running with #{@xcode_build_cmd.inspect}"
169
+
170
+ log_file_dir = Pathname.new(log_file).dirname
171
+ FileUtils.mkdir_p(log_file_dir)
172
+
173
+ out_with_err, status = Open3.capture2e(@xcode_build_cmd)
174
+ exit_code = status.exitstatus
175
+ case exit_code
176
+ when 0
177
+ File.write(log_file, out_with_err)
178
+ puts "Build success. Logfile is in #{log_file}"
179
+ else
180
+ File.write(log_file, out_with_err)
181
+ File.write(log_file, out_with_err)
182
+ puts "Exit build with error status: #{exit_code}"
183
+ end
184
+ end
185
+
164
186
  private
165
187
 
166
188
  def xcode_path
@@ -1,3 +1,3 @@
1
1
  class Xcody
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-08 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Simple Xcode command wrapper
14
14
  email: