agilibox 1.9.8 → 1.9.13

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
  SHA256:
3
- metadata.gz: 6db63f7d40fc5d844cb8951a180b72b1437837b568ec8b04b3402c0df6d864de
4
- data.tar.gz: b605e6152407fef7469adac96d0a62553e62203c06fc4648e6955aaae5f51859
3
+ metadata.gz: 577884f829d930ff72448f21529d3f05b836ff3a72414ca020a52a9d39fe7adf
4
+ data.tar.gz: 54ab04e77e1b7982dfa861731c568b07a81ac8885d9dddbb5ed7251ab3806cff
5
5
  SHA512:
6
- metadata.gz: 6ecd8c65a5004bef0fb2b81754196dc69977be4574ab96ab7e4e7656461653a4fa6be004d2c6b1b36a0b54189b3e81efcf7b29ca9e513ab38ddf25750128eadc
7
- data.tar.gz: eb231c1796cb963cbc997a01bc5621d3f0d8cb6f98bd4a9f7e042321d4beeab655393311349b3c4a0d222ce803c7704a2ed4dc91d040b1b2a1acf4eaf7d0a725
6
+ metadata.gz: df3afc115ae89d1ac41ab0913ddc89e9ff53836625b864f8fe3a81516074113e8bae9154926676d4a2db60e8d362d3ecd88d273065e0931fe519787779e714d1
7
+ data.tar.gz: 0ab62749bbfbbcbdb5b8e0f05c05225d6d4aa0c880a19841a4c5de5c4930d708ef344f1f3723589e3f36275e8232191e9ce85ff75de454dd5db446710f26d37f
@@ -2,7 +2,22 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## v1.9.13
6
+ - Add apparition capybara driver
7
+
8
+ ## v1.9.12
9
+ - Fix some Ruby 2.7 warnings
10
+
11
+ ## v1.9.11
12
+ - Fix some Ruby 2.7 warnings
13
+
14
+ ## v1.9.10
15
+ - Fix some Ruby 2.7 warnings
16
+
5
17
  ## v1.9.9
18
+ - Add error to ErrorsMiddleware
19
+
20
+ ## v1.9.8
6
21
  - Fix `tags` helper
7
22
 
8
23
  ## v1.9.7
@@ -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(...)
6
+ new(...).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
@@ -10,6 +10,7 @@ class Agilibox::ErrorsMiddleware
10
10
  "ActionController::UnknownFormat",
11
11
  "ActionController::UnknownHttpMethod",
12
12
  "ActionView::MissingTemplate",
13
+ "Mime::Type::InvalidMimeType",
13
14
  ]
14
15
 
15
16
  def initialize(app)
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.9.8"
2
+ VERSION = "1.9.13"
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.8
4
+ version: 1.9.13
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