fourflusher 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +26 -0
- data/.travis.yml +6 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fourflusher.gemspec +27 -0
- data/lib/fourflusher.rb +3 -0
- data/lib/fourflusher/compat.rb +21 -0
- data/lib/fourflusher/executable.rb +236 -0
- data/lib/fourflusher/find.rb +79 -0
- data/lib/fourflusher/simctl.rb +19 -0
- data/lib/fourflusher/version.rb +3 -0
- data/lib/fourflusher/xcodebuild.rb +11 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0b9b1b16d80d85f6951d9677e82ee5fa4ca8799b
|
4
|
+
data.tar.gz: 0988f174ba49fa20ed9f589d5c9e06413ab8d832
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4a22323c2beb75d477040ccad026f74b2f011f3893be39422d5077a4b4fcfa229fd8a12588dfa0fdbae18aa8f4e2f1ddbad096e7edecf4be46684d9849f84656
|
7
|
+
data.tar.gz: 0e38f04530f78e9893f9d26b015d4b2e080aa0add5792321ff15bdd30dda31c9ef2922c3719426137804debbfb3e41e8e4323d5efcb7f8934f3fd8ed922fa906
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Metrics/AbcSize:
|
2
|
+
Max: 25
|
3
|
+
|
4
|
+
Metrics/CyclomaticComplexity:
|
5
|
+
Max: 10
|
6
|
+
|
7
|
+
Metrics/LineLength:
|
8
|
+
Max: 100
|
9
|
+
|
10
|
+
Metrics/MethodLength:
|
11
|
+
Max: 30
|
12
|
+
|
13
|
+
Style/AsciiComments:
|
14
|
+
Exclude:
|
15
|
+
- 'lib/fourflusher/executable.rb'
|
16
|
+
|
17
|
+
Style/ClassVars:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/fourflusher/find.rb'
|
20
|
+
|
21
|
+
Style/Documentation:
|
22
|
+
Exclude:
|
23
|
+
- 'spec/**/*'
|
24
|
+
- 'test/**/*'
|
25
|
+
- 'lib/fourflusher/version.rb'
|
26
|
+
- 'lib/fourflusher/compat.rb'
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Boris Bügling
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# four-flusher
|
2
|
+
|
3
|
+
A library for interacting with Xcode simulators.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
TODO: Write usage instructions here
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'fourflusher'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install fourflusher
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
28
|
+
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/neonichu/fourflusher.
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'fourflusher'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/fourflusher.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'fourflusher/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'fourflusher'
|
8
|
+
spec.version = Fourflusher::VERSION
|
9
|
+
spec.authors = ['Boris Bügling']
|
10
|
+
spec.email = ['boris@icculus.org']
|
11
|
+
|
12
|
+
spec.summary = 'A library for interacting with Xcode simulators.'
|
13
|
+
spec.homepage = 'https://github.com/neonichu/fourflusher'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
}
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 2'
|
26
|
+
spec.add_development_dependency 'rubocop', '~> 0.35.0'
|
27
|
+
end
|
data/lib/fourflusher.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fourflusher
|
2
|
+
class Config
|
3
|
+
def self.instance
|
4
|
+
@instance || new
|
5
|
+
end
|
6
|
+
|
7
|
+
def verbose?
|
8
|
+
false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class UI
|
13
|
+
def self.indentation_level
|
14
|
+
0
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.message(message)
|
18
|
+
print(message)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,236 @@
|
|
1
|
+
require 'fourflusher/compat'
|
2
|
+
|
3
|
+
# This file is a verbatim copy from CocoaPods, a project licensed under the MIT license.
|
4
|
+
|
5
|
+
# Copyright (c) 2011 - 2015 Eloy Durán <eloy.de.enige@gmail.com>,
|
6
|
+
# Fabio Pelosin <fabiopelosin@gmail.com>,
|
7
|
+
# Samuel Giddins <segiddins@segiddins.me>,
|
8
|
+
# Marius Rackwitz <git@mariusrackwitz.de>,
|
9
|
+
# Kyle Fuller <kyle@fuller.li>,
|
10
|
+
# Boris Bügling <boris@buegling.com>,
|
11
|
+
# Orta Therox <orta.therox@gmail.com>, and
|
12
|
+
# Olivier Halligon <olivier@halligon.net>.
|
13
|
+
|
14
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
15
|
+
# of this software and associated documentation files (the "Software"), to deal
|
16
|
+
# in the Software without restriction, including without limitation the rights
|
17
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18
|
+
# copies of the Software, and to permit persons to whom the Software is
|
19
|
+
# furnished to do so, subject to the following conditions:
|
20
|
+
|
21
|
+
# The above copyright notice and this permission notice shall be included in
|
22
|
+
# all copies or substantial portions of the Software.
|
23
|
+
|
24
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
26
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
27
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
28
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
29
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
30
|
+
# THE SOFTWARE.
|
31
|
+
|
32
|
+
module Fourflusher
|
33
|
+
# Module which provides support for running executables.
|
34
|
+
#
|
35
|
+
# In a class it can be used as:
|
36
|
+
#
|
37
|
+
# extend Executable
|
38
|
+
# executable :git
|
39
|
+
#
|
40
|
+
# This will create two methods `git` and `git!` both accept a command but
|
41
|
+
# the later will raise on non successful executions. The methods return the
|
42
|
+
# output of the command.
|
43
|
+
#
|
44
|
+
module Executable
|
45
|
+
# Creates the methods for the executable with the given name.
|
46
|
+
#
|
47
|
+
# @param [Symbol] name
|
48
|
+
# the name of the executable.
|
49
|
+
#
|
50
|
+
# @return [void]
|
51
|
+
#
|
52
|
+
def executable(name)
|
53
|
+
define_method(name) do |*command|
|
54
|
+
Executable.execute_command(name, Array(command).flatten, false)
|
55
|
+
end
|
56
|
+
|
57
|
+
define_method(name.to_s + '!') do |*command|
|
58
|
+
Executable.execute_command(name, Array(command).flatten, true)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Executes the given command displaying it if in verbose mode.
|
63
|
+
#
|
64
|
+
# @param [String] bin
|
65
|
+
# The binary to use.
|
66
|
+
#
|
67
|
+
# @param [Array<#to_s>] command
|
68
|
+
# The command to send to the binary.
|
69
|
+
#
|
70
|
+
# @param [Bool] raise_on_failure
|
71
|
+
# Whether it should raise if the command fails.
|
72
|
+
#
|
73
|
+
# @raise If the executable could not be located.
|
74
|
+
#
|
75
|
+
# @raise If the command fails and the `raise_on_failure` is set to true.
|
76
|
+
#
|
77
|
+
# @return [String] the output of the command (STDOUT and STDERR).
|
78
|
+
#
|
79
|
+
def self.execute_command(executable, command, raise_on_failure = true)
|
80
|
+
bin = which(executable)
|
81
|
+
fail Informative, "Unable to locate the executable `#{executable}`" unless bin
|
82
|
+
|
83
|
+
command = command.map(&:to_s)
|
84
|
+
full_command = "#{bin} #{command.join(' ')}"
|
85
|
+
|
86
|
+
if Config.instance.verbose?
|
87
|
+
UI.message("$ #{full_command}")
|
88
|
+
stdout = Indenter.new(STDOUT)
|
89
|
+
stderr = Indenter.new(STDERR)
|
90
|
+
else
|
91
|
+
stdout = Indenter.new
|
92
|
+
stderr = Indenter.new
|
93
|
+
end
|
94
|
+
|
95
|
+
status = popen3(bin, command, stdout, stderr)
|
96
|
+
stdout = stdout.join
|
97
|
+
stderr = stderr.join
|
98
|
+
output = stdout + stderr
|
99
|
+
unless status.success?
|
100
|
+
if raise_on_failure
|
101
|
+
fail Informative, "#{full_command}\n\n#{output}"
|
102
|
+
else
|
103
|
+
UI.message("[!] Failed: #{full_command}".red)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
output
|
108
|
+
end
|
109
|
+
|
110
|
+
# Returns the absolute path to the binary with the given name on the current
|
111
|
+
# `PATH`, or `nil` if none is found.
|
112
|
+
#
|
113
|
+
# @param [String] program
|
114
|
+
# The name of the program being searched for.
|
115
|
+
#
|
116
|
+
# @return [String,Nil] The absolute path to the given program, or `nil` if
|
117
|
+
# it wasn't found in the current `PATH`.
|
118
|
+
#
|
119
|
+
def self.which(program)
|
120
|
+
program = program.to_s
|
121
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
122
|
+
bin = File.expand_path(program, path)
|
123
|
+
return bin if File.file?(bin) && File.executable?(bin)
|
124
|
+
end
|
125
|
+
nil
|
126
|
+
end
|
127
|
+
|
128
|
+
# Runs the given command, capturing the desired output.
|
129
|
+
#
|
130
|
+
# @param [String] bin
|
131
|
+
# The binary to use.
|
132
|
+
#
|
133
|
+
# @param [Array<#to_s>] command
|
134
|
+
# The command to send to the binary.
|
135
|
+
#
|
136
|
+
# @param [Symbol] capture
|
137
|
+
# Whether it should raise if the command fails.
|
138
|
+
#
|
139
|
+
# @raise If the executable could not be located.
|
140
|
+
#
|
141
|
+
# @return [(String, Process::Status)]
|
142
|
+
# The desired captured output from the command, and the status from
|
143
|
+
# running the command.
|
144
|
+
#
|
145
|
+
def self.capture_command(executable, command, capture: :merge)
|
146
|
+
bin = which(executable)
|
147
|
+
fail Informative, "Unable to locate the executable `#{executable}`" unless bin
|
148
|
+
|
149
|
+
require 'open3'
|
150
|
+
command = command.map(&:to_s)
|
151
|
+
case capture
|
152
|
+
when :merge then Open3.capture2e(bin, *command)
|
153
|
+
when :both then Open3.capture3(bin, *command)
|
154
|
+
when :out then Open3.capture2(bin, *command)
|
155
|
+
when :err then Open3.capture3(bin, *command).drop(1)
|
156
|
+
when :none then Open3.capture2(bin, *command).last
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
private
|
161
|
+
|
162
|
+
def self.popen3(bin, command, stdout, stderr)
|
163
|
+
require 'open3'
|
164
|
+
Open3.popen3(bin, *command) do |i, o, e, t|
|
165
|
+
reader(o, stdout)
|
166
|
+
reader(e, stderr)
|
167
|
+
i.close
|
168
|
+
|
169
|
+
status = t.value
|
170
|
+
|
171
|
+
o.flush
|
172
|
+
e.flush
|
173
|
+
sleep(0.01)
|
174
|
+
|
175
|
+
status
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def self.reader(input, output)
|
180
|
+
Thread.new do
|
181
|
+
buf = ''
|
182
|
+
begin
|
183
|
+
loop do
|
184
|
+
buf << input.readpartial(4096)
|
185
|
+
loop do
|
186
|
+
string, separator, buf = buf.partition(/[\r\n]/)
|
187
|
+
if separator.empty?
|
188
|
+
buf = string
|
189
|
+
break
|
190
|
+
end
|
191
|
+
output << (string << separator)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
rescue EOFError
|
195
|
+
output << (buf << $INPUT_RECORD_SEPARATOR) unless buf.empty?
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
#-------------------------------------------------------------------------#
|
201
|
+
|
202
|
+
# Helper class that allows to write to an {IO} instance taking into account
|
203
|
+
# the UI indentation level.
|
204
|
+
#
|
205
|
+
class Indenter < ::Array
|
206
|
+
# @return [Fixnum] The indentation level of the UI.
|
207
|
+
#
|
208
|
+
attr_accessor :indent
|
209
|
+
|
210
|
+
# @return [IO] the {IO} to which the output should be printed.
|
211
|
+
#
|
212
|
+
attr_accessor :io
|
213
|
+
|
214
|
+
# Init a new Indenter
|
215
|
+
#
|
216
|
+
# @param [IO] io @see io
|
217
|
+
#
|
218
|
+
def initialize(io = nil)
|
219
|
+
@io = io
|
220
|
+
@indent = ' ' * UI.indentation_level
|
221
|
+
end
|
222
|
+
|
223
|
+
# Stores a portion of the output and prints it to the {IO} instance.
|
224
|
+
#
|
225
|
+
# @param [String] value
|
226
|
+
# the output to print.
|
227
|
+
#
|
228
|
+
# @return [void]
|
229
|
+
#
|
230
|
+
def <<(value)
|
231
|
+
super
|
232
|
+
io << "#{indent}#{value}" if io
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'fourflusher/simctl'
|
2
|
+
|
3
|
+
module Fourflusher
|
4
|
+
# Metadata about an installed Xcode simulator
|
5
|
+
class Simulator
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :name
|
8
|
+
attr_reader :os_name
|
9
|
+
attr_reader :os_version
|
10
|
+
|
11
|
+
def self.match(line, os_name, os_version)
|
12
|
+
sims = []
|
13
|
+
@@sim_regex.match(line) { |m| sims << Simulator.new(m, os_name, os_version) }
|
14
|
+
sims
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_s
|
18
|
+
"#{@name} (#{@id}) - #{@os_name} #{@os_version}"
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
@@sim_regex = /^\s*(?<sim_name>[^\)]*?) \((?<sim_id>[^\)]*?)\) \((?<sim_state>[^\)]*?)\)$/
|
24
|
+
|
25
|
+
def initialize(match_data, os_name, os_version)
|
26
|
+
@id = match_data['sim_id']
|
27
|
+
@name = match_data['sim_name']
|
28
|
+
@os_name = os_name
|
29
|
+
@os_version = os_version
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# -- iOS 9.2 --
|
34
|
+
# iPhone 4s (C0404A23-2D2D-4208-8CEC-774194D06759) (Shutdown)
|
35
|
+
# iPhone 5 (7A0F62DD-8330-44F0-9828-AC8B1BC9BF05) (Shutdown)
|
36
|
+
# iPhone 5s (51C1CB50-FBCB-47ED-B8FF-68C816BF0932) (Shutdown)
|
37
|
+
# iPhone 6 (6F4E143A-6914-476E-90BF-51B680B8E2EF) (Shutdown)
|
38
|
+
# iPhone 6 Plus (BEB9BFE9-AF1A-4FEA-9FA5-CAFD5243CA42) (Shutdown)
|
39
|
+
# iPhone 6s (98DB904B-DF98-4F3C-AB21-A4D133604BA4) (Shutdown)
|
40
|
+
# iPhone 6s Plus (65838307-4C03-4DD3-84E4-A6477CFD3490) (Shutdown)
|
41
|
+
# iPad 2 (349C1313-6C9C-48C6-8849-DAB18BE2F15C) (Shutdown)
|
42
|
+
# iPad Retina (30909168-4C90-48CD-B142-86DCF7B1372A) (Shutdown)
|
43
|
+
# iPad Air (A8B5F651-C215-459C-95C6-663194F2277B) (Shutdown)
|
44
|
+
# iPad Air 2 (BFDB363E-D514-490C-A1D6-AC86402089BA) (Shutdown)
|
45
|
+
# iPad Pro (AE5DA548-66F6-4FCE-AA6D-5E6E17CD721E) (Shutdown)
|
46
|
+
# -- tvOS 9.1 --
|
47
|
+
# Apple TV 1080p (C5A44868-685C-4D72-BEBD-102246C870F7) (Shutdown)
|
48
|
+
# -- watchOS 2.1 --
|
49
|
+
# Apple Watch - 38mm (FE557B65-A044-44C3-96AC-2EAC395A6090) (Shutdown)
|
50
|
+
# Apple Watch - 42mm (C9138FAE-6812-4BB5-A463-76520C116AF4) (Shutdown)
|
51
|
+
|
52
|
+
# Executes `simctl` commands
|
53
|
+
class SimControl
|
54
|
+
def initialize
|
55
|
+
@os_regex = /^-- (?<os_name>.*?) (?<os_version>[0-9].[0-9]) --$/
|
56
|
+
end
|
57
|
+
|
58
|
+
def simulator(filter)
|
59
|
+
usable_simulators(filter).first
|
60
|
+
end
|
61
|
+
|
62
|
+
def usable_simulators(filter = nil)
|
63
|
+
os_name = ''
|
64
|
+
os_version = ''
|
65
|
+
sims = []
|
66
|
+
|
67
|
+
list(['devices']).lines.each do |line|
|
68
|
+
@os_regex.match(line) do |m|
|
69
|
+
os_name = m['os_name']
|
70
|
+
os_version = m['os_version']
|
71
|
+
end
|
72
|
+
sims += Simulator.match(line, os_name, os_version)
|
73
|
+
end
|
74
|
+
|
75
|
+
return sims if filter.nil?
|
76
|
+
sims.select { |sim| sim.name == filter }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'fourflusher/executable'
|
2
|
+
|
3
|
+
module Fourflusher
|
4
|
+
# Executes `simctl` commands
|
5
|
+
class SimControl
|
6
|
+
extend Executable
|
7
|
+
executable :xcrun
|
8
|
+
|
9
|
+
def list(args)
|
10
|
+
simctl!(['list'] + args)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def simctl!(args)
|
16
|
+
xcrun!(['simctl'] + args)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fourflusher
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Boris Bügling
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.35.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.35.0
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- boris@icculus.org
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- .rubocop.yml
|
78
|
+
- .travis.yml
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/console
|
84
|
+
- bin/setup
|
85
|
+
- fourflusher.gemspec
|
86
|
+
- lib/fourflusher.rb
|
87
|
+
- lib/fourflusher/compat.rb
|
88
|
+
- lib/fourflusher/executable.rb
|
89
|
+
- lib/fourflusher/find.rb
|
90
|
+
- lib/fourflusher/simctl.rb
|
91
|
+
- lib/fourflusher/version.rb
|
92
|
+
- lib/fourflusher/xcodebuild.rb
|
93
|
+
homepage: https://github.com/neonichu/fourflusher
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.0.14
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: A library for interacting with Xcode simulators.
|
117
|
+
test_files: []
|
118
|
+
has_rdoc:
|