decidim-generators 0.20.1 → 0.23.1

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.
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ if Rails.env.development?
4
+ require "rack-mini-profiler"
5
+
6
+ # initialization is skipped so trigger it
7
+ Rack::MiniProfilerRails.initialize!(Rails.application)
8
+ end
@@ -23,14 +23,20 @@ default: &default
23
23
  api_secret: <%%= ENV["OMNIAUTH_TWITTER_API_SECRET"] %>
24
24
  google_oauth2:
25
25
  enabled: false
26
+ icon_path: decidim/brands/google.svg
26
27
  client_id: <%%= ENV["OMNIAUTH_GOOGLE_CLIENT_ID"] %>
27
28
  client_secret: <%%= ENV["OMNIAUTH_GOOGLE_CLIENT_SECRET"] %>
28
- geocoder:
29
- here_api_key: <%%= ENV["GEOCODER_API_KEY"] %>
29
+ maps:
30
+ api_key: <%%= ENV["MAPS_API_KEY"] %>
30
31
  etherpad:
31
32
  server: <%%= ENV["ETHERPAD_SERVER"] %>
32
33
  api_key: <%%= ENV["ETHERPAD_API_KEY"] %>
33
34
  api_version: "1.2.1"
35
+ bulletin_board:
36
+ identification_private_key: |
37
+ <%= ENV["BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY"]&.indent(6) %>
38
+ server: <%= ENV["BULLETIN_BOARD_SERVER"] %>
39
+ api_key: <%= ENV["BULLETIN_BOARD_API_KEY"] %>
34
40
 
35
41
  development:
36
42
  <<: *default
@@ -46,10 +52,16 @@ test:
46
52
  omniauth:
47
53
  facebook:
48
54
  enabled: true
55
+ app_id: fake-facebook-app-id
56
+ app_secret: fake-facebook-app-secret
49
57
  twitter:
50
58
  enabled: true
59
+ api_key: fake-twitter-api-key
60
+ api_secret: fake-twitter-api-secret
51
61
  google_oauth2:
52
62
  enabled: true
63
+ client_id:
64
+ client_secret:
53
65
 
54
66
  # Do not keep production secrets in the repository,
55
67
  # instead read values from the environment.
@@ -3,16 +3,19 @@
3
3
  Decidim::Verifications.register_workflow(:dummy_authorization_handler) do |workflow|
4
4
  workflow.form = "DummyAuthorizationHandler"
5
5
  workflow.action_authorizer = "DummyAuthorizationHandler::DummyActionAuthorizer"
6
- workflow.expires_in = 1.hour
6
+ workflow.expires_in = 1.month
7
+ workflow.renewable = true
8
+ workflow.time_between_renewals = 5.minutes
7
9
 
8
10
  workflow.options do |options|
9
- options.attribute :postal_code, type: :string, default: "08001", required: false
11
+ options.attribute :allowed_postal_codes, type: :string, default: "08001", required: false
12
+ options.attribute :allowed_scope_id, type: :scope, required: false
10
13
  end
11
14
  end
12
15
 
13
16
  Decidim::Verifications.register_workflow(:another_dummy_authorization_handler) do |workflow|
14
17
  workflow.form = "AnotherDummyAuthorizationHandler"
15
- workflow.expires_in = 1.hour
18
+ workflow.expires_in = 1.month
16
19
 
17
20
  workflow.options do |options|
18
21
  options.attribute :passport_number, type: :string, required: false
@@ -7,7 +7,8 @@ ruby RUBY_VERSION
7
7
  gem "decidim", git: "https://github.com/decidim/decidim"
8
8
  gem "decidim-<%= component_name %>", path: "."
9
9
 
10
- gem "puma", "~> 3.12.2"
10
+ gem "puma", ">= 4.3"
11
+ gem "bootsnap", "~> 1.4"
11
12
  gem "uglifier", "~> 4.1"
12
13
 
13
14
  group :development, :test do
@@ -12,7 +12,7 @@ Space.
12
12
  Add this line to your application's Gemfile:
13
13
 
14
14
  ```ruby
15
- gem 'decidim-<%= component_name %>
15
+ gem "decidim-<%= component_name %>"
16
16
  ```
