agilibox 1.9.9 → 1.9.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '01460916eeacaa37c86a5d34195d8020658a4de645d0e5e6eb231d52eb884880'
4
- data.tar.gz: 87920f596a3e90b353e7413f1bbf3c90ad44ed12ccaa7fb1b6ed515d03b17c8b
3
+ metadata.gz: 39ba603c31035133392e8960223805f62875d2c073bab3c92c740ee64587cc6f
4
+ data.tar.gz: 9f029239b10af613e1cb62c0f11a2c1e17037bb4f2178a81a9c3c7f4afebad1c
5
5
  SHA512:
6
- metadata.gz: 73de451eed71b4ef4c7f2497125d8bc73fac702210814b5769915a86c80262a85a0f32e4b81e74c7ddd6526c300ff283325a2cf8a209fb3f37916e4e9b514f7e
7
- data.tar.gz: f16fbc412ce7ab063bb58addbb642a9f03dbe4f810c2b7f6032b796f3d366cb935070428214281ea4c7d8a007adc0108ea47ea317a829ea1dcedb7ae2ba38993
6
+ metadata.gz: aafbd06be7c481159a1f86060f7712b6f0d82dd9f3e4d28dc66b7fa5c08200649c9ff3029c8975c76f1bd40159988b92186e01e10b67429a11687e8e796e4874
7
+ data.tar.gz: c3f1221380f43921074b6b4ba2eb4c4f70681636c0fbba4784f3553f3f0a3b595286f38db1cf6ba3161c03f14b814eecf2e86bf61e29dca3c4bd62abfc8cf131
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## v1.9.14
6
+ - Fix syntax error on Ruby < 2.7
7
+
8
+ ## v1.9.13
9
+ - Add apparition capybara driver
10
+
11
+ ## v1.9.12
12
+ - Fix some Ruby 2.7 warnings
13
+
14
+ ## v1.9.11
15
+ - Fix some Ruby 2.7 warnings
16
+
17
+ ## v1.9.10
18
+ - Fix some Ruby 2.7 warnings
19
+
5
20
  ## v1.9.9
6
21
  - Add error to ErrorsMiddleware
7
22
 
@@ -7,7 +7,7 @@ module Agilibox::FiltersHelper
7
7
  text = options.delete(:text) || t("actions.filter")
8
8
  icon = options.delete(:icon) || :filter
9
9
 
10
- tag.button(options) do
10
+ tag.button(**options) do
11
11
  icon(icon) + " " + text
12
12
  end
13
13
  end
@@ -20,7 +20,7 @@ module Agilibox::FiltersHelper
20
20
  text = options.delete(:text) || t("actions.reset")
21
21
  icon = options.delete(:icon) || :undo
22
22
 
23
- tag.button(options) do
23
+ tag.button(**options) do
24
24
  icon(icon) + " " + text
25
25
  end
26
26
  end
@@ -15,7 +15,7 @@ module Agilibox::FontAwesomeHelper
15
15
 
16
16
  attributes = options.merge(class: css_classes.sort.join(" ")).sort.to_h
17
17
 
18
- tag.span(attributes) {}
18
+ tag.span(**attributes) {}
19
19
  end
20
20
 
21
21
  class << self
@@ -1,7 +1,7 @@
1
1
  module Agilibox::PaginationHelper
2
2
  def paginate(objects, options = {})
3
3
  options = {theme: "twitter-bootstrap-3"}.merge(options)
4
- super(objects, options).gsub(/>(\s+)</, "><").html_safe
4
+ super(objects, **options).gsub(/>(\s+)</, "><").html_safe
5
5
  end
6
6
 
7
7
  def pagination_infos(collection)
@@ -47,8 +47,8 @@ module Agilibox::TextHelper
47
47
  number_with_precision(n, opts).tr(" ", nbsp)
48
48
  end
49
49
 
50
- def date(d, *args)
51
- I18n.l(d, *args) unless d.nil?
50
+ def date(d, **args)
51
+ I18n.l(d, **args) unless d.nil?
52
52
  end
53
53
 
54
54
  def boolean_icon(bool)
@@ -1,8 +1,14 @@
1
1
  class Agilibox::Service
