decidim-generators 0.16.1 → 0.19.0
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 +2 -2
- data/Gemfile.lock +317 -298
- data/exe/decidim +6 -4
- data/lib/decidim/generators/app_generator.rb +16 -0
- data/lib/decidim/generators/app_templates/initializer.rb +47 -0
- data/lib/decidim/generators/app_templates/social_share_button.rb +1 -1
- data/lib/decidim/generators/component_generator.rb +3 -2
- data/lib/decidim/generators/component_templates/Gemfile.erb +2 -2
- data/lib/decidim/generators/component_templates/circleci/config.yml +47 -0
- data/lib/decidim/generators/component_templates/decidim-component.gemspec.erb +1 -1
- data/lib/decidim/generators/component_templates/gitignore +17 -0
- data/lib/decidim/generators/version.rb +1 -1
- metadata +8 -7
data/exe/decidim
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
if File.exist?(File.expand_path("../../.git", __dir__))
|
5
|
-
ENV["RUBYOPT"] = ENV["RUBYOPT"].sub("-rsimplecov ", "")
|
6
|
-
ENV["RUBYLIB"] = ENV["RUBYLIB"].sub("#{File.expand_path("..", __dir__)}/lib:", "")
|
5
|
+
ENV["RUBYOPT"] = ENV["RUBYOPT"].to_s.sub("-rsimplecov ", "")
|
6
|
+
ENV["RUBYLIB"] = ENV["RUBYLIB"].to_s.sub("#{File.expand_path("..", __dir__)}/lib:", "")
|
7
7
|
|
8
8
|
gem "decidim-core"
|
9
9
|
end
|
@@ -16,9 +16,11 @@ when "--component"
|
|
16
16
|
|
17
17
|
Decidim::Generators::ComponentGenerator.start
|
18
18
|
when "--version"
|
19
|
-
|
19
|
+
require "decidim/core/version"
|
20
|
+
puts Decidim::Core.version
|
20
21
|
when "--help"
|
21
|
-
|
22
|
+
require "decidim/core/version"
|
23
|
+
puts "Decidim #{Decidim::Core.version}
|
22
24
|
Syntax: decidim [options] [App or Module name]
|
23
25
|
https://decidim.org
|
24
26
|
|
@@ -172,6 +172,22 @@ module Decidim
|
|
172
172
|
"config.sms_gateway_service = 'Decidim::Verifications::Sms::ExampleGateway'"
|
173
173
|
end
|
174
174
|
|
175
|
+
def timestamp_service
|
176
|
+
return unless options[:demo]
|
177
|
+
|
178
|
+
gsub_file "config/initializers/decidim.rb",
|
179
|
+
/# config.timestamp_service = \"MyTimestampService\"/,
|
180
|
+
"config.timestamp_service = \"Decidim::Initiatives::DummyTimestamp\""
|
181
|
+
end
|
182
|
+
|
183
|
+
def pdf_signature_service
|
184
|
+
return unless options[:demo]
|
185
|
+
|
186
|
+
gsub_file "config/initializers/decidim.rb",
|
187
|
+
/# config.pdf_signature_service = \"MyPDFSignatureService\"/,
|
188
|
+
"config.pdf_signature_service = \"Decidim::Initiatives::PdfSignatureExample\""
|
189
|
+
end
|
190
|
+
|
175
191
|
def install
|
176
192
|
Decidim::Generators::InstallGenerator.start(
|
177
193
|
[
|
@@ -65,6 +65,53 @@ Decidim.configure do |config|
|
|
65
65
|
#
|
66
66
|
# config.sms_gateway_service = "MySMSGatewayService"
|
67
67
|
|
68
|
+
# Timestamp service configuration
|
69
|
+
#
|
70
|
+
# Provide a class to generate a timestamp for a document. The instances of
|
71
|
+
# this class are initialized with a hash containing the :document key with
|
72
|
+
# the document to be timestamped as value. The istances respond to a
|
73
|
+
# timestamp public method with the timestamp
|
74
|
+
#
|
75
|
+
# An example class would be something like:
|
76
|
+
#
|
77
|
+
# class MyTimestampService
|
78
|
+
# attr_accessor :document
|
79
|
+
#
|
80
|
+
# def initialize(args = {})
|
81
|
+
# @document = args.fetch(:document)
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# def timestamp
|
85
|
+
# # Code to generate timestamp
|
86
|
+
# "My timestamp"
|
87
|
+
# end
|
88
|
+
# end
|
89
|
+
#
|
90
|
+
# config.timestamp_service = "MyTimestampService"
|
91
|
+
|
92
|
+
# PDF signature service configuration
|
93
|
+
#
|
94
|
+
# Provide a class to process a pdf and return the document including a
|
95
|
+
# digital signature. The instances of this class are initialized with a hash
|
96
|
+
# containing the :pdf key with the pdf file content as value. The instances
|
97
|
+
# respond to a signed_pdf method containing the pdf with the signature
|
98
|
+
#
|
99
|
+
# An example class would be something like:
|
100
|
+
#
|
101
|
+
# class MyPDFSignatureService
|
102
|
+
# attr_accessor :pdf
|
103
|
+
#
|
104
|
+
# def initialize(args = {})
|
105
|
+
# @pdf = args.fetch(:pdf)
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# def signed_pdf
|
109
|
+
# # Code to return the pdf signed
|
110
|
+
# end
|
111
|
+
# end
|
112
|
+
#
|
113
|
+
# config.pdf_signature_service = "MyPDFSignatureService"
|
114
|
+
|
68
115
|
# Etherpad configuration
|
69
116
|
#
|
70
117
|
# Only needed if you want to have Etherpad integration with Decidim. See
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require "bundler"
|
4
5
|
require "thor"
|
5
6
|
require "active_support/inflector"
|
6
7
|
require "decidim/core/version"
|
@@ -30,8 +31,8 @@ module Decidim
|
|
30
31
|
template "Rakefile", "#{component_folder}/Rakefile"
|
31
32
|
template "LICENSE-AGPLv3.txt", "#{component_folder}/LICENSE-AGPLv3.txt"
|
32
33
|
template "README.md.erb", "#{component_folder}/README.md"
|
33
|
-
template "
|
34
|
-
template "
|
34
|
+
template "gitignore", "#{component_folder}/.gitignore"
|
35
|
+
template "circleci/config.yml", "#{component_folder}/.circleci/config.yml"
|
35
36
|
|
36
37
|
app_folder = "#{component_folder}/app"
|
37
38
|
template "app/assets/config/component_manifest.js", "#{app_folder}/assets/config/decidim_#{component_name}_manifest.js"
|
@@ -7,11 +7,11 @@ 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.
|
10
|
+
gem "puma", "~> 3.12"
|
11
11
|
gem "uglifier", "~> 4.1"
|
12
12
|
|
13
13
|
group :development, :test do
|
14
|
-
gem "byebug", "~>
|
14
|
+
gem "byebug", "~> 11.0", platform: :mri
|
15
15
|
|
16
16
|
gem "decidim-dev", git: "https://github.com/decidim/decidim"
|
17
17
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
version: 2
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
docker:
|
8
|
+
- image: decidim/decidim@sha256:348fb1faa49cfe76ba7cbeafc67ca09002cf95f0ffa7a76eefa9d5b3774e0ee9
|
9
|
+
environment:
|
10
|
+
DATABASE_USERNAME: postgres
|
11
|
+
|
12
|
+
- image: postgres
|
13
|
+
environment:
|
14
|
+
POSTGRES_USER: postgres
|
15
|
+
|
16
|
+
working_directory: /app
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- checkout
|
20
|
+
|
21
|
+
- restore_cache:
|
22
|
+
keys:
|
23
|
+
- bundler-dependencies-{{ checksum "Gemfile.lock" }}
|
24
|
+
|
25
|
+
- run:
|
26
|
+
name: Install dependencies
|
27
|
+
command: bundle install
|
28
|
+
|
29
|
+
- save_cache:
|
30
|
+
key: bundler-dependencies-{{ checksum "Gemfile.lock" }}
|
31
|
+
paths:
|
32
|
+
- /usr/local/bundle
|
33
|
+
|
34
|
+
- run:
|
35
|
+
name: Wait for db
|
36
|
+
command: dockerize -wait tcp://localhost:5432 -timeout 1m
|
37
|
+
|
38
|
+
- run:
|
39
|
+
name: Generate test app
|
40
|
+
command: bundle exec rake decidim:generate_external_test_app
|
41
|
+
|
42
|
+
- run:
|
43
|
+
name: Run RSpec tests
|
44
|
+
command: bundle exec rspec
|
45
|
+
|
46
|
+
- store_artifacts:
|
47
|
+
path: /app/spec/decidim_dummy_app/tmp/screenshots
|
@@ -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.
|
13
|
+
s.required_ruby_version = ">= 2.5"
|
14
14
|
|
15
15
|
s.name = "decidim-<%= component_name %>"
|
16
16
|
s.summary = "A decidim <%= component_name %> module"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
# rspec failure tracking
|
11
|
+
.rspec-failures
|
12
|
+
|
13
|
+
# default test application
|
14
|
+
spec/decidim_dummy_app
|
15
|
+
|
16
|
+
# default development application
|
17
|
+
development_app
|
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.
|
4
|
+
version: 0.19.0
|
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: 2019-
|
13
|
+
date: 2019-10-21 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.
|
21
|
+
version: 0.19.0
|
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.
|
28
|
+
version: 0.19.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: bundler
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,9 +84,11 @@ files:
|
|
84
84
|
- lib/decidim/generators/component_templates/app/helpers/decidim/component/application_helper.rb.erb
|
85
85
|
- lib/decidim/generators/component_templates/app/models/decidim/component/application_record.rb.erb
|
86
86
|
- lib/decidim/generators/component_templates/bin/rails.erb
|
87
|
+
- lib/decidim/generators/component_templates/circleci/config.yml
|
87
88
|
- lib/decidim/generators/component_templates/config/i18n-tasks.yml.erb
|
88
89
|
- lib/decidim/generators/component_templates/config/locales/en.yml.erb
|
89
90
|
- lib/decidim/generators/component_templates/decidim-component.gemspec.erb
|
91
|
+
- lib/decidim/generators/component_templates/gitignore
|
90
92
|
- lib/decidim/generators/component_templates/lib/decidim/component.rb.erb
|
91
93
|
- lib/decidim/generators/component_templates/lib/decidim/component/admin.rb.erb
|
92
94
|
- lib/decidim/generators/component_templates/lib/decidim/component/admin_engine.rb.erb
|
@@ -110,15 +112,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
112
|
requirements:
|
111
113
|
- - ">="
|
112
114
|
- !ruby/object:Gem::Version
|
113
|
-
version: '2.
|
115
|
+
version: '2.5'
|
114
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
117
|
requirements:
|
116
118
|
- - ">="
|
117
119
|
- !ruby/object:Gem::Version
|
118
120
|
version: '0'
|
119
121
|
requirements: []
|
120
|
-
|
121
|
-
rubygems_version: 2.7.6
|
122
|
+
rubygems_version: 3.0.3
|
122
123
|
signing_key:
|
123
124
|
specification_version: 4
|
124
125
|
summary: Citizen participation framework for Ruby on Rails.
|