17
17
 
18
18
  And then execute:
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = ["<%= %x[git config user.email].chomp %>"]
11
11
  s.license = "AGPL-3.0"
12
12
  s.homepage = "https://github.com/decidim/decidim-module-<%= component_name %>"
13
- s.required_ruby_version = ">= 2.5"
13
+ s.required_ruby_version = ">= 2.6"
14
14
 
15
15
  s.name = "decidim-<%= component_name %>"
16
16
  s.summary = "A decidim <%= component_name %> module"
@@ -30,6 +30,10 @@ module Decidim
30
30
  default: false,
31
31
  desc: "Don't generate a Gemfile for the application"
32
32
 
33
+ class_option :profiling, type: :boolean,
34
+ default: false,
35
+ desc: "Add the necessary gems to profile the app"
36
+
33
37
  def install
34
38
  route "mount Decidim::Core::Engine => '/'"
35
39
  end
@@ -125,6 +129,27 @@ module Decidim
125
129
  end
126
130
  end
127
131
 
132
+ def profiling_gems
133
+ return unless options[:profiling]
134
+
135
+ append_file "Gemfile", <<~RUBY
136
+
137
+ group :development do
138
+ # Profiling gems
139
+ gem "bullet"
140
+ gem "flamegraph"
141
+ gem "memory_profiler"
142
+ gem "rack-mini-profiler", require: false
143
+ gem "stackprof"
144
+ end
145
+ RUBY
146
+
147
+ copy_file "bullet_initializer.rb", "config/initializers/bullet.rb"
148
+ copy_file "rack_profiler_initializer.rb", "config/initializers/rack_profiler.rb"
149
+
150
+ run "bundle install"
151
+ end
152
+
128
153
  private
129
154
 
130
155
  def recreate_db
@@ -4,7 +4,7 @@
4
4
  module Decidim
5
5
  module Generators
6
6
  def self.version
7
- "0.20.1"
7
+ "0.23.1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-03-27 00:00:00.000000000 Z
13
+ date: 2020-11-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.20.1
21
+ version: 0.23.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.20.1
28
+ version: 0.23.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: bundler
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -60,6 +60,10 @@ files:
60
60
  - lib/decidim/generators/app_templates/LICENSE-AGPLv3.txt
61
61
  - lib/decidim/generators/app_templates/README.md.erb
62
62
  - lib/decidim/generators/app_templates/another_dummy_authorization_handler.rb
63
+ - lib/decidim/generators/app_templates/budgets_initializer.rb
64
+ - lib/decidim/generators/app_templates/budgets_workflow_random.en.yml
65
+ - lib/decidim/generators/app_templates/budgets_workflow_random.rb
66
+ - lib/decidim/generators/app_templates/bullet_initializer.rb
63
67
  - lib/decidim/generators/app_templates/cable.yml.erb
64
68
  - lib/decidim/generators/app_templates/carrierwave.rb
65
69
  - lib/decidim/generators/app_templates/database.yml.erb
@@ -69,6 +73,7 @@ files:
69
73
  - lib/decidim/generators/app_templates/docker-compose.yml.erb
70
74
  - lib/decidim/generators/app_templates/dummy_authorization_handler.rb
71
75
  - lib/decidim/generators/app_templates/initializer.rb
76
+ - lib/decidim/generators/app_templates/rack_profiler_initializer.rb
72
77
  - lib/decidim/generators/app_templates/secrets.yml.erb
73
78
  - lib/decidim/generators/app_templates/social_share_button.rb
74
79
  - lib/decidim/generators/app_templates/verifications_initializer.rb
@@ -112,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
117
  requirements:
113
118
  - - ">="
114
119
  - !ruby/object:Gem::Version
115
- version: '2.5'
120
+ version: '2.6'
116
121
  required_rubygems_version: !ruby/object:Gem::Requirement
117
122
  requirements:
118
123
  - - ">="
119
124
  - !ruby/object:Gem::Version
120
125
  version: '0'
121
126
  requirements: []
122
- rubygems_version: 3.1.2
127
+ rubygems_version: 3.0.3
123
128
  signing_key:
124
129
  specification_version: 4
125
130
  summary: Citizen participation framework for Ruby on Rails.