frank-cucumber 0.8.17 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'frank-cucumber/cli'
4
+
5
+ Frank::CLI.start
6
+
@@ -1,9 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'fileutils'
3
+ ######################## ######################## ########################
4
+ #
5
+ # IMPORTANT NOTE
6
+ #
7
+ # This script is deprecated. it's just here for backwards compatibility.
8
+ #
9
+ # Users should be using the Frank::CLI-backed `frank` executable
10
+ #
11
+ ######################## ######################## ########################
12
+
13
+ require 'frank-cucumber/cli'
14
+
15
+ Frank::CLI.start
4
16
 
5
- TARGET_DIR = File.join( FileUtils.pwd, "Frank" )
6
- SOURCE_DIR = File.join( File.dirname(__FILE__), '..', 'frank-skeleton' )
7
17
 
8
18
  command = ARGV[0]
9
19
 
@@ -15,38 +25,9 @@ end
15
25
 
16
26
  update_mode = ARGV[0] == 'update-server'
17
27
 
18
- def create_skeleton_dir
19
- puts "I'm about to create a subdirectory called Frank which will contain the Frank server files and also your Cucumber tests. Please hit return to confirm that's what you want."
20
- exit 3 unless STDIN.gets.chomp == ''
21
-
22
- FileUtils.mkdir_p( TARGET_DIR )
23
- FileUtils.cp_r( Dir.glob( SOURCE_DIR+"/*" ), TARGET_DIR )
24
-
25
- puts <<-EOS
26
- Frank subdirectory created.
27
- 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.
28
- After that, you can build the target and try executing 'cucumber' from the Frank directory to see how your initial cucumber test runs.
29
- EOS
30
- end
31
-
32
- def update_server_files
33
- source_files = %w{libFrank.a libShelley.a frank_static_resources.bundle}.map{ |x| File.join( SOURCE_DIR, x ) }
34
- FileUtils.cp_r( source_files, TARGET_DIR )
35
- puts "All done. I've updated libFrank.a, libShelley.a and frank_static_resources.bundle inside #{TARGET_DIR}"
36
- end
37
-
38
- frank_dir_already_exists = File.exists?( TARGET_DIR )
39
-
40
- if frank_dir_already_exists && !update_mode
41
- puts "A Frank subdirectory already exists. I don't want to mess with that. \n\nIf you want me to update the frank server code in that directory then run `frank-skeleton update-server`"
42
- exit 1
43
- elsif !frank_dir_already_exists && update_mode
44
- puts "There isn't a Frank subdirectory here for me to update.\n\nIf you want to create a new Frank subdirectory containing the Frank server code and an initial Cucumber setup then you should run `frank-skeleton` with no arguments"
45
- exit 2
46
- end
47
-
28
+ cli = Frank::CLI.new
48
29
  if update_mode
49
- update_server_files
30
+ cli.update
50
31
  else
51
- create_skeleton_dir
32
+ cli.skeleton
52
33
  end
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency( "plist" )
25
25
  s.add_dependency( "json" ) # TODO: figure out how to be more permissive as to which JSON gems we allow
26
26
  s.add_dependency( "dnssd" )
27
+ s.add_dependency( "thor" )
27
28
 
28
29
  s.add_development_dependency( "rr" )
29
30
  end
