decidim-dev 0.0.7 → 0.0.8
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/README.md +2 -2
- data/config/locales/fr.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/lib/decidim/dev.rb +7 -5
- data/lib/decidim/dev/common_rake.rb +1 -23
- data/lib/decidim/dev/test/base_spec_helper.rb +6 -5
- data/lib/generators/decidim/dummy_generator.rb +13 -16
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6bd8bc5b617ae9625f4de79ae8ac29f4c87bacd
|
4
|
+
data.tar.gz: cf4f9393016d16529066018d68d76daf9c8eb28e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca17dd4a724144a1b153ad0882d430942a527f2f1f9bd319ef0da7242535cf88bc29e7be078986aaef746f2cfa1bab0dbccba9fd2a2840e2ec65920e1a00aed4
|
7
|
+
data.tar.gz: 58b86ef5fabf99ca46c537cd6d9b76855e21a0aa22f3eb5067c58d2881eb0981de2a6ea0be2da7b9034684d0ad2a2f8ba23730bc12695d26b5a5dfe6ae45d01b
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ $ bundle
|
|
18
18
|
```
|
19
19
|
|
20
20
|
## Contributing
|
21
|
-
See [Decidim](https://github.com/
|
21
|
+
See [Decidim](https://github.com/decidim/decidim).
|
22
22
|
|
23
23
|
## License
|
24
|
-
See [Decidim](https://github.com/
|
24
|
+
See [Decidim](https://github.com/decidim/decidim).
|
@@ -0,0 +1 @@
|
|
1
|
+
fr:
|
@@ -0,0 +1 @@
|
|
1
|
+
nl:
|
data/lib/decidim/dev.rb
CHANGED
@@ -11,11 +11,13 @@ module Decidim
|
|
11
11
|
#
|
12
12
|
# Returns a String with the path for a particular asset.
|
13
13
|
def self.asset(name)
|
14
|
-
File.
|
15
|
-
File.
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
File.expand_path(
|
15
|
+
File.join(
|
16
|
+
File.dirname(__FILE__),
|
17
|
+
"dev",
|
18
|
+
"assets",
|
19
|
+
name
|
20
|
+
)
|
19
21
|
)
|
20
22
|
end
|
21
23
|
end
|
@@ -1,28 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require "bundler/gem_tasks"
|
3
3
|
require "rspec/core/rake_task"
|
4
|
-
require_relative "../../generators/decidim/dummy_generator"
|
5
|
-
|
6
|
-
engine_path = Dir.pwd
|
7
|
-
engine_name = engine_path.split("/").last
|
8
|
-
dummy_app_path = File.expand_path(File.join(engine_path, "spec", "#{engine_name}_dummy_app"))
|
9
|
-
|
10
|
-
desc "Generates a dummy app for testing"
|
11
|
-
task :generate_test_app do
|
12
|
-
Decidim::Generators::DummyGenerator.start(
|
13
|
-
[
|
14
|
-
"--engine_path=#{engine_path}",
|
15
|
-
"--migrate=true",
|
16
|
-
"--quiet"
|
17
|
-
]
|
18
|
-
)
|
19
|
-
|
20
|
-
require File.join(dummy_app_path, "config", "application")
|
21
|
-
Rails.application.load_tasks
|
22
|
-
Rake.application["assets:precompile"].invoke
|
23
|
-
|
24
|
-
FileUtils.cd(engine_path)
|
25
|
-
end
|
26
4
|
|
27
5
|
RSpec::Core::RakeTask.new(:spec)
|
28
|
-
task default: [:
|
6
|
+
task default: [:spec]
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
ENV["RAILS_ENV"] ||= "test"
|
3
3
|
|
4
|
+
root_path = File.join(Dir.pwd, "..")
|
4
5
|
engine_name = ENV["ENGINE_NAME"]
|
5
6
|
engine_spec_dir = File.join(Dir.pwd, "spec")
|
6
|
-
dummy_app_path = File.expand_path(File.join(
|
7
|
+
dummy_app_path = File.expand_path(File.join(root_path, "spec", "decidim_dummy_app"))
|
7
8
|
|
8
|
-
if ENV["
|
9
|
+
if ENV["SIMPLECOV"]
|
9
10
|
require "simplecov"
|
10
|
-
SimpleCov.root(
|
11
|
+
SimpleCov.root(root_path)
|
11
12
|
|
12
13
|
SimpleCov.start do
|
13
14
|
filters.clear
|
@@ -17,7 +18,7 @@ if ENV["CI"]
|
|
17
18
|
add_filter "/vendor/"
|
18
19
|
|
19
20
|
add_filter do |src|
|
20
|
-
!(src.filename =~ /^#{
|
21
|
+
!(src.filename =~ /^#{root_path}/)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -34,7 +35,7 @@ require "#{File.dirname(__FILE__)}/rspec_support/feature.rb"
|
|
34
35
|
begin
|
35
36
|
require "#{dummy_app_path}/config/environment"
|
36
37
|
rescue LoadError
|
37
|
-
puts "Could not load dummy application. Please ensure you have run `bundle exec rake generate_test_app`"
|
38
|
+
puts "Could not load dummy application. Please ensure you have run `bundle exec rake decidim:generate_test_app`"
|
38
39
|
puts "Tried to load it from #{dummy_app_path}"
|
39
40
|
exit(-1)
|
40
41
|
end
|
@@ -18,8 +18,8 @@ module Decidim
|
|
18
18
|
class DummyGenerator < Rails::Generators::Base
|
19
19
|
desc "Generate dummy app for testing purposes"
|
20
20
|
|
21
|
-
class_option :
|
22
|
-
|
21
|
+
class_option :dummy_app_path, type: :string,
|
22
|
+
desc: "The path where the dummy app will be installed"
|
23
23
|
|
24
24
|
def source_paths
|
25
25
|
[
|
@@ -28,12 +28,13 @@ module Decidim
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def cleanup
|
31
|
-
remove_directory_if_exists(
|
31
|
+
remove_directory_if_exists(dummy_app_path)
|
32
32
|
end
|
33
33
|
|
34
34
|
def create_dummy_app
|
35
35
|
Decidim::Generators::AppGenerator.start [
|
36
|
-
|
36
|
+
dummy_app_path,
|
37
|
+
"--app_const_base=DummyApplication",
|
37
38
|
"--skip_gemfile",
|
38
39
|
"--skip-bundle",
|
39
40
|
"--skip-git",
|
@@ -44,29 +45,29 @@ module Decidim
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def set_locales
|
47
|
-
inject_into_file "#{
|
48
|
+
inject_into_file "#{dummy_app_path}/config/application.rb", after: "class Application < Rails::Application" do
|
48
49
|
"\n config.i18n.available_locales = %w(en ca es)\n config.i18n.default_locale = :en"
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
53
|
def decidim_dev
|
53
|
-
template "decidim_dev.rb", "#{
|
54
|
+
template "decidim_dev.rb", "#{dummy_app_path}/config/initializers/decidim_dev.rb"
|
54
55
|
|
55
56
|
# TODO: Remove these after PhantomJS updates WebKit version (see YML and
|
56
57
|
# initializer comments)
|
57
|
-
template "autoprefixer.yml", "#{
|
58
|
-
template "autoprefixer_initializer.rb", "#{
|
58
|
+
template "autoprefixer.yml", "#{dummy_app_path}/config/autoprefixer.yml"
|
59
|
+
template "autoprefixer_initializer.rb", "#{dummy_app_path}/config/initializers/autoprefixer.rb"
|
59
60
|
end
|
60
61
|
|
61
62
|
def test_env
|
62
|
-
gsub_file "#{
|
63
|
+
gsub_file "#{dummy_app_path}/config/environments/test.rb",
|
63
64
|
/allow_forgery_protection = (.*)/, 'allow_forgery_protection = true'
|
64
65
|
end
|
65
66
|
|
66
67
|
private
|
67
68
|
|
68
|
-
def
|
69
|
-
|
69
|
+
def dummy_app_path
|
70
|
+
options[:dummy_app_path]
|
70
71
|
end
|
71
72
|
|
72
73
|
def remove_directory_if_exists(path)
|
@@ -74,11 +75,7 @@ module Decidim
|
|
74
75
|
end
|
75
76
|
|
76
77
|
def dir_name
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
def engine_path
|
81
|
-
options[:engine_path]
|
78
|
+
dummy_app_path.split("/").last
|
82
79
|
end
|
83
80
|
end
|
84
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-04-
|
13
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.0.
|
21
|
+
version: 0.0.8
|
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.0.
|
28
|
+
version: 0.0.8
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: factory_girl_rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -338,6 +338,8 @@ files:
|
|
338
338
|
- config/locales/es.yml
|
339
339
|
- config/locales/eu.yml
|
340
340
|
- config/locales/fi.yml
|
341
|
+
- config/locales/fr.yml
|
342
|
+
- config/locales/nl.yml
|
341
343
|
- lib/decidim/dev.rb
|
342
344
|
- lib/decidim/dev/assets/Exampledocument.docx
|
343
345
|
- lib/decidim/dev/assets/Exampledocument.odt
|
@@ -378,7 +380,7 @@ files:
|
|
378
380
|
- lib/generators/decidim/templates/autoprefixer.yml
|
379
381
|
- lib/generators/decidim/templates/autoprefixer_initializer.rb
|
380
382
|
- lib/generators/decidim/templates/decidim_dev.rb
|
381
|
-
homepage: https://github.com/
|
383
|
+
homepage: https://github.com/decidim/decidim
|
382
384
|
licenses:
|
383
385
|
- AGPLv3
|
384
386
|
metadata: {}
|