calabash-cucumber 0.11.5.pre2 → 0.11.5.pre3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 292c9c88c06f29772a770fded22c6f1c5435bd6d
4
- data.tar.gz: 017b1881d24c706aabf5fbfd7c536e162c931dd3
3
+ metadata.gz: 7c95f4d2f10d62d51c4e738deaf8609a0f6b5c5c
4
+ data.tar.gz: e7cb52842ae5531fff2d7f3e6762661ab5990a86
5
5
  SHA512:
6
- metadata.gz: b20f07d18068b94b5b5b89c12facc36ba665c08b2ace5c7aae5f8de0af5959d18a768eb7c51820f794a11167eb8092386fb3e8d7025fe80e40ce7a24507e0dcb
7
- data.tar.gz: 3c3ec4de0e56d32d6d6ce873539cb3e2efb33172c436f4ab9b5d83659a29db92447d9d4e86f714a1786ecb8d57e6fb27a5e87a88c50a109063a7e0489f19cd89
6
+ metadata.gz: 41d1cac4aff7835fc754925de60d8ecbe0b23ec42148ef7f745bdb2c11cc153adee1f0e393d1be529a3094461767b369dc5586f64316f3d1c9bdcf62c8d85c11
7
+ data.tar.gz: d3c775f3d41f41ec239f1f37e80d79e3fe795c4cc379d3288949636be0be934fcf37138e65c53a816b90756e6f26a1d54218e1bff2626136cffbcdd22d77d233
Binary file
Binary file
@@ -1089,6 +1089,27 @@ module Calabash
1089
1089
  l && l.run_loop
1090
1090
  end
1091
1091
 
1092
+ # @!visibility private
1093
+ def tail_run_loop_log
1094
+ l = run_loop
1095
+ unless l
1096
+ raise 'Unable to tail run_loop since there is not active run_loop...'
1097
+ end
1098
+ cmd = %Q[osascript -e 'tell application "Terminal" to do script "tail -n 10000 -f #{l[:log_file]} | grep -v \\"Default: \\\\*\\""']
1099
+ raise "Unable to " unless system(cmd)
1100
+ end
1101
+
1102
+ # @!visibility private
1103
+ def dump_run_loop_log
1104
+ l = run_loop
1105
+ unless l
1106
+ raise 'Unable to dump run_loop since there is not active run_loop...'
1107
+ end
1108
+ cmd = %Q[cat "#{l[:log_file]}" | grep -v "Default: \\*\\*\\*"]
1109
+ puts `#{cmd}`
1110
+ end
1111
+
1112
+
1092
1113
  # @!visibility private
1093
1114
  def query_action_with_options(action, uiquery, options)
1094
1115
  uiquery, options = extract_query_and_options(uiquery, options)
@@ -4,6 +4,39 @@ module Calabash
4
4
  # A module of methods that can help you construct queries.
5
5
  module QueryHelpers
6
6
 
7
+ # call this method to properly escape strings with single quotes and
8
+ # black slashes in methods (queries and uia actions)
9
+ # Calabash iOS has some annoying rules for text containing single quotes,
10
+ # and even moreso for backslash (\).
11
+ # This helper frees you from manual escaping.
12
+ # @example
13
+ # quoted = escape_string("Karl's \\ annoying problem")
14
+ # # => "Karl\\'s \\\\ annoying problem"
15
+ # @param {String} str string to escape
16
+ # @return {String} escaped version of `str`
17
+ def escape_string(str)
18
+ escape_quotes(escape_backslashes(str))
19
+ end
20
+
21
+ # call this method to properly escape blackslashes (\) in Calabash methods
22
+ # (queries and uia actions).
23
+ # Calabash iOS has some annoying rules for text containing single quotes,
24
+ # and even moreso for backslash (\).
25
+ # This helper frees you from manual escaping.
26
+ # @note
27
+ # In ruby it is important to remember that "\\" is a *single character* string containing
28
+ # a backslash: \
29
+ #
30
+ # @example
31
+ # quoted = escape_backslashes("Karl's \\ annoying problem")
32
+ # # => "Karl's \\\\ annoying problem"
33
+ # @param {String} str string to escape
34
+ # @return {String} escaped version of `str`
35
+ def escape_backslashes(str)
36
+ backslash = "\\"
37
+ str.gsub(backslash, backslash*4)
38
+ end
39
+
7
40
  # call this method to properly escape single quotes in Calabash queries
8
41
  # Calabash iOS has some annoying rules for text containing single quotes.
9
42
  # This helper frees you from manual escaping.
@@ -260,10 +260,6 @@ module Calabash
260
260
 
261
261
  # @!visibility private
262
262
  def uia_type_string(string, opt_text_before='', escape=true)
263
- if escape && string.index(/\\/)
264
- indexes = string.enum_for(:scan, /\\/).map { Regexp.last_match.begin(0) }
265
- indexes.reverse.each { |idx| string = string.insert(idx, '\\') }
266
- end
267
263
  result = uia_handle_command(:typeString, string, opt_text_before)
268
264
 
269
265
  # When 'status' == 'success', we get back result['value']. Sometimes,
@@ -393,8 +389,7 @@ module Calabash
393
389
 
394
390
  # @!visibility private
395
391
  def escape_uia_string(string)
396
- #TODO escape '\n in query
397
- escape_quotes string
392
+ escape_string string
398
393
  end
399
394
 
400
395
  # <b>DEPRECATED:</b> Use <tt>uia("...javascript..", options)</tt> instead.
@@ -3,11 +3,11 @@ module Calabash
3
3
 
4
4
  # @!visibility public
5
5
  # The Calabash iOS gem version.
6
- VERSION = '0.11.5.pre2'
6
+ VERSION = '0.11.5.pre3'
7
7
 
8
8
  # @!visibility public
9
9
  # The minimum required version of the calabash.framework or, for Xamarin
10
10
  # users, the Calabash component.
11
- MIN_SERVER_VERSION = '0.11.5.pre2'
11
+ MIN_SERVER_VERSION = '0.11.5.pre3'
12
12
  end
13
13
  end
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.5.pre2
4
+ version: 0.11.5.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2014-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: 1.1.1.pre3
173
+ version: 1.1.1.pre7
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ~>
179
179
  - !ruby/object:Gem::Version
180
- version: 1.1.1.pre3
180
+ version: 1.1.1.pre7
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rake
183
183
  requirement: !ruby/object:Gem::Requirement