decidim-dev 0.27.4 → 0.27.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/cs.yml +4 -4
- data/config/locales/de.yml +1 -1
- data/config/locales/eu.yml +15 -9
- data/config/locales/he-IL.yml +1 -0
- data/config/locales/hu.yml +2 -2
- data/config/locales/pl.yml +8 -0
- data/config/locales/pt-BR.yml +8 -0
- data/config/locales/sq-AL.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/th-TH.yml +1 -0
- data/decidim-dev.gemspec +56 -0
- data/lib/decidim/dev/test/factories.rb +5 -1
- data/lib/decidim/dev/test/rspec_support/capybara.rb +5 -1
- data/lib/decidim/dev/test/rspec_support/concurrency.rb +23 -0
- data/lib/decidim/dev/test/rspec_support/decidim_sanitization.rb +5 -0
- data/lib/decidim/dev/test/rspec_support/geocoder.rb +4 -4
- data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/webpacker.rb +28 -0
- data/lib/decidim/dev/version.rb +1 -1
- metadata +16 -13
- data/config/environment.rb +0 -0
- data/lib/decidim/dev/test/rspec_support/summary_notification.rb +0 -51
- data/lib/rubocop/cop/decidim/hash_shorthand_syntax_backports.rb +0 -175
- data/lib/rubocop/cop/decidim.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 535b92eaf44d4a33ff05bffc29424bfe990425f7774df0d2254de9e1d0e6f75f
|
4
|
+
data.tar.gz: bfd2bf4c7f805c29de0214f7ef76cc078e42d5c7ad1dba36d2db7257e49cffad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbae73519fe76e4f06747455a7236b74a5ed36fc3277b0f43db412f86376ab6eb6ce88eaa9dd80a86514f7137de71bed282c98af423f33769e6e5d5e61c2e0dd
|
7
|
+
data.tar.gz: 1e2ad1c8b10bc31eb99fa8657d30b1a99d544e83ccbfb5150996a559194788267b352d144e3a3f61c5dc7432d85a63cb38e6b8959198a242f6b7104465d08cd0
|
data/config/locales/cs.yml
CHANGED
@@ -24,9 +24,9 @@ cs:
|
|
24
24
|
readonly_attribute: Atribut pouze pro čtení
|
25
25
|
test: Zkouška A
|
26
26
|
test_choices:
|
27
|
-
a:
|
28
|
-
b:
|
29
|
-
c:
|
27
|
+
a: Možnost A
|
28
|
+
b: Možnost B
|
29
|
+
c: Možnost C
|
30
30
|
test_options:
|
31
31
|
bar: Bar
|
32
32
|
baz: Baz
|
@@ -57,7 +57,7 @@ cs:
|
|
57
57
|
unearned_own: Dosud jste nevytvořili žádné testy.
|
58
58
|
resource_links:
|
59
59
|
test_link:
|
60
|
-
dummy_resource_dummy: Související
|
60
|
+
dummy_resource_dummy: Související testovací soubor
|
61
61
|
statistics:
|
62
62
|
bar: Bar
|
63
63
|
dummies_count_high: Figuríny vysoké
|
data/config/locales/de.yml
CHANGED
data/config/locales/eu.yml
CHANGED
@@ -3,8 +3,8 @@ eu:
|
|
3
3
|
activemodel:
|
4
4
|
attributes:
|
5
5
|
dummy_resource:
|
6
|
-
created_at:
|
7
|
-
decidim_scope_id:
|
6
|
+
created_at: Sortua
|
7
|
+
decidim_scope_id: Esparrua
|
8
8
|
field: Nire eremua
|
9
9
|
start_date: Hasiera data
|
10
10
|
title: Izenburua
|
@@ -15,8 +15,14 @@ eu:
|
|
15
15
|
dummy:
|
16
16
|
settings:
|
17
17
|
global:
|
18
|
+
guided: Input gidatua
|
19
|
+
guided_help: Laguntza-testua
|
20
|
+
guided_readonly: Input desgaitua
|
21
|
+
guided_rich: Input gidatu aberastua
|
22
|
+
guided_rich_help_html: HTML<strong>ayuda</strong> testua
|
23
|
+
guided_rich_readonly_html: HTML<strong>laguntza</strong>testua input desgaiturako
|
18
24
|
readonly_attribute: Soilik irakurtzeko atributua
|
19
|
-
test:
|
25
|
+
test: Proba bat
|
20
26
|
test_choices:
|
21
27
|
a: A aukera
|
22
28
|
b: B aukera
|
@@ -36,22 +42,22 @@ eu:
|
|
36
42
|
dummy:
|
37
43
|
admin:
|
38
44
|
exports:
|
39
|
-
dummies:
|
45
|
+
dummies: Probak
|
40
46
|
gamification:
|
41
47
|
badges:
|
42
48
|
test:
|
43
49
|
conditions:
|
44
50
|
- Erabili probako ingurunea erabakitzeko.
|
45
|
-
description:
|
51
|
+
description: Parte-hartzaileek garaikur hau lortzen dute probak sortzeagatik.
|
46
52
|
description_another: Erabiltzaile honek %{score} proba egin ditu.
|
47
53
|
description_own: '%{score} proba sortu dituzu.'
|
48
|
-
name:
|
54
|
+
name: Probak
|
49
55
|
next_level_in: Sortu %{score} proba gehiago hurrengo mailara iristeko!
|
50
|
-
unearned_another: Erabiltzaile honek ez du
|
51
|
-
unearned_own: Oraindik ez duzu
|
56
|
+
unearned_another: Erabiltzaile honek ez du probarik sortu oraindik.
|
57
|
+
unearned_own: Oraindik ez duzu probarik sortu.
|
52
58
|
resource_links:
|
53
59
|
test_link:
|
54
|
-
dummy_resource_dummy: ' Honi
|
60
|
+
dummy_resource_dummy: ' Honi lotutakoa'
|
55
61
|
statistics:
|
56
62
|
bar: Bar
|
57
63
|
dummies_count_high: Dummies altua
|
@@ -0,0 +1 @@
|
|
1
|
+
he:
|
data/config/locales/hu.yml
CHANGED
@@ -20,8 +20,8 @@ hu:
|
|
20
20
|
bar: Oszlop
|
21
21
|
foo: foo
|
22
22
|
step:
|
23
|
-
endorsements_blocked:
|
24
|
-
endorsements_enabled:
|
23
|
+
endorsements_blocked: Támogatások letiltva
|
24
|
+
endorsements_enabled: Támogatások engedélyezve
|
25
25
|
test_options:
|
26
26
|
bar: Oszlop
|
27
27
|
foo: foo
|
data/config/locales/pl.yml
CHANGED
@@ -15,6 +15,12 @@ pl:
|
|
15
15
|
dummy:
|
16
16
|
settings:
|
17
17
|
global:
|
18
|
+
guided: Kierowane wprowadzanie danych
|
19
|
+
guided_help: Tekst pomocy
|
20
|
+
guided_readonly: Zablokowane pole wprowadzania danych
|
21
|
+
guided_rich: Kierowane i rozbudowane wprowadzanie danych
|
22
|
+
guided_rich_help_html: Tekst HTML <strong>pomocy</strong>
|
23
|
+
guided_rich_readonly_html: Treść HTML <strong>pomocy</strong> dla wyłączonego wprowadzania
|
18
24
|
readonly_attribute: Atrybut tylko do odczytu
|
19
25
|
test: Test A
|
20
26
|
test_choices:
|
@@ -23,6 +29,7 @@ pl:
|
|
23
29
|
c: Opcja C
|
24
30
|
test_options:
|
25
31
|
bar: Bar
|
32
|
+
baz: Baz
|
26
33
|
foo: Foo
|
27
34
|
step:
|
28
35
|
endorsements_blocked: Możliwość rekomendacji zablokowana
|
@@ -30,6 +37,7 @@ pl:
|
|
30
37
|
readonly_step_attribute: Atrybut kroku tylko do odczytu
|
31
38
|
test_options:
|
32
39
|
bar: Bar
|
40
|
+
baz: Baz
|
33
41
|
foo: Foo
|
34
42
|
dummy:
|
35
43
|
admin:
|
data/config/locales/pt-BR.yml
CHANGED
@@ -15,6 +15,12 @@ pt-BR:
|
|
15
15
|
dummy:
|
16
16
|
settings:
|
17
17
|
global:
|
18
|
+
guided: Entrada guiada
|
19
|
+
guided_help: Texto de ajuda
|
20
|
+
guided_readonly: Entrada desabilitada
|
21
|
+
guided_rich: Entrada de rich text guiada
|
22
|
+
guided_rich_help_html: HTML <strong>ajuda</strong> texto
|
23
|
+
guided_rich_readonly_html: HTML <strong>ajuda</strong> texto para entrada desativada
|
18
24
|
readonly_attribute: Atributo somente leitura
|
19
25
|
test: Teste A
|
20
26
|
test_choices:
|
@@ -23,6 +29,7 @@ pt-BR:
|
|
23
29
|
c: Escolha C
|
24
30
|
test_options:
|
25
31
|
bar: Bar
|
32
|
+
baz: Baz
|
26
33
|
foo: Foo
|
27
34
|
step:
|
28
35
|
endorsements_blocked: Endossos bloqueados
|
@@ -30,6 +37,7 @@ pt-BR:
|
|
30
37
|
readonly_step_attribute: Atributo passo somente leitura
|
31
38
|
test_options:
|
32
39
|
bar: Bar
|
40
|
+
baz: Baz
|
33
41
|
foo: Foo
|
34
42
|
dummy:
|
35
43
|
admin:
|
@@ -0,0 +1 @@
|
|
1
|
+
sq:
|
data/config/locales/sv.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
th:
|
data/decidim-dev.gemspec
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
4
|
+
|
5
|
+
# Maintain your gem's version:
|
6
|
+
require "decidim/dev/version"
|
7
|
+
|
8
|
+
# Describe your gem and declare its dependencies:
|
9
|
+
Gem::Specification.new do |s|
|
10
|
+
s.version = Decidim::Dev.version
|
11
|
+
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
|
12
|
+
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
|
13
|
+
s.license = "AGPL-3.0"
|
14
|
+
s.homepage = "https://github.com/decidim/decidim"
|
15
|
+
s.required_ruby_version = "~> 3.0.0"
|
16
|
+
|
17
|
+
s.name = "decidim-dev"
|
18
|
+
s.summary = "Decidim dev tools"
|
19
|
+
s.description = "Utilities and tools we need to develop Decidim"
|
20
|
+
|
21
|
+
s.files = Dir.chdir(__dir__) do
|
22
|
+
`git ls-files -z`.split("\x0").select do |f|
|
23
|
+
(File.expand_path(f) == __FILE__) ||
|
24
|
+
f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
s.add_dependency "capybara", "~> 3.24"
|
29
|
+
s.add_dependency "decidim", Decidim::Dev.version
|
30
|
+
s.add_dependency "factory_bot_rails", "~> 4.8"
|
31
|
+
|
32
|
+
s.add_dependency "axe-core-rspec", "~> 4.1.0"
|
33
|
+
s.add_dependency "byebug", "~> 11.0"
|
34
|
+
s.add_dependency "db-query-matchers", "~> 0.10.0"
|
35
|
+
s.add_dependency "erb_lint", "~> 0.0.35"
|
36
|
+
s.add_dependency "i18n-tasks", "~> 0.9.18"
|
37
|
+
s.add_dependency "mdl", "~> 0.5"
|
38
|
+
s.add_dependency "nokogiri", "~> 1.13"
|
39
|
+
s.add_dependency "parallel_tests", "~> 3.7"
|
40
|
+
s.add_dependency "puma", "~> 5.0"
|
41
|
+
s.add_dependency "rails-controller-testing", "~> 1.0"
|
42
|
+
s.add_dependency "rspec-cells", "~> 0.3.7"
|
43
|
+
s.add_dependency "rspec-html-matchers", "~> 0.9.1"
|
44
|
+
s.add_dependency "rspec_junit_formatter", "~> 0.3.0"
|
45
|
+
s.add_dependency "rspec-rails", "~> 4.0"
|
46
|
+
s.add_dependency "rspec-retry", "~> 0.6.2"
|
47
|
+
s.add_dependency "rubocop", "~> 1.28.0"
|
48
|
+
s.add_dependency "rubocop-rails", "~> 2.14"
|
49
|
+
s.add_dependency "rubocop-rspec", "~> 2.10"
|
50
|
+
s.add_dependency "selenium-webdriver", "~> 4.1.0"
|
51
|
+
s.add_dependency "simplecov", "~> 0.21.0"
|
52
|
+
s.add_dependency "simplecov-cobertura", "~> 2.1.0"
|
53
|
+
s.add_dependency "w3c_rspec_validators", "~> 0.3.0"
|
54
|
+
s.add_dependency "webmock", "~> 3.6"
|
55
|
+
s.add_dependency "wisper-rspec", "~> 1.0"
|
56
|
+
end
|
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :dummy_component, parent: :component do
|
5
|
-
|
5
|
+
transient do
|
6
|
+
skip_injection { false }
|
7
|
+
end
|
8
|
+
|
9
|
+
name { generate_component_name(participatory_space.organization.available_locales, :dummy, skip_injection: skip_injection) }
|
6
10
|
manifest_name { :dummy }
|
7
11
|
end
|
8
12
|
end
|
@@ -32,6 +32,8 @@ Capybara.register_driver :headless_chrome do |app|
|
|
32
32
|
options = ::Selenium::WebDriver::Chrome::Options.new
|
33
33
|
options.args << "--headless"
|
34
34
|
options.args << "--no-sandbox"
|
35
|
+
# Do not limit browser resources
|
36
|
+
options.args << "--disable-dev-shm-usage"
|
35
37
|
options.args << if ENV["BIG_SCREEN_SIZE"].present?
|
36
38
|
"--window-size=1920,3000"
|
37
39
|
else
|
@@ -49,6 +51,7 @@ end
|
|
49
51
|
port = rand(5000..6999)
|
50
52
|
begin
|
51
53
|
Socket.tcp("127.0.0.1", port, connect_timeout: 5).close
|
54
|
+
warn "Port #{port} is already in use, trying another one."
|
52
55
|
rescue Errno::ECONNREFUSED
|
53
56
|
# When connection is refused, the port is available for use.
|
54
57
|
Capybara.server_port = port
|
@@ -56,7 +59,6 @@ end
|
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
59
|
-
# In order to work with PWA apps, Chrome can't be run in headless mode, and requires
|
60
62
|
# setting up special prefs and flags
|
61
63
|
Capybara.register_driver :pwa_chrome do |app|
|
62
64
|
options = ::Selenium::WebDriver::Chrome::Options.new
|
@@ -88,6 +90,8 @@ Capybara.register_driver :iphone do |app|
|
|
88
90
|
options = ::Selenium::WebDriver::Chrome::Options.new
|
89
91
|
options.args << "--headless"
|
90
92
|
options.args << "--no-sandbox"
|
93
|
+
# Do not limit browser resources
|
94
|
+
options.args << "--disable-dev-shm-usage"
|
91
95
|
options.add_emulation(device_name: "iPhone 6")
|
92
96
|
|
93
97
|
Capybara::Selenium::Driver.new(
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Note that RSpec also provides `uses_transaction` but it needs to be specific
|
4
|
+
# with the name of the method which can easily break and the concurrency tests
|
5
|
+
# will anyways pass when run with the transactional mode. We want the same
|
6
|
+
# database to be used without transactions during the tests so that we can test
|
7
|
+
# concurrency correctly.
|
8
|
+
RSpec.shared_context "with concurrency" do
|
9
|
+
self.use_transactional_tests = false
|
10
|
+
|
11
|
+
after do
|
12
|
+
# Because the transactional tests are disabled, we need to manually clear
|
13
|
+
# the tables after the test.
|
14
|
+
connection = ActiveRecord::Base.connection
|
15
|
+
connection.disable_referential_integrity do
|
16
|
+
connection.tables.each do |table_name|
|
17
|
+
next if connection.select_value("SELECT COUNT(*) FROM #{table_name}").zero?
|
18
|
+
|
19
|
+
connection.execute("TRUNCATE #{table_name} CASCADE")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -49,7 +49,7 @@ module Decidim::Map::Provider
|
|
49
49
|
def self.add_stub(address, coordinates)
|
50
50
|
stubs.push(
|
51
51
|
properties: address.is_a?(Hash) ? address : { street: address },
|
52
|
-
geometry: { coordinates: coordinates }
|
52
|
+
geometry: { coordinates: coordinates.reverse }
|
53
53
|
)
|
54
54
|
end
|
55
55
|
|
@@ -125,7 +125,7 @@ RSpec.configure do |config|
|
|
125
125
|
country: "Country1"
|
126
126
|
},
|
127
127
|
geometry: {
|
128
|
-
coordinates: [
|
128
|
+
coordinates: [2.234, 1.123]
|
129
129
|
}
|
130
130
|
},
|
131
131
|
{
|
@@ -136,7 +136,7 @@ RSpec.configure do |config|
|
|
136
136
|
country: "Country2"
|
137
137
|
},
|
138
138
|
geometry: {
|
139
|
-
coordinates: [
|
139
|
+
coordinates: [4.456, 3.345]
|
140
140
|
}
|
141
141
|
},
|
142
142
|
{
|
@@ -148,7 +148,7 @@ RSpec.configure do |config|
|
|
148
148
|
country: "Country3"
|
149
149
|
},
|
150
150
|
geometry: {
|
151
|
-
coordinates: [
|
151
|
+
coordinates: [6.678, 5.567]
|
152
152
|
}
|
153
153
|
}
|
154
154
|
]
|
@@ -25,7 +25,7 @@ module TranslationHelpers
|
|
25
25
|
# field - the field that holds the translations
|
26
26
|
# upcase - a boolean to indicate whether the string must be checked upcased or not.
|
27
27
|
def have_i18n_content(field, upcase: false, strip_tags: false)
|
28
|
-
have_content(i18n_content(field, upcase: upcase, strip_tags: strip_tags))
|
28
|
+
have_content(i18n_content(field, upcase: upcase, strip_tags: strip_tags).strip)
|
29
29
|
end
|
30
30
|
|
31
31
|
# Checks that the current page doesn't have some translated content. It strips
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
config.before(:all) do
|
5
|
+
raise "Rails.root directory does not exist" unless Rails.root.exist?
|
6
|
+
raise "package.json file does not exist" unless Rails.root.join("package.json").exist?
|
7
|
+
raise "Node modules directory does not exist" unless Rails.root.join("node_modules").exist?
|
8
|
+
|
9
|
+
Dir.chdir(Rails.root) { Webpacker.compile }
|
10
|
+
rescue Errno::ENOENT
|
11
|
+
node_modules_contents = `ls #{Rails.root.join("node_modules")}`
|
12
|
+
|
13
|
+
message = <<~ERROR
|
14
|
+
There was an error during the Webpacker compilation
|
15
|
+
#{"=" * 80}
|
16
|
+
Node version: #{`node -v`}
|
17
|
+
#{"=" * 80}
|
18
|
+
NPM version: #{`npm -v`}
|
19
|
+
#{"=" * 80}
|
20
|
+
Node modules packages: #{`npm list`}
|
21
|
+
#{"=" * 80}
|
22
|
+
Node modules contents: #{node_modules_contents}
|
23
|
+
#{"=" * 80}
|
24
|
+
ERROR
|
25
|
+
|
26
|
+
raise message
|
27
|
+
end
|
28
|
+
end
|
data/lib/decidim/dev/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
8
8
|
- Marc Riera Casals
|
9
9
|
- Oriol Gual Oliva
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capybara
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.27.
|
35
|
+
version: 0.27.6
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.27.
|
42
|
+
version: 0.27.6
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: factory_bot_rails
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -419,7 +419,6 @@ files:
|
|
419
419
|
- app/views/decidim/dummy_resources/dummy_resources/foo.html.erb
|
420
420
|
- app/views/decidim/dummy_resources/dummy_resources/show.html.erb
|
421
421
|
- config/assets.rb
|
422
|
-
- config/environment.rb
|
423
422
|
- config/locales/am-ET.yml
|
424
423
|
- config/locales/ar-SA.yml
|
425
424
|
- config/locales/ar.yml
|
@@ -452,6 +451,7 @@ files:
|
|
452
451
|
- config/locales/ga-IE.yml
|
453
452
|
- config/locales/gl.yml
|
454
453
|
- config/locales/gn-PY.yml
|
454
|
+
- config/locales/he-IL.yml
|
455
455
|
- config/locales/hr-HR.yml
|
456
456
|
- config/locales/hr.yml
|
457
457
|
- config/locales/hu.yml
|
@@ -486,9 +486,11 @@ files:
|
|
486
486
|
- config/locales/sk.yml
|
487
487
|
- config/locales/sl.yml
|
488
488
|
- config/locales/so-SO.yml
|
489
|
+
- config/locales/sq-AL.yml
|
489
490
|
- config/locales/sr-CS.yml
|
490
491
|
- config/locales/sv.yml
|
491
492
|
- config/locales/sw-KE.yml
|
493
|
+
- config/locales/th-TH.yml
|
492
494
|
- config/locales/ti-ER.yml
|
493
495
|
- config/locales/tr-TR.yml
|
494
496
|
- config/locales/uk.yml
|
@@ -497,6 +499,7 @@ files:
|
|
497
499
|
- config/locales/vi.yml
|
498
500
|
- config/locales/zh-CN.yml
|
499
501
|
- config/locales/zh-TW.yml
|
502
|
+
- decidim-dev.gemspec
|
500
503
|
- lib/decidim-dev.rb
|
501
504
|
- lib/decidim/dev.rb
|
502
505
|
- lib/decidim/dev/assets/5000x5000.png
|
@@ -571,10 +574,12 @@ files:
|
|
571
574
|
- lib/decidim/dev/test/rspec_support/comments.rb
|
572
575
|
- lib/decidim/dev/test/rspec_support/component.rb
|
573
576
|
- lib/decidim/dev/test/rspec_support/component_context.rb
|
577
|
+
- lib/decidim/dev/test/rspec_support/concurrency.rb
|
574
578
|
- lib/decidim/dev/test/rspec_support/confirmation_helpers.rb
|
575
579
|
- lib/decidim/dev/test/rspec_support/content_processing.rb
|
576
580
|
- lib/decidim/dev/test/rspec_support/controller_example_group.rb
|
577
581
|
- lib/decidim/dev/test/rspec_support/data_consent.rb
|
582
|
+
- lib/decidim/dev/test/rspec_support/decidim_sanitization.rb
|
578
583
|
- lib/decidim/dev/test/rspec_support/dynamic_attach.rb
|
579
584
|
- lib/decidim/dev/test/rspec_support/factory_bot.rb
|
580
585
|
- lib/decidim/dev/test/rspec_support/frontend.rb
|
@@ -591,20 +596,18 @@ files:
|
|
591
596
|
- lib/decidim/dev/test/rspec_support/rake_tasks.rb
|
592
597
|
- lib/decidim/dev/test/rspec_support/route_helpers.rb
|
593
598
|
- lib/decidim/dev/test/rspec_support/screenshot_helper.rb
|
594
|
-
- lib/decidim/dev/test/rspec_support/summary_notification.rb
|
595
599
|
- lib/decidim/dev/test/rspec_support/time_helpers.rb
|
596
600
|
- lib/decidim/dev/test/rspec_support/timezone.rb
|
597
601
|
- lib/decidim/dev/test/rspec_support/translation_helpers.rb
|
598
602
|
- lib/decidim/dev/test/rspec_support/warden.rb
|
599
603
|
- lib/decidim/dev/test/rspec_support/webmock.rb
|
604
|
+
- lib/decidim/dev/test/rspec_support/webpacker.rb
|
600
605
|
- lib/decidim/dev/test/rspec_support/wicked_pdf_assets_mock.rb
|
601
606
|
- lib/decidim/dev/test/rspec_support/wisper.rb
|
602
607
|
- lib/decidim/dev/test/rspec_support/z_download_helper.rb
|
603
608
|
- lib/decidim/dev/test/spec_helper.rb
|
604
609
|
- lib/decidim/dev/test/w3c_rspec_validators_overrides.rb
|
605
610
|
- lib/decidim/dev/version.rb
|
606
|
-
- lib/rubocop/cop/decidim.rb
|
607
|
-
- lib/rubocop/cop/decidim/hash_shorthand_syntax_backports.rb
|
608
611
|
- lib/tasks/generators.rake
|
609
612
|
- lib/tasks/lighthouse_report.rake
|
610
613
|
- lib/tasks/locale_checker.rake
|
@@ -612,15 +615,15 @@ homepage: https://github.com/decidim/decidim
|
|
612
615
|
licenses:
|
613
616
|
- AGPL-3.0
|
614
617
|
metadata: {}
|
615
|
-
post_install_message:
|
618
|
+
post_install_message:
|
616
619
|
rdoc_options: []
|
617
620
|
require_paths:
|
618
621
|
- lib
|
619
622
|
required_ruby_version: !ruby/object:Gem::Requirement
|
620
623
|
requirements:
|
621
|
-
- - "
|
624
|
+
- - "~>"
|
622
625
|
- !ruby/object:Gem::Version
|
623
|
-
version:
|
626
|
+
version: 3.0.0
|
624
627
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
625
628
|
requirements:
|
626
629
|
- - ">="
|
@@ -628,7 +631,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
628
631
|
version: '0'
|
629
632
|
requirements: []
|
630
633
|
rubygems_version: 3.2.22
|
631
|
-
signing_key:
|
634
|
+
signing_key:
|
632
635
|
specification_version: 4
|
633
636
|
summary: Decidim dev tools
|
634
637
|
test_files: []
|
data/config/environment.rb
DELETED
File without changes
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RSpec::Core
|
4
|
-
module Notifications
|
5
|
-
class SummaryNotification
|
6
|
-
# Override the original method to add the full path to the spec file and the correct rspec command to rerun the failed spec
|
7
|
-
# The goal is to be able to copy-paste the command to rerun the failed spec without having to manually add the full path to the spec file
|
8
|
-
#
|
9
|
-
# So, instead of:
|
10
|
-
# > rspec ./spec/system/registration_spec.rb:27
|
11
|
-
#
|
12
|
-
# We get:
|
13
|
-
# > bin/rspec ./decidim-core/spec/system/registration_spec.rb:27
|
14
|
-
#
|
15
|
-
# Original code in rspec-core: https://github.com/rspec/rspec-core/blob/8caecca0b9b299ccbaa5c7ea5dd885ab42cd57d3/lib/rspec/core/notifications.rb#L365
|
16
|
-
def colorized_rerun_commands(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
|
17
|
-
rspec_command = running_with_rspec_wrapper? ? "bin/rspec" : "rspec"
|
18
|
-
"\nFailed examples:\n\n" +
|
19
|
-
failed_examples.map do |example|
|
20
|
-
colorizer.wrap("#{rspec_command} #{rerun_argument_for(example)}", RSpec.configuration.failure_color) + " " +
|
21
|
-
colorizer.wrap("# #{example.full_description}", RSpec.configuration.detail_color)
|
22
|
-
end.join("\n")
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def running_with_rspec_wrapper?
|
28
|
-
$0 == "bin/rspec"
|
29
|
-
end
|
30
|
-
|
31
|
-
def rerun_argument_for(example)
|
32
|
-
if running_with_rspec_wrapper?
|
33
|
-
location = location_rerun_argument_for_decidim(example)
|
34
|
-
else
|
35
|
-
location = example.location_rerun_argument
|
36
|
-
end
|
37
|
-
return location unless duplicate_rerun_locations.include?(location)
|
38
|
-
|
39
|
-
conditionally_quote(example.id)
|
40
|
-
end
|
41
|
-
|
42
|
-
def location_rerun_argument_for_decidim(example)
|
43
|
-
absolute_file_path = example.metadata[:absolute_file_path]
|
44
|
-
file_path = example.metadata[:file_path][1..-1]
|
45
|
-
module_dir = absolute_file_path.gsub(file_path, "").split("/")[-1]
|
46
|
-
|
47
|
-
"./#{module_dir}#{file_path}:#{example.metadata[:line_number]}"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,175 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
#
|
4
|
-
# Originally copied from https://github.com/koic/rubocop/blob/master/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb
|
5
|
-
# Copyright (c) 2012-22 Bozhidar Batsov
|
6
|
-
# MIT License
|
7
|
-
#
|
8
|
-
|
9
|
-
module RuboCop
|
10
|
-
module Cop
|
11
|
-
# This module checks for Ruby 3.1's hash value omission syntax.
|
12
|
-
#
|
13
|
-
# For using this on Decidim, we have added the Decidim namespace and also the Backports prefix
|
14
|
-
# to the module name
|
15
|
-
module Decidim
|
16
|
-
module HashShorthandSyntaxBackports
|
17
|
-
OMIT_HASH_VALUE_MSG = "Omit the hash value."
|
18
|
-
EXPLICIT_HASH_VALUE_MSG = "Include the hash value."
|
19
|
-
DO_NOT_MIX_MSG_PREFIX = "Do not mix explicit and implicit hash values."
|
20
|
-
DO_NOT_MIX_OMIT_VALUE_MSG = "#{DO_NOT_MIX_MSG_PREFIX} #{OMIT_HASH_VALUE_MSG}".freeze
|
21
|
-
DO_NOT_MIX_EXPLICIT_VALUE_MSG = "#{DO_NOT_MIX_MSG_PREFIX} #{EXPLICIT_HASH_VALUE_MSG}".freeze
|
22
|
-
|
23
|
-
def on_hash_for_mixed_shorthand(hash_node)
|
24
|
-
return if ignore_mixed_hash_shorthand_syntax?(hash_node)
|
25
|
-
|
26
|
-
hash_value_type_breakdown = breakdown_value_types_of_hash(hash_node)
|
27
|
-
|
28
|
-
if hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown)
|
29
|
-
mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
30
|
-
else
|
31
|
-
no_mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def on_pair(node)
|
36
|
-
return if ignore_hash_shorthand_syntax?(node)
|
37
|
-
|
38
|
-
hash_key_source = node.key.source
|
39
|
-
|
40
|
-
if enforced_shorthand_syntax == "always"
|
41
|
-
return if node.value_omission? || require_hash_value?(hash_key_source, node)
|
42
|
-
|
43
|
-
message = OMIT_HASH_VALUE_MSG
|
44
|
-
replacement = "#{hash_key_source}:"
|
45
|
-
self.config_to_allow_offenses = { "Enabled" => false }
|
46
|
-
else
|
47
|
-
return unless node.value_omission?
|
48
|
-
|
49
|
-
message = EXPLICIT_HASH_VALUE_MSG
|
50
|
-
replacement = "#{hash_key_source}: #{hash_key_source}"
|
51
|
-
end
|
52
|
-
|
53
|
-
register_offense(node, message, replacement)
|
54
|
-
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def register_offense(node, message, replacement)
|
59
|
-
add_offense(node.value, message:) do |corrector|
|
60
|
-
corrector.replace(node, replacement)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def ignore_mixed_hash_shorthand_syntax?(hash_node)
|
65
|
-
target_ruby_version <= 3.0 || enforced_shorthand_syntax != "consistent" ||
|
66
|
-
!hash_node.hash_type?
|
67
|
-
end
|
68
|
-
|
69
|
-
def ignore_hash_shorthand_syntax?(pair_node)
|
70
|
-
target_ruby_version <= 3.0 || enforced_shorthand_syntax == "either" ||
|
71
|
-
enforced_shorthand_syntax == "consistent" ||
|
72
|
-
!pair_node.parent.hash_type?
|
73
|
-
end
|
74
|
-
|
75
|
-
def enforced_shorthand_syntax
|
76
|
-
cop_config.fetch("EnforcedShorthandSyntax", "always")
|
77
|
-
end
|
78
|
-
|
79
|
-
def require_hash_value?(hash_key_source, node)
|
80
|
-
return true if !node.key.sym_type? || require_hash_value_for_around_hash_literal?(node)
|
81
|
-
|
82
|
-
hash_value = node.value
|
83
|
-
return true unless hash_value.send_type? || hash_value.lvar_type?
|
84
|
-
|
85
|
-
hash_key_source != hash_value.source || hash_key_source.end_with?("!", "?")
|
86
|
-
end
|
87
|
-
|
88
|
-
def require_hash_value_for_around_hash_literal?(node)
|
89
|
-
return false unless (ancestor = node.parent.parent)
|
90
|
-
return false if ancestor.send_type? && ancestor.method?(:[])
|
91
|
-
|
92
|
-
!node.parent.braces? && !use_element_of_hash_literal_as_receiver?(ancestor, node.parent) &&
|
93
|
-
(use_modifier_form_without_parenthesized_method_call?(ancestor) ||
|
94
|
-
without_parentheses_call_expr_follows?(ancestor))
|
95
|
-
end
|
96
|
-
|
97
|
-
def use_element_of_hash_literal_as_receiver?(ancestor, parent)
|
98
|
-
# `{value:}.do_something` is a valid syntax.
|
99
|
-
ancestor.send_type? && ancestor.receiver == parent
|
100
|
-
end
|
101
|
-
|
102
|
-
def use_modifier_form_without_parenthesized_method_call?(ancestor)
|
103
|
-
return false if ancestor.respond_to?(:parenthesized?) && ancestor.parenthesized?
|
104
|
-
|
105
|
-
ancestor.ancestors.any? { |node| node.respond_to?(:modifier_form?) && node.modifier_form? }
|
106
|
-
end
|
107
|
-
|
108
|
-
def without_parentheses_call_expr_follows?(ancestor)
|
109
|
-
return false unless ancestor.respond_to?(:parenthesized?) && !ancestor.parenthesized?
|
110
|
-
|
111
|
-
right_sibling = ancestor.right_sibling
|
112
|
-
right_sibling ||= ancestor.each_ancestor.find do |node|
|
113
|
-
node.assignment? || node.send_type?
|
114
|
-
end&.right_sibling
|
115
|
-
|
116
|
-
!!right_sibling
|
117
|
-
end
|
118
|
-
|
119
|
-
def breakdown_value_types_of_hash(hash_node)
|
120
|
-
hash_node.pairs.group_by do |pair_node|
|
121
|
-
if pair_node.value_omission?
|
122
|
-
:value_omitted
|
123
|
-
elsif require_hash_value?(pair_node.key.source, pair_node)
|
124
|
-
:value_needed
|
125
|
-
else
|
126
|
-
:value_omittable
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
def hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown)
|
132
|
-
hash_value_type_breakdown.keys.size > 1
|
133
|
-
end
|
134
|
-
|
135
|
-
def hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown)
|
136
|
-
hash_value_type_breakdown[:value_needed]&.any?
|
137
|
-
end
|
138
|
-
|
139
|
-
def each_omitted_value_pair(hash_value_type_breakdown, &)
|
140
|
-
hash_value_type_breakdown[:value_omitted]&.each(&)
|
141
|
-
end
|
142
|
-
|
143
|
-
def each_omittable_value_pair(hash_value_type_breakdown, &)
|
144
|
-
hash_value_type_breakdown[:value_omittable]&.each(&)
|
145
|
-
end
|
146
|
-
|
147
|
-
def mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
148
|
-
if hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown)
|
149
|
-
each_omitted_value_pair(hash_value_type_breakdown) do |pair_node|
|
150
|
-
hash_key_source = pair_node.key.source
|
151
|
-
replacement = "#{hash_key_source}: #{hash_key_source}"
|
152
|
-
register_offense(pair_node, DO_NOT_MIX_EXPLICIT_VALUE_MSG, replacement)
|
153
|
-
end
|
154
|
-
else
|
155
|
-
each_omittable_value_pair(hash_value_type_breakdown) do |pair_node|
|
156
|
-
hash_key_source = pair_node.key.source
|
157
|
-
replacement = "#{hash_key_source}:"
|
158
|
-
register_offense(pair_node, DO_NOT_MIX_OMIT_VALUE_MSG, replacement)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
def no_mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
164
|
-
return if hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown)
|
165
|
-
|
166
|
-
each_omittable_value_pair(hash_value_type_breakdown) do |pair_node|
|
167
|
-
hash_key_source = pair_node.key.source
|
168
|
-
replacement = "#{hash_key_source}:"
|
169
|
-
register_offense(pair_node, OMIT_HASH_VALUE_MSG, replacement)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|