@@ -0,0 +1,3 @@
1
+ INSTALL_PATH = /./
2
+
3
+ OTHER_LDFLAGS = $(inherited) -all_load -ObjC -framework CFNetwork -lShelley -lFrank -L Frank
@@ -0,0 +1,105 @@
1
+ require 'thor'
2
+ require 'frank-cucumber/launcher'
3
+
4
+ module Frank
5
+ class CLI < Thor
6
+ include Thor::Actions
7
+
8
+ def self.source_root
9
+ File.join( File.dirname(__FILE__), '..','..','frank-skeleton' )
10
+ end
11
+
12
+ # included just because the old setup script was called frank-skeleton
13
+ desc "skeleton", "an alias for setup"
14
+ def skeleton
15
+ invoke :setup
16
+ end
17
+
18
+ desc "setup", "set up your iOS app by adding a Frank subdirectory containing everything Frank needs"
19
+ def setup
20
+ 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
+ end
28
+
29
+ desc "update", "updates the frank server components inside your Frank directory"
30
+ long_desc "This updates the parts of Frank that are embedded inside your app (e.g. libFrank.a and frank_static_resources.bundle)"
31
+ def update
32
+ %w{libFrank.a libShelley.a}.each do |f|
33
+ copy_file f, File.join( 'Frank', f ), :force => true
34
+ end
35
+ directory( 'frank_static_resources.bundle', 'Frank/frank_static_resources.bundle', :force => true )
36
+ end
37
+
38
+ desc "build", "builds a Frankified version of your native app"
39
+ def build
40
+
41
+ in_root do
42
+ unless File.directory? 'Frank'
43
+ if yes? "You don't appear to have set up a Frank directory for this project. Would you like me to set that up now? Type 'y' or 'yes' if so."
44
+ invoke :skeleton
45
+ else
46
+ say "OK, in that case there's not much I can do for now. Whenever you change your mind and want to get your project setup with Frank simply run `frank setup` from the root of your project directory."
47
+ say "Bye bye for now!"
48
+ exit 11
49
+ end
50
+ end
51
+ end
52
+
53
+ static_bundle = 'frank_static_resources.bundle'
54
+
55
+ remove_dir build_output_dir
56
+
57
+ run "xcodebuild -xcconfig Frank/frankify.xcconfig install -configuration Debug -sdk iphonesimulator DSTROOT=#{build_output_dir} WRAPPER_NAME=#{app_bundle_name}"
58
+
59
+ in_root do
60
+ FileUtils.cp_r(
61
+ File.join( 'Frank',static_bundle),
62
+ File.join( frankified_app_dir, static_bundle )
63
+ )
64
+ end
65
+ end
66
+
67
+ desc "build_and_launch", "rebuild a Frankfied version of your app then launch"
68
+ def build_and_launch
69
+ invoke :build
70
+ invoke :launch
71
+ end
72
+
73
+ desc "launch", "open the Frankified app in the simulator"
74
+ def launch
75
+ in_root do
76
+ unless File.exists? frankified_app_dir
77
+ say "A Frankified version of the app doesn't appear to have been built. Building one now"
78
+ say "..."
79
+ invoke :build
80
+ end
81
+
82
+ say "LAUNCHING IN THE SIMULATOR..."
83
+
84
+ launcher = SimLauncher::DirectClient.new(frankified_app_dir, nil, nil )
85
+ launcher.relaunch
86
+ end
87
+ end
88
+
89
+ private
90
+
91
+ def app_bundle_name
92
+ "Frankified.app"
93
+ end
94
+
95
+ def build_output_dir
96
+ "Frank/frankified_build"
97
+ end
98
+
99
+ def frankified_app_dir
100
+ File.join( build_output_dir, app_bundle_name )
101
+ end
102
+
103
+ end
104
+ end
105
+
@@ -114,7 +114,7 @@ module FrankHelper
114
114
  end
115
115
 
116
116
  def app_exec(method_name, *method_args)
117
- operation_map = Gateway.build_operation_map(method_name,method_args)
117
+ operation_map = Gateway.build_operation_map(method_name.to_s, method_args)
118
118
 