2
2
  include Agilibox::InitializeWith
3
3
 
4
- def self.call(*args)
5
- new(*args).call
4
+ if RUBY_VERSION >= "2.7.0"
5
+ def self.call(*args, **kwargs)
6
+ new(*args, **kwargs).call
7
+ end
8
+ else
9
+ def self.call(*args)
10
+ new(*args).call
11
+ end
6
12
  end
7
13
 
8
14
  def call(*)
@@ -11,13 +11,13 @@ class Agilibox::SMS::ApplicationSMS
11
11
  options[:action_name]
12
12
  end
13
13
 
14
- def t(key, *args)
14
+ def t(key, **args)
15
15
  if key.start_with?(".")
16
16
  path = self.class.to_s.underscore.tr("/", ".")
17
17
  key = "#{path}.#{action_name}#{key}"
18
18
  end
19
19
 
20
- I18n.t(key, *args)
20
+ I18n.t(key, **args)
21
21
  end
22
22
 
23
23
  def sms(data)
@@ -31,10 +31,14 @@ class << Agilibox::CucumberConfig = Class.new
31
31
 
32
32
  def require_all_helpers!
33
33
  files = Dir.glob Agilibox::Engine.root.join("lib", "agilibox", "cucumber_helpers", "*.rb")
34
- files.delete_if { |f| f.match?(/chrome|cuprite|_steps/) }
34
+ files.delete_if { |f| f.match?(/apparition|chrome|cuprite|_steps/) }
35
35
  files.each { |file| require file }
36
36
  end
37
37
 
38
+ def require_apparition!
39
+ require Agilibox::Engine.root.join("lib", "agilibox", "cucumber_helpers", "apparition.rb")
40
+ end
41
+
38
42
  def require_chrome_headless!
39
43
  require Agilibox::Engine.root.join("lib", "agilibox", "cucumber_helpers", "chrome_headless.rb")
40
44
  end
@@ -0,0 +1,18 @@
1
+ require "capybara/apparition"
2
+
3
+ Capybara.register_driver :agilibox_apparition do |app|
4
+ Capybara::Apparition::Driver.new(app,
5
+ :browser_options => {
6
+ :"disable-gpu" => true,
7
+ :"no-sandbox" => nil,
8
+ },
9
+ :headless => (ENV["CHROME_HEADLESS"].to_s != "false"),
10
+ :inspector => true,
11
+ :js_errors => true,
12
+ :window_size => Agilibox::CucumberConfig.window_size,
13
+ )
14
+ end
15
+
16
+ Capybara.default_driver = :agilibox_apparition
17
+ Capybara.current_driver = :agilibox_apparition
18
+ Capybara.javascript_driver = :agilibox_apparition
@@ -2,7 +2,7 @@ Capybara.add_selector(:agilibox_clickable) do
2
2
  xpath do |locator, **options|
3
3
  self.class.all
4
4
  .values_at(:link, :button, :label)
5
- .map { |selector| instance_exec(locator, options, &selector.xpath) }
5
+ .map { |selector| instance_exec(locator, **options, &selector.xpath) }
6
6
  .reduce(:union)
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.9.9"
2
+ VERSION = "1.9.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agilibox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.9
4
+ version: 1.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-i18n
@@ -199,6 +199,7 @@ files:
199
199
  - lib/agilibox/cucumber_config.rb
200
200
  - lib/agilibox/cucumber_helpers/agilibox.rb
201
201
  - lib/agilibox/cucumber_helpers/ajax.rb
202
+ - lib/agilibox/cucumber_helpers/apparition.rb
202
203
  - lib/agilibox/cucumber_helpers/capybara.rb
203
204
  - lib/agilibox/cucumber_helpers/capybara_selectors.rb
204
205
  - lib/agilibox/cucumber_helpers/chrome_headless.rb
@@ -243,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
244
  - !ruby/object:Gem::Version
244
245
  version: '0'
245
246
  requirements: []
246
- rubygems_version: 3.0.3
247
+ rubygems_version: 3.1.4
247
248
  signing_key:
248
249
  specification_version: 4
249
250
  summary: Agilibox