decidim 0.8.4 → 0.9.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.

Potentially problematic release.


This version of decidim might be problematic. Click here for more details.

@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails/generators"
4
- require "generators/decidim/app_generator"
5
-
6
- module Decidim
7
- module Generators
8
- # Generates a development Rails app that works with Docker.
9
- class DockerGenerator < Rails::Generators::Base
10
- desc "Generate a docker app for development purposes"
11
-
12
- class_option :docker_app_path, type: :string,
13
- desc: "The path to generate the docker app"
14
-
15
- def source_paths
16
- [
17
- File.expand_path("templates", __dir__)
18
- ]
19
- end
20
-
21
- def cleanup
22
- remove_directory_if_exists
23
- end
24
-
25
- def create_rails_app
26
- Decidim::Generators::AppGenerator.start(
27
- [docker_app_path, "--path", "..", "--demo"]
28
- )
29
- end
30
-
31
- def build_docker
32
- inside(docker_app_path) do
33
- gsub_file "Gemfile",
34
- /gem "decidim([^"]*)".*/,
35
- 'gem "decidim\1", path: "/decidim"'
36
-
37
- run "docker-compose build"
38
- run "docker-compose run --rm app rails db:drop db:create db:migrate db:seed"
39
- end
40
- end
41
-
42
- def after_install
43
- say "Docker development app generated! To start the app just run:"
44
- say "cd docker_development_app && docker-compose up"
45
- say "Open the app at http://localhost:3000"
46
- end
47
-
48
- private
49
-
50
- def remove_directory_if_exists
51
- remove_dir(docker_app_path) if File.directory?(docker_app_path)
52
- end
53
-
54
- def docker_app_path
55
- options[:docker_app_path]
56
- end
57
- end
58
- end
59
- end