guard-frank 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.
- data/README.md +6 -1
- data/lib/guard/frank/runner.rb +34 -8
- data/lib/guard/frank/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -21,5 +21,10 @@ When you're done, run following commands from project_path/Frank directory
|
|
21
21
|
|
22
22
|
Note that Frank needs to know which target of project you want to test.
|
23
23
|
So after initilizing frank you need modify Guardfile, if neccessary.
|
24
|
-
By default Guard::Frank trying to test 'frankified' target.
|
25
24
|
|
25
|
+
## Guard options
|
26
|
+
|
27
|
+
all_on_start - run all specs at first start, by default true
|
28
|
+
project - project name, if not set, then gem will try to find it by *.xcodeproject expression
|
29
|
+
target - calabash target, by default $project-cal
|
30
|
+
config - Debug/Release, by default Debug
|
data/lib/guard/frank/runner.rb
CHANGED
@@ -1,17 +1,43 @@
|
|
1
1
|
module Guard
|
2
2
|
class Runner
|
3
3
|
attr_accessor :bundle_path
|
4
|
+
attr_accessor :project
|
5
|
+
attr_accessor :target
|
6
|
+
attr_accessor :config
|
4
7
|
def initialize(options)
|
8
|
+
self.project = init_project(options)
|
9
|
+
self.bundle_path = bundle(options)
|
10
|
+
self.target = init_target(options)
|
11
|
+
self.config = init_config(options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def init_project(options)
|
5
15
|
if options[:project].nil?
|
6
16
|
Dir.chdir("..")
|
7
|
-
|
8
|
-
if
|
9
|
-
|
17
|
+
xproject = Dir.glob("*.xcodeproj").first
|
18
|
+
if xproject
|
19
|
+
xproject.gsub(".xcodeproj","")
|
10
20
|
else
|
11
21
|
UI.info "You must specify project name at your Guardfile."
|
22
|
+
nil
|
12
23
|
end
|
13
24
|
end
|
14
|
-
|
25
|
+
end
|
26
|
+
|
27
|
+
def init_config(options)
|
28
|
+
if options[:config].nil?
|
29
|
+
"Debug"
|
30
|
+
else
|
31
|
+
options[:config]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def init_target(options)
|
36
|
+
if options[:target].nil?
|
37
|
+
options[:target]
|
38
|
+
else
|
39
|
+
"frankified"
|
40
|
+
end
|
15
41
|
end
|
16
42
|
|
17
43
|
def run(features)
|
@@ -19,7 +45,7 @@ module Guard
|
|
19
45
|
UI.info "Could not run Frank. \n'#{self.bundle_path}' not found."
|
20
46
|
return false
|
21
47
|
end
|
22
|
-
if features.eql?("features")
|
48
|
+
if features.eql?("features") or features.empty?
|
23
49
|
start_message = "Run all features"
|
24
50
|
else
|
25
51
|
features = features.join(' ') if features.kind_of? Array
|
@@ -41,9 +67,9 @@ module Guard
|
|
41
67
|
if File.exists?"Frank"
|
42
68
|
Dir.chdir("Frank")
|
43
69
|
end
|
44
|
-
project =
|
45
|
-
target =
|
46
|
-
config =
|
70
|
+
project = self.project
|
71
|
+
target = self.target
|
72
|
+
config = self.config
|
47
73
|
device = "iphonesimulator"
|
48
74
|
bundle_path = "#{pwd}/DerivedData/#{project}/Build/Products/#{config}-#{device}/#{target}.app"
|
49
75
|
end
|
data/lib/guard/frank/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-frank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Denisov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-05-
|
18
|
+
date: 2012-05-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: guard
|