frank-cucumber 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  require 'thor'
2
2
  require 'frank-cucumber/launcher'
3
+ require 'frank-cucumber/console'
3
4
 
4
5
  module Frank
5
6
  class CLI < Thor
@@ -18,12 +19,6 @@ module Frank
18
19
  desc "setup", "set up your iOS app by adding a Frank subdirectory containing everything Frank needs"
19
20
  def setup
20
21
  directory ".", "Frank"
21
- say <<-EOS
22
-
23
- Frank subdirectory created.
24
- Your next step is to create a Frankified target for your app, and add the libFrank.a, libShelley.a and frank_static_resources.bundle files inside the Frank directory to that target.
25
- After that, you can build the target and try executing 'cucumber' from the Frank directory to see how your initial cucumber test runs.
26
- EOS
27
22
  end
28
23
 
29
24
  desc "update", "updates the frank server components inside your Frank directory"
@@ -86,6 +81,32 @@ module Frank
86
81
  end
87
82
  end
88
83
 
84
+ desc "inspect", "launch Symbiote in the browser"
85
+ long_desc "launch Symbiote in the browser so you can inspect the live state of your Frankified app"
86
+ def inspect
87
+ # TODO: check whether app is running (using ps or similar), and launch it if it's not
88
+ run 'open http://localhost:37265'
89
+ end
90
+
91
+ desc 'console', "launch a ruby console connected to your Frankified app"
92
+ def console
93
+ # TODO: check whether app is running (using ps or similar), and launch it if it's not
94
+
95
+ begin
96
+ require 'pry'
97
+ rescue LoadError
98
+ say 'The Frank console requires the pry gem.'
99
+ say 'Simply run `sudo gem install pry` (the `sudo` bit might be optional), and then try again. Thanks!'
100
+ exit 41
101
+ end
102
+
103
+ Frank::Cucumber::FrankHelper.use_shelley_from_now_on
104
+ console = Frank::Console.new
105
+ if console.check_for_running_app
106
+ console.pry
107
+ end
108
+ end
109
+
89
110
  private
90
111
 
91
112
  def app_bundle_name
@@ -0,0 +1,26 @@
1
+ require 'frank-cucumber/frank_helper'
2
+ require 'frank-cucumber/launcher'
3
+
4
+ module Frank
5
+ class Console
6
+ include Frank::Cucumber::FrankHelper
7
+ include Frank::Cucumber::Launcher
8
+
9
+ def check_for_running_app
10
+ print 'connecting to app...'
11
+ begin
12
+ Timeout::timeout(5) do
13
+ until frankly_ping
14
+ print '.'
15
+ sleep 0.2
16
+ end
17
+ end
18
+ rescue Timeout::Error
19
+ puts ' failed to connect.'
20
+ return false
21
+ end
22
+ puts ' connected'
23
+ return true
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  module Frank
2
2
  module Cucumber
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frank-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-17 00:00:00.000000000 Z
13
+ date: 2012-06-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber
@@ -211,6 +211,7 @@ files:
211
211
  - lib/frank-cucumber/bonjour.rb
212
212
  - lib/frank-cucumber/cli.rb
213
213
  - lib/frank-cucumber/color_helper.rb
214
+ - lib/frank-cucumber/console.rb
214
215
  - lib/frank-cucumber/core_frank_steps.rb
215
216
  - lib/frank-cucumber/frank_helper.rb
216
217
  - lib/frank-cucumber/frank_localize.rb