decidim-generators 0.31.5 → 0.32.0.rc2
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 +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +412 -390
- data/README.md +2 -4
- data/decidim-generators.gemspec +4 -6
- data/exe/decidim +14 -7
- data/lib/decidim/generators/app_generator.rb +15 -19
- data/lib/decidim/generators/app_templates/.ruby-version +1 -1
- data/lib/decidim/generators/app_templates/storage.yml +9 -6
- data/lib/decidim/generators/component_generator.rb +1 -1
- data/lib/decidim/generators/component_templates/.ruby-version +1 -1
- data/lib/decidim/generators/component_templates/Gemfile.erb +7 -7
- data/lib/decidim/generators/component_templates/github/{ci.yml.erb → ci.yml} +5 -5
- data/lib/decidim/generators/component_templates/lib/decidim/component/component.rb.erb +0 -4
- data/lib/decidim/generators/test/generator_examples.rb +17 -42
- data/lib/decidim/generators/version.rb +1 -1
- metadata +7 -10
data/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# decidim-generators
|
|
2
2
|
|
|
3
3
|
This gem provides several generators to create decidim applications & components
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
gem install decidim-generators
|
|
9
|
-
```
|
|
7
|
+
This is on the default Decidim installation so you should not change anything to use this feature.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
data/decidim-generators.gemspec
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
|
4
4
|
|
|
5
|
-
# Maintain your gem's version:
|
|
6
|
-
require "decidim/generators/version"
|
|
7
|
-
|
|
8
5
|
Gem::Specification.new do |s|
|
|
9
|
-
|
|
6
|
+
version = "0.32.0.rc2"
|
|
7
|
+
s.version = version
|
|
10
8
|
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
|
|
11
9
|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
|
|
12
10
|
s.license = "AGPL-3.0-or-later"
|
|
@@ -18,7 +16,7 @@ Gem::Specification.new do |s|
|
|
|
18
16
|
"homepage_uri" => "https://decidim.org",
|
|
19
17
|
"source_code_uri" => "https://github.com/decidim/decidim"
|
|
20
18
|
}
|
|
21
|
-
s.required_ruby_version = "~> 3.
|
|
19
|
+
s.required_ruby_version = "~> 3.4.0"
|
|
22
20
|
|
|
23
21
|
s.name = "decidim-generators"
|
|
24
22
|
|
|
@@ -36,7 +34,7 @@ Gem::Specification.new do |s|
|
|
|
36
34
|
s.executables = ["decidim"]
|
|
37
35
|
s.require_paths = ["lib"]
|
|
38
36
|
|
|
39
|
-
s.add_dependency "decidim-core",
|
|
37
|
+
s.add_dependency "decidim-core", version
|
|
40
38
|
|
|
41
39
|
s.add_development_dependency "bundler", "~> 2.2"
|
|
42
40
|
end
|
data/exe/decidim
CHANGED
|
@@ -9,29 +9,29 @@ if File.exist?(File.expand_path("../../.git", __dir__))
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
case ARGV[0]
|
|
12
|
-
when "--component"
|
|
12
|
+
when "--component", "-c"
|
|
13
13
|
ARGV.replace(["component", *ARGV[1..-1]])
|
|
14
14
|
|
|
15
15
|
require "decidim/generators/component_generator"
|
|
16
16
|
|
|
17
17
|
Decidim::Generators::ComponentGenerator.start
|
|
18
|
-
when "--version"
|
|
18
|
+
when "--version", "-v"
|
|
19
19
|
require "decidim/core/version"
|
|
20
20
|
puts Decidim::Core.version
|
|
21
|
-
when "--help"
|
|
21
|
+
when "--help", "-h"
|
|
22
22
|
require "decidim/core/version"
|
|
23
23
|
puts "Decidim #{Decidim::Core.version}
|
|
24
24
|
Syntax: decidim [options] [App or Module name]
|
|
25
25
|
https://decidim.org
|
|
26
26
|
|
|
27
27
|
Options:
|
|
28
|
-
--help display this help and exit
|
|
29
|
-
--version output version information and exit
|
|
30
|
-
--component [name] creates a component for Decidim
|
|
28
|
+
-h, --help display this help and exit
|
|
29
|
+
-v, --version output version information and exit
|
|
30
|
+
-c, --component [name] creates a component for Decidim
|
|
31
31
|
[name] creates an application based on Decidim
|
|
32
32
|
|
|
33
33
|
App generation extra options (ignored if the --component flag is on):
|
|
34
|
-
--storage [provider] Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs
|
|
34
|
+
--storage [provider] Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs
|
|
35
35
|
--queue [provider] Setup the Gemfile with the appropriate gem to handle a job queue backend. Only 'sidekiq' is supported as option for now.
|
|
36
36
|
--force_ssl [true|false] Enables or disables mandatory redirection to HTTPS (defaults to enabled)
|
|
37
37
|
--locales [locales] Force the available locales to the ones specified. Separate with comas
|
|
@@ -48,6 +48,10 @@ App generation extra options (ignored if the --component flag is on):
|
|
|
48
48
|
--seed_db [true|false] Seed the database: generate demo data for each participatory space and component
|
|
49
49
|
--recreate_db Recreate the database after installing Decidim
|
|
50
50
|
|
|
51
|
+
Component generation extra options (ignored if the --component flag is not defined)
|
|
52
|
+
--external To create a new module external to the main decidim repository
|
|
53
|
+
--destination-folder IF you want to point to an existing folder or give it a custom name
|
|
54
|
+
|
|
51
55
|
Examples:
|
|
52
56
|
decidim my-application
|
|
53
57
|
decidim --storage=s3 my-application
|
|
@@ -55,6 +59,9 @@ Examples:
|
|
|
55
59
|
decidim --locales=en,ca,es,fr my-application
|
|
56
60
|
decidim --queue sidekiq my-application
|
|
57
61
|
decidim --queue sidekiq --storage s3 my-application
|
|
62
|
+
|
|
63
|
+
decidim --component --external my_component
|
|
64
|
+
decidim --component --external my_component --destination-folder my-comp
|
|
58
65
|
"
|
|
59
66
|
else
|
|
60
67
|
require "decidim/generators/app_generator"
|
|
@@ -79,7 +79,7 @@ module Decidim
|
|
|
79
79
|
|
|
80
80
|
class_option :storage, type: :string,
|
|
81
81
|
default: "local",
|
|
82
|
-
desc: "Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs
|
|
82
|
+
desc: "Setup the Gemfile with the appropriate gem to handle a storage provider. Supported options are: local (default), s3, gcs"
|
|
83
83
|
|
|
84
84
|
class_option :queue, type: :string,
|
|
85
85
|
default: "",
|
|
@@ -119,13 +119,14 @@ module Decidim
|
|
|
119
119
|
gsub_file "config/environments/production.rb", /config\.assets.*$/, ""
|
|
120
120
|
end
|
|
121
121
|
|
|
122
|
+
def patch_production_file
|
|
123
|
+
gsub_file "config/environments/production.rb", /config\.action_mailer\.default_url_options = { host: "example.com" }$/,
|
|
124
|
+
"# config.action_mailer.default_url_options = { host: \"example.com\" }"
|
|
125
|
+
end
|
|
126
|
+
|
|
122
127
|
def patch_test_file
|
|
123
|
-
gsub_file "config/environments/test.rb", /config\.action_mailer\.default_url_options = { host: "
|
|
124
|
-
"# config.action_mailer.default_url_options = { host: \"
|
|
125
|
-
gsub_file "config/environments/test.rb", /config\.action_controller\.raise_on_missing_callback_actions = true$/,
|
|
126
|
-
"# config.action_controller.raise_on_missing_callback_actions = false"
|
|
127
|
-
gsub_file "config/environments/development.rb", /config\.action_controller\.raise_on_missing_callback_actions = true$/,
|
|
128
|
-
"# config.action_controller.raise_on_missing_callback_actions = false"
|
|
128
|
+
gsub_file "config/environments/test.rb", /config\.action_mailer\.default_url_options = { host: "example.com" }$/,
|
|
129
|
+
"# config.action_mailer.default_url_options = { host: \"example.com\" }"
|
|
129
130
|
end
|
|
130
131
|
|
|
131
132
|
def disable_annotate_rendered_view_on_development
|
|
@@ -210,14 +211,13 @@ module Decidim
|
|
|
210
211
|
|
|
211
212
|
providers = options[:storage].split(",")
|
|
212
213
|
|
|
213
|
-
abort("#{providers} is not supported as storage provider, please use local, s3
|
|
214
|
+
abort("#{providers} is not supported as storage provider, please use local, s3 or gcs") unless (providers - %w(local s3 gcs)).empty?
|
|
214
215
|
gsub_file "config/environments/production.rb",
|
|
215
216
|
/config.active_storage.service = :local/,
|
|
216
217
|
%{config.active_storage.service = Decidim::Env.new("STORAGE_PROVIDER", "local").to_s}
|
|
217
218
|
|
|
218
219
|
add_production_gems do
|
|
219
220
|
gem "aws-sdk-s3", require: false if providers.include?("s3")
|
|
220
|
-
gem "azure-storage-blob", require: false if providers.include?("azure")
|
|
221
221
|
gem "google-cloud-storage", "~> 1.11", require: false if providers.include?("gcs")
|
|
222
222
|
end
|
|
223
223
|
end
|
|
@@ -344,19 +344,11 @@ module Decidim
|
|
|
344
344
|
end
|
|
345
345
|
|
|
346
346
|
def production_environment
|
|
347
|
-
gsub_file "config/environments/production.rb",
|
|
348
|
-
/config.log_level = :info/,
|
|
349
|
-
"config.log_level = %w(debug info warn error fatal).include?(ENV['RAILS_LOG_LEVEL']) ? ENV['RAILS_LOG_LEVEL'] : :info"
|
|
350
|
-
|
|
351
347
|
gsub_file "config/environments/production.rb",
|
|
352
348
|
%r{# config.asset_host = "http://assets.example.com"},
|
|
353
349
|
"config.asset_host = ENV['RAILS_ASSET_HOST'] if ENV['RAILS_ASSET_HOST'].present?"
|
|
354
|
-
gsub_file "config/environments/production.rb",
|
|
355
|
-
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
|
356
|
-
config.logger = ActiveSupport::Logger.new(STDOUT)
|
|
357
|
-
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
|
358
|
-
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
|
359
|
-
end
|
|
350
|
+
gsub_file "config/environments/production.rb", /config\.logger\s*=\s*ActiveSupport::TaggedLogging\.logger\(STDOUT\)/, <<~CONFIG
|
|
351
|
+
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) if ENV["RAILS_LOG_TO_STDOUT"].present?
|
|
360
352
|
CONFIG
|
|
361
353
|
end
|
|
362
354
|
|
|
@@ -380,6 +372,10 @@ module Decidim
|
|
|
380
372
|
CONFIG
|
|
381
373
|
end
|
|
382
374
|
|
|
375
|
+
def patch_controller
|
|
376
|
+
gsub_file "app/controllers/application_controller.rb", /\n stale_when_importmap_changes/, ""
|
|
377
|
+
end
|
|
378
|
+
|
|
383
379
|
def authorization_handler
|
|
384
380
|
return unless options[:demo]
|
|
385
381
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.7
|
|
@@ -15,12 +15,15 @@ s3:
|
|
|
15
15
|
<%= "region: #{Decidim::Env.new("AWS_REGION").to_s}" if Decidim::Env.new("AWS_REGION").present? %>
|
|
16
16
|
<%= "endpoint: #{ Decidim::Env.new("AWS_ENDPOINT").to_s}" if Decidim::Env.new("AWS_ENDPOINT").present? %>
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
# Rails core team removed support for Azure Storage, as the official Azure Ruby gems are not maintained since 2024.
|
|
19
|
+
# See https://github.com/rails/rails/issues/49983
|
|
20
|
+
# You can use an unofficial gem: https://github.com/testdouble/azure-blob
|
|
21
|
+
#azure:
|
|
22
|
+
# service: AzureBlob
|
|
23
|
+
# public: <%= Decidim::Env.new("AZURE_PUBLIC", "true").to_boolean_string %>
|
|
24
|
+
# storage_account_name: <%= Decidim::Env.new("AZURE_STORAGE_ACCOUNT_NAME").to_s %>
|
|
25
|
+
# storage_access_key: <%= Decidim::Env.new("AZURE_STORAGE_ACCESS_KEY").to_s %>
|
|
26
|
+
# container: <%= Decidim::Env.new("AZURE_CONTAINER").to_s %>
|
|
24
27
|
|
|
25
28
|
gcs:
|
|
26
29
|
service: GCS
|
|
@@ -48,7 +48,7 @@ module Decidim
|
|
|
48
48
|
template "LICENSE-AGPLv3.txt", "#{component_folder}/LICENSE-AGPLv3.txt"
|
|
49
49
|
template "README.md.erb", "#{component_folder}/README.md"
|
|
50
50
|
template "gitignore", "#{component_folder}/.gitignore"
|
|
51
|
-
template "github/ci.yml
|
|
51
|
+
template "github/ci.yml", "#{component_folder}/.github/workflows/ci_#{component_name}.yml"
|
|
52
52
|
template "package.json.erb", "#{component_folder}/package.json"
|
|
53
53
|
copy_file ".ruby-version", "#{component_folder}/.ruby-version"
|
|
54
54
|
copy_file ".node-version", "#{component_folder}/.node-version"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.7
|
|
@@ -5,21 +5,21 @@ source "https://rubygems.org"
|
|
|
5
5
|
|
|
6
6
|
ruby RUBY_VERSION
|
|
7
7
|
|
|
8
|
-
gem "decidim", "~> 0.
|
|
8
|
+
gem "decidim", "~> 0.32.0.rc2"
|
|
9
9
|
gem "decidim-<%= component_name %>", path: "."
|
|
10
10
|
|
|
11
11
|
gem "puma", ">= 6.3.1"
|
|
12
|
-
gem "bootsnap", "~> 1.
|
|
12
|
+
gem "bootsnap", "~> 1.23"
|
|
13
13
|
|
|
14
14
|
group :development, :test do
|
|
15
|
-
gem "byebug", "~>
|
|
15
|
+
gem "byebug", "~> 13.0", platform: :mri
|
|
16
16
|
|
|
17
|
-
gem "decidim-dev", "~> 0.
|
|
17
|
+
gem "decidim-dev", "~> 0.32.0.rc2"
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
group :development do
|
|
21
21
|
gem "faker", "~> 3.2"
|
|
22
|
-
gem "letter_opener_web", "~>
|
|
23
|
-
gem "listen", "~> 3.
|
|
24
|
-
gem "web-console", "~> 4.
|
|
22
|
+
gem "letter_opener_web", "~> 3.0"
|
|
23
|
+
gem "listen", "~> 3.10"
|
|
24
|
+
gem "web-console", "~> 4.3"
|
|
25
25
|
end
|
|
@@ -39,19 +39,19 @@ jobs:
|
|
|
39
39
|
DATABASE_PASSWORD: postgres
|
|
40
40
|
DATABASE_HOST: localhost
|
|
41
41
|
steps:
|
|
42
|
-
- uses: actions/checkout@
|
|
42
|
+
- uses: actions/checkout@v6
|
|
43
43
|
with:
|
|
44
44
|
fetch-depth: 1
|
|
45
45
|
- uses: ruby/setup-ruby@v1
|
|
46
46
|
with:
|
|
47
47
|
bundler-cache: true
|
|
48
|
-
- uses: actions/setup-node@
|
|
48
|
+
- uses: actions/setup-node@v6
|
|
49
49
|
with:
|
|
50
50
|
node-version: ${{ env.NODE_VERSION }}
|
|
51
51
|
- name: Get npm cache directory path
|
|
52
52
|
id: npm-cache-dir-path
|
|
53
53
|
run: echo "dir=$(npm get cache)-<%= component_name %>" >> $GITHUB_OUTPUT
|
|
54
|
-
- uses: actions/cache@
|
|
54
|
+
- uses: actions/cache@v5
|
|
55
55
|
id: npm-cache
|
|
56
56
|
with:
|
|
57
57
|
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
|
|
@@ -68,8 +68,8 @@ jobs:
|
|
|
68
68
|
working-directory: ./spec/decidim_dummy_app/
|
|
69
69
|
- run: bundle exec rspec
|
|
70
70
|
name: RSpec
|
|
71
|
-
- uses: codecov/codecov-action@
|
|
72
|
-
- uses: actions/upload-artifact@
|
|
71
|
+
- uses: codecov/codecov-action@v6
|
|
72
|
+
- uses: actions/upload-artifact@v7
|
|
73
73
|
if: always()
|
|
74
74
|
with:
|
|
75
75
|
name: screenshots
|
|
@@ -7,10 +7,6 @@ Decidim.register_component(:<%= component_name %>) do |component|
|
|
|
7
7
|
component.admin_engine = Decidim::<%= component_module_name %>::AdminEngine
|
|
8
8
|
component.icon = "decidim/<%= component_name %>/icon.svg"
|
|
9
9
|
|
|
10
|
-
# component.on(:before_destroy) do |instance|
|
|
11
|
-
# # Code executed before removing the component
|
|
12
|
-
# end
|
|
13
|
-
|
|
14
10
|
# These actions permissions can be configured in the admin panel
|
|
15
11
|
# component.actions = %w()
|
|
16
12
|
|
|
@@ -27,7 +27,6 @@ shared_context "when generating a new application" do
|
|
|
27
27
|
Bundler.with_original_env { Decidim::GemManager.capture(command, env:) }
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
# rubocop:disable RSpec/BeforeAfterAll
|
|
31
30
|
before(:all) do
|
|
32
31
|
Bundler.with_original_env { Decidim::GemManager.install_all(out: File::NULL) }
|
|
33
32
|
end
|
|
@@ -35,7 +34,6 @@ shared_context "when generating a new application" do
|
|
|
35
34
|
after(:all) do
|
|
36
35
|
Bundler.with_original_env { Decidim::GemManager.uninstall_all(out: File::NULL) }
|
|
37
36
|
end
|
|
38
|
-
# rubocop:enable RSpec/BeforeAfterAll
|
|
39
37
|
end
|
|
40
38
|
|
|
41
39
|
shared_examples_for "a new production application" do
|
|
@@ -677,80 +675,67 @@ shared_examples_for "an application with configurable env vars" do
|
|
|
677
675
|
it "env vars generate secrets application" do
|
|
678
676
|
expect(result[1]).to be_success, result[0]
|
|
679
677
|
|
|
680
|
-
# Test onto the initializer when ENV vars are empty strings or undefined
|
|
681
|
-
json_off = initializer_config_for(test_app, env_off)
|
|
682
678
|
initializer_off.each do |key, value|
|
|
683
|
-
|
|
679
|
+
# Test onto the initializer when ENV vars are empty strings or undefined
|
|
680
|
+
current = rails_value("Decidim.#{key}", test_app, env_off)
|
|
684
681
|
expect(current).to eq(value), "Initializer (#{key}) = (#{current}) expected to match Env:OFF (#{value})"
|
|
685
|
-
end
|
|
686
682
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
initializer_off.each do |key, value|
|
|
690
|
-
current = json_false[key]
|
|
683
|
+
# Test onto the initializer when ENV vars are set to the string "false"
|
|
684
|
+
current = rails_value("Decidim.#{key}", test_app, env_false)
|
|
691
685
|
expect(current).to eq(value), "Initializer (#{key}) = (#{current}) expected to match Env:FALSE (#{value})"
|
|
692
686
|
end
|
|
693
687
|
|
|
694
688
|
# Test onto the initializer when ENV vars are set
|
|
695
|
-
json_on = initializer_config_for(test_app, env_on)
|
|
696
689
|
initializer_on.each do |key, value|
|
|
697
|
-
current =
|
|
690
|
+
current = rails_value("Decidim.#{key}", test_app, env_on)
|
|
698
691
|
expect(current).to eq(value), "Initializer (#{key}) = (#{current}) expected to match Env:ON (#{value})"
|
|
699
692
|
end
|
|
700
693
|
|
|
701
694
|
# Test onto the initializer when ENV vars are set to OpenStreetMap configuration
|
|
702
|
-
json_on = initializer_config_for(test_app, env_maps_osm)
|
|
703
695
|
initializer_maps_osm.each do |key, value|
|
|
704
|
-
current =
|
|
696
|
+
current = rails_value("Decidim.#{key}", test_app, env_maps_osm)
|
|
705
697
|
expect(current).to eq(value), "Initializer (#{key}) = (#{current}) expected to match Env:Maps OSM (#{value})"
|
|
706
698
|
end
|
|
707
699
|
|
|
708
700
|
# Test onto the initializer when ENV vars are set to OpenStreetMap-HERE mix configuration
|
|
709
|
-
json_on = initializer_config_for(test_app, env_maps_mix)
|
|
710
701
|
initializer_maps_mix.each do |key, value|
|
|
711
|
-
current =
|
|
702
|
+
current = rails_value("Decidim.#{key}", test_app, env_maps_mix)
|
|
712
703
|
expect(current).to eq(value), "Initializer (#{key}) = (#{current}) expected to match Env:Maps MIX (#{value})"
|
|
713
704
|
end
|
|
714
705
|
|
|
715
706
|
# Test onto the initializer with ENV vars OFF for the API module
|
|
716
|
-
json_off = initializer_config_for(test_app, env_off, "Decidim::Api")
|
|
717
707
|
api_initializer_off.each do |key, value|
|
|
718
|
-
current =
|
|
708
|
+
current = rails_value("Decidim::Api.#{key}", test_app, env_off)
|
|
719
709
|
expect(current).to eq(value), "API Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
720
710
|
end
|
|
721
711
|
|
|
722
712
|
# Test onto the initializer with ENV vars ON for the API module
|
|
723
|
-
json_on = initializer_config_for(test_app, env_on, "Decidim::Api")
|
|
724
713
|
api_initializer_on.each do |key, value|
|
|
725
|
-
current =
|
|
714
|
+
current = rails_value("Decidim::Api.#{key}", test_app, env_on)
|
|
726
715
|
expect(current).to eq(value), "API Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
727
716
|
end
|
|
728
717
|
|
|
729
718
|
# Test onto the initializer with ENV vars OFF for the Proposals module
|
|
730
|
-
json_off = initializer_config_for(test_app, env_off, "Decidim::Proposals")
|
|
731
719
|
proposals_initializer_off.each do |key, value|
|
|
732
|
-
current =
|
|
720
|
+
current = rails_value("Decidim::Proposals.#{key}", test_app, env_off)
|
|
733
721
|
expect(current).to eq(value), "Proposals Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
734
722
|
end
|
|
735
723
|
|
|
736
724
|
# Test onto the initializer with ENV vars ON for the Proposals module
|
|
737
|
-
json_on = initializer_config_for(test_app, env_on, "Decidim::Proposals")
|
|
738
725
|
proposals_initializer_on.each do |key, value|
|
|
739
|
-
current =
|
|
726
|
+
current = rails_value("Decidim::Proposals.#{key}", test_app, env_on)
|
|
740
727
|
expect(current).to eq(value), "Proposals Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
741
728
|
end
|
|
742
729
|
|
|
743
730
|
# Test onto the initializer with ENV vars OFF for the Meetings module
|
|
744
|
-
json_off = initializer_config_for(test_app, env_off, "Decidim::Meetings")
|
|
745
731
|
meetings_initializer_off.each do |key, value|
|
|
746
|
-
current =
|
|
732
|
+
current = rails_value("Decidim::Meetings.#{key}", test_app, env_off)
|
|
747
733
|
expect(current).to eq(value), "Meetings Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
748
734
|
end
|
|
749
735
|
|
|
750
736
|
# Test onto the initializer with ENV vars ON for the Meetings module
|
|
751
|
-
json_on = initializer_config_for(test_app, env_on, "Decidim::Meetings")
|
|
752
737
|
meetings_initializer_on.each do |key, value|
|
|
753
|
-
current =
|
|
738
|
+
current = rails_value("Decidim::Meetings.#{key}", test_app, env_on)
|
|
754
739
|
expect(current).to eq(value), "Meetings Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
755
740
|
end
|
|
756
741
|
|
|
@@ -805,16 +790,14 @@ shared_examples_for "an application with extra configurable env vars" do
|
|
|
805
790
|
expect(result[1]).to be_success, result[0]
|
|
806
791
|
|
|
807
792
|
# Test onto the initializer with ENV vars OFF for the Initiatives module
|
|
808
|
-
json_off = initializer_config_for(test_app, env_off, "Decidim::Initiatives")
|
|
809
793
|
initiatives_initializer_off.each do |key, value|
|
|
810
|
-
current =
|
|
794
|
+
current = rails_value("Decidim::Initiatives.#{key}", test_app, env_off)
|
|
811
795
|
expect(current).to eq(value), "Initiatives Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
812
796
|
end
|
|
813
797
|
|
|
814
798
|
# Test onto the initializer with ENV vars ON for the Initiatives module
|
|
815
|
-
json_on = initializer_config_for(test_app, env_on, "Decidim::Initiatives")
|
|
816
799
|
initiatives_initializer_on.each do |key, value|
|
|
817
|
-
current =
|
|
800
|
+
current = rails_value("Decidim::Initiatives.#{key}", test_app, env_on)
|
|
818
801
|
expect(current).to eq(value), "Initiatives Initializer (#{key}) = (#{current}) expected to match Env (#{value})"
|
|
819
802
|
end
|
|
820
803
|
end
|
|
@@ -828,7 +811,7 @@ end
|
|
|
828
811
|
|
|
829
812
|
shared_examples_for "an application with cloud storage gems" do
|
|
830
813
|
let(:services) do
|
|
831
|
-
%w(local s3 gcs
|
|
814
|
+
%w(local s3 gcs)
|
|
832
815
|
end
|
|
833
816
|
let(:storage_envs) do
|
|
834
817
|
{
|
|
@@ -837,10 +820,7 @@ shared_examples_for "an application with cloud storage gems" do
|
|
|
837
820
|
"AWS_SECRET_ACCESS_KEY" => "my-aws-secret",
|
|
838
821
|
"AWS_REGION" => "eu-west-1",
|
|
839
822
|
# "AWS_ENDPOINT" => "https://s3.amazonaws.com",
|
|
840
|
-
"AWS_BUCKET" => "test"
|
|
841
|
-
"AZURE_STORAGE_ACCOUNT_NAME" => "test",
|
|
842
|
-
"AZURE_STORAGE_ACCESS_KEY" => "dGVzdA==\n", # Base64 of "test"
|
|
843
|
-
"AZURE_CONTAINER" => "test"
|
|
823
|
+
"AWS_BUCKET" => "test"
|
|
844
824
|
}
|
|
845
825
|
end
|
|
846
826
|
|
|
@@ -849,7 +829,6 @@ shared_examples_for "an application with cloud storage gems" do
|
|
|
849
829
|
|
|
850
830
|
expect(File.read("#{test_app}/Gemfile"))
|
|
851
831
|
.to match(/gem ["']+aws-sdk-s3["']+/)
|
|
852
|
-
.and match(/gem ["']+azure-storage-blob["']+/)
|
|
853
832
|
.and match(/gem ["']+google-cloud-storage["']+/)
|
|
854
833
|
|
|
855
834
|
services.each do |service|
|
|
@@ -897,10 +876,6 @@ shared_examples_for "an application with storage and queue gems" do
|
|
|
897
876
|
end
|
|
898
877
|
end
|
|
899
878
|
|
|
900
|
-
def initializer_config_for(path, env, mod = "Decidim")
|
|
901
|
-
JSON.parse cmd_capture(path, "bin/rails runner 'puts #{mod}.config.to_json'", env:)
|
|
902
|
-
end
|
|
903
|
-
|
|
904
879
|
def rails_value(value, path, env)
|
|
905
880
|
JSON.parse cmd_capture(path, "bin/rails runner 'puts #{value}.to_json'", env:)
|
|
906
881
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-generators
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.32.0.rc2
|
|
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:
|
|
11
10
|
bindir: exe
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: decidim-core
|
|
@@ -18,14 +17,14 @@ dependencies:
|
|
|
18
17
|
requirements:
|
|
19
18
|
- - '='
|
|
20
19
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 0.
|
|
20
|
+
version: 0.32.0.rc2
|
|
22
21
|
type: :runtime
|
|
23
22
|
prerelease: false
|
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
24
|
requirements:
|
|
26
25
|
- - '='
|
|
27
26
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 0.
|
|
27
|
+
version: 0.32.0.rc2
|
|
29
28
|
- !ruby/object:Gem::Dependency
|
|
30
29
|
name: bundler
|
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -112,7 +111,7 @@ files:
|
|
|
112
111
|
- lib/decidim/generators/component_templates/config/i18n-tasks.yml.erb
|
|
113
112
|
- lib/decidim/generators/component_templates/config/locales/en.yml.erb
|
|
114
113
|
- lib/decidim/generators/component_templates/decidim-component.gemspec.erb
|
|
115
|
-
- lib/decidim/generators/component_templates/github/ci.yml
|
|
114
|
+
- lib/decidim/generators/component_templates/github/ci.yml
|
|
116
115
|
- lib/decidim/generators/component_templates/gitignore
|
|
117
116
|
- lib/decidim/generators/component_templates/lib/decidim/component.rb.erb
|
|
118
117
|
- lib/decidim/generators/component_templates/lib/decidim/component/admin.rb.erb
|
|
@@ -138,7 +137,6 @@ metadata:
|
|
|
138
137
|
funding_uri: https://opencollective.com/decidim
|
|
139
138
|
homepage_uri: https://decidim.org
|
|
140
139
|
source_code_uri: https://github.com/decidim/decidim
|
|
141
|
-
post_install_message:
|
|
142
140
|
rdoc_options: []
|
|
143
141
|
require_paths:
|
|
144
142
|
- lib
|
|
@@ -146,15 +144,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
146
144
|
requirements:
|
|
147
145
|
- - "~>"
|
|
148
146
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: 3.
|
|
147
|
+
version: 3.4.0
|
|
150
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
149
|
requirements:
|
|
152
150
|
- - ">="
|
|
153
151
|
- !ruby/object:Gem::Version
|
|
154
152
|
version: '0'
|
|
155
153
|
requirements: []
|
|
156
|
-
rubygems_version: 3.
|
|
157
|
-
signing_key:
|
|
154
|
+
rubygems_version: 3.6.9
|
|
158
155
|
specification_version: 4
|
|
159
156
|
summary: Citizen participation framework for Ruby on Rails.
|
|
160
157
|
test_files: []
|