119
119
  res = frank_server.send_post(
120
120
  'app_exec',
@@ -125,7 +125,7 @@ module FrankHelper
125
125
  end
126
126
 
127
127
  def frankly_map( query, method_name, *method_args )
128
- operation_map = Gateway.build_operation_map(method_name,method_args)
128
+ operation_map = Gateway.build_operation_map(method_name.to_s, method_args)
129
129
 
130
130
  res = frank_server.send_post(
131
131
  'map',
@@ -1,5 +1,5 @@
1
1
  module Frank
2
2
  module Cucumber
3
- VERSION = "0.8.17"
3
+ VERSION = "0.9.0"
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.8.17
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-08 00:00:00.000000000Z
13
+ date: 2012-06-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber
17
- requirement: &70224556806200 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,15 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70224556806200
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: rspec
28
- requirement: &70224556804840 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ! '>='
@@ -33,10 +38,15 @@ dependencies:
33
38
  version: '2.0'
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *70224556804840
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '2.0'
37
47
  - !ruby/object:Gem::Dependency
38
48
  name: sim_launcher
39
- requirement: &70224556803920 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
40
50
  none: false
41
51
  requirements:
42
52
  - - ! '>='
@@ -44,10 +54,15 @@ dependencies:
44
54
  version: '0'
45
55
  type: :runtime
46
56
  prerelease: false
47
- version_requirements: *70224556803920
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
48
63
  - !ruby/object:Gem::Dependency
49
64
  name: i18n
50
- requirement: &70224556803260 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
51
66
  none: false
52
67
  requirements:
53
68
  - - ! '>='
@@ -55,10 +70,15 @@ dependencies:
55
70
  version: '0'
56
71
  type: :runtime
57
72
  prerelease: false
58
- version_requirements: *70224556803260
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
59
79
  - !ruby/object:Gem::Dependency
60
80
  name: plist
61
- requirement: &70224556802780 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
62
82
  none: false
63
83
  requirements:
64
84
  - - ! '>='
@@ -66,10 +86,15 @@ dependencies:
66
86
  version: '0'
67
87
  type: :runtime
68
88
  prerelease: false
69
- version_requirements: *70224556802780
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
70
95
  - !ruby/object:Gem::Dependency
71
96
  name: json
72
- requirement: &70224556802040 !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
73
98
  none: false
74
99
  requirements:
75
100
  - - ! '>='
@@ -77,10 +102,31 @@ dependencies:
77
102
  version: '0'
78
103
  type: :runtime
79
104
  prerelease: false
80
- version_requirements: *70224556802040
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
81
111
  - !ruby/object:Gem::Dependency
82
112
  name: dnssd
83
- requirement: &70224556801380 !ruby/object:Gem::Requirement
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: thor
129
+ requirement: !ruby/object:Gem::Requirement
84
130
  none: false
85
131
  requirements:
86
132
  - - ! '>='
@@ -88,10 +134,15 @@ dependencies:
88
134
  version: '0'
89
135
  type: :runtime
90
136
  prerelease: false
91
- version_requirements: *70224556801380
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
92
143
  - !ruby/object:Gem::Dependency
93
144
  name: rr
94
- requirement: &70224556800900 !ruby/object:Gem::Requirement
145
+ requirement: !ruby/object:Gem::Requirement
95
146
  none: false
96
147
  requirements:
97
148
  - - ! '>='
@@ -99,11 +150,17 @@ dependencies:
99
150
  version: '0'
100
151
  type: :development
101
152
  prerelease: false
102
- version_requirements: *70224556800900
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
103
159
  description: Use cucumber to test native iOS apps via Frank
104
160
  email:
105
161
  - gems@thepete.net
106
162
  executables:
163
+ - frank
107
164
  - frank-skeleton
108
165
  extensions: []
109
166
  extra_rdoc_files: []
@@ -111,6 +168,7 @@ files:
111
168
  - .gitignore
112
169
  - Gemfile
113
170
  - Rakefile
171
+ - bin/frank
114
172
  - bin/frank-skeleton
115
173
  - frank-cucumber.gemspec
116
174
  - frank-skeleton/features/my_first.feature
@@ -145,11 +203,13 @@ files:
145
203
  - frank-skeleton/frank_static_resources.bundle/symbiote.css
146
204
  - frank-skeleton/frank_static_resources.bundle/symbiote.js
147
205
  - frank-skeleton/frank_static_resources.bundle/underscore.js
206
+ - frank-skeleton/frankify.xcconfig
148
207
  - frank-skeleton/libFrank.a
149
208
  - frank-skeleton/libShelley.a
150
209
  - lib/frank-cucumber.rb
151
210
  - lib/frank-cucumber/app_bundle_locator.rb
152
211
  - lib/frank-cucumber/bonjour.rb
212
+ - lib/frank-cucumber/cli.rb
153
213
  - lib/frank-cucumber/color_helper.rb
154
214
  - lib/frank-cucumber/core_frank_steps.rb
155
215
  - lib/frank-cucumber/frank_helper.rb
@@ -184,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
244
  version: '0'
185
245
  requirements: []
186
246
  rubyforge_project:
187
- rubygems_version: 1.8.10
247
+ rubygems_version: 1.8.24
188
248
  signing_key:
189
249
  specification_version: 3
190
250
  summary: Use cucumber to test native iOS apps via Frank