Skip to content

Commit 8389f70

Browse files
committed
Rubocop - Style/BarePercentLiterals
1 parent b818def commit 8389f70

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

lib/appium_lib/android/client_xpath.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def _nodeset_to_uiselector(opts = {})
1111
nodes = [nodes[0]] if first
1212

1313
nodes.each do |node|
14-
results += %Q(new UiSelector().className("#{node.name}").instance(#{node.attr('instance')});)
14+
results += %(new UiSelector().className("#{node.name}").instance(#{node.attr('instance')});)
1515
end
1616

1717
results.strip

lib/appium_lib/android/element/generic.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def scroll_uiselector(content)
3838
# @param text [String] the text to search for in the text value and content description
3939
# @return [Element] the element scrolled to
4040
def scroll_to(text)
41-
text = %Q("#{text}")
41+
text = %("#{text}")
4242

4343
args = scroll_uiselector("new UiSelector().textContains(#{text})") +
4444
scroll_uiselector("new UiSelector().descriptionContains(#{text})")
@@ -50,7 +50,7 @@ def scroll_to(text)
5050
# @param text [String] the text to search for in the text value and content description
5151
# @return [Element] the element scrolled to
5252
def scroll_to_exact(text)
53-
text = %Q("#{text}")
53+
text = %("#{text}")
5454

5555
args = scroll_uiselector("new UiSelector().text(#{text})") +
5656
scroll_uiselector("new UiSelector().description(#{text})")

lib/appium_lib/android/helper.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,15 @@ def _resourceId(string, on_match)
286286
# @param value [String] the value to search for
287287
# @return [String]
288288
def string_visible_contains(class_name, value)
289-
value = %Q("#{value}")
289+
value = %("#{value}")
290290

291291
if class_name == '*'
292292
return _resourceId(value, "new UiSelector().resourceId(#{value});") +
293293
"new UiSelector().descriptionContains(#{value});" +
294294
"new UiSelector().textContains(#{value});"
295295
end
296296

297-
class_name = %Q("#{class_name}")
297+
class_name = %("#{class_name}")
298298

299299
_resourceId(value, "new UiSelector().className(#{class_name}).resourceId(#{value});") +
300300
"new UiSelector().className(#{class_name}).descriptionContains(#{value});" +
@@ -323,15 +323,15 @@ def complex_finds_contains(element, value)
323323
# @param value [String] the value to search for
324324
# @return [String]
325325
def string_visible_exact(class_name, value)
326-
value = %Q("#{value}")
326+
value = %("#{value}")
327327

328328
if class_name == '*'
329329
return _resourceId(value, "new UiSelector().resourceId(#{value});") +
330330
"new UiSelector().description(#{value});" +
331331
"new UiSelector().text(#{value});"
332332
end
333333

334-
class_name = %Q("#{class_name}")
334+
class_name = %("#{class_name}")
335335

336336
_resourceId(value, "new UiSelector().className(#{class_name}).resourceId(#{value});") +
337337
"new UiSelector().className(#{class_name}).description(#{value});" +

lib/appium_lib/ios/helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def ele_index(class_name, index)
209209

210210
# @private
211211
def string_attr_exact(class_name, attr, value)
212-
%Q(//#{class_name}[@visible="true" and @#{attr}='#{value}'])
212+
%(//#{class_name}[@visible="true" and @#{attr}='#{value}'])
213213
end
214214

215215
# Find the first element exactly matching class and attribute value.
@@ -234,7 +234,7 @@ def find_eles_by_attr(class_name, attr, value)
234234

235235
# @private
236236
def string_attr_include(class_name, attr, value)
237-
%Q(//#{class_name}[@visible="true" and contains(translate(@#{attr},'#{value.upcase}', '#{value}'), '#{value}')])
237+
%(//#{class_name}[@visible="true" and contains(translate(@#{attr},'#{value.upcase}', '#{value}'), '#{value}')])
238238
end
239239

240240
# Get the first tag by attribute that exactly matches value.
@@ -435,7 +435,7 @@ def _all_pred(opts)
435435
predicate = opts[:predicate]
436436
raise 'predicate must be provided' unless predicate
437437
visible = opts.fetch :visible, true
438-
%Q($.mainApp().getAllWithPredicate("#{predicate}", #{visible});)
438+
%($.mainApp().getAllWithPredicate("#{predicate}", #{visible});)
439439
end
440440

441441
# returns element matching predicate contained in the main app

0 commit comments

Comments
 (0)