calasmash 0.0.7 → 0.0.8

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.
Files changed (3) hide show
  1. data/lib/calasmash/version.rb +1 -1
  2. data/lib/calasmash.rb +40 -11
  3. metadata +2 -2
@@ -1,3 +1,3 @@
1
1
  module Calasmash
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
data/lib/calasmash.rb CHANGED
@@ -4,6 +4,7 @@ require 'optparse'
4
4
  require 'socket'
5
5
  require 'cfpropertylist'
6
6
  require 'find'
7
+ require 'open3'
7
8
 
8
9
  module Calasmash
9
10
  class Runner
@@ -78,13 +79,26 @@ module Calasmash
78
79
 
79
80
  def compile
80
81
  puts "Compiling..."
81
- IO.popen("xcodebuild -workspace #{@options[:workspace]} -scheme #{@options[:scheme]} -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO") {|output|
82
- puts output.read
83
- }
84
82
 
85
- if $?.to_i > 0
86
- puts "Compilation failed"
87
- exit $?.to_i
83
+ status = nil
84
+ xcode_command = "xcodebuild -workspace #{@options[:workspace]} -scheme #{@options[:scheme]} -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO"
85
+ Open3.popen3 xcode_command do |stdin, out, err, wait_thr|
86
+
87
+ [out, err].each do |stream|
88
+ Thread.new do
89
+ until (line = stream.gets).nil? do
90
+ puts line
91
+ end
92
+ end
93
+ end
94
+
95
+ wait_thr.join
96
+ status = wait_thr.value.exitstatus
97
+ end
98
+
99
+ if status != 0
100
+ puts "Compilation failed: #{status}"
101
+ exit status
88
102
  end
89
103
  end
90
104
 
@@ -122,12 +136,27 @@ module Calasmash
122
136
  cucumber_command = "cucumber OS=ios7 SDK_VERSION=7.0 DEVICE_TARGET=simulator"
123
137
  cucumber_command += optional_params
124
138
 
125
- IO.popen(cucumber_command) {|output|
126
- puts output.read
127
- }
139
+ status = nil
140
+ Open3.popen3 cucumber_command do |stdin, out, err, wait_thr|
141
+
142
+ [out, err].each do |stream|
143
+ Thread.new do
144
+ until (line = stream.gets).nil? do
145
+ puts line
146
+ end
147
+ end
148
+ end
149
+
150
+ wait_thr.join
151
+ status = wait_thr.value.exitstatus
152
+ end
153
+
154
+ if status != 0
155
+ puts "Cucumber failed: #{status}"
156
+ end
128
157
 
129
- # exit with whatever status cucumber has exited
130
- exit $?.to_i
158
+ # exit with whatever status Cucumber has exited
159
+ exit status
131
160
  end
132
161
 
133
162
  def app_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calasmash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-25 00:00:00.000000000 Z
12
+ date: 2013-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler