decidim-dev 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/eu.yml +1 -1
- data/lib/decidim/dev/test/rspec_support/capybara.rb +1 -4
- data/lib/decidim/dev/test/rspec_support/feature.rb +1 -0
- data/lib/decidim/dev/test/rspec_support/helpers.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/phantomjs-shim.js +215 -0
- data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +1 -1
- data/lib/generators/decidim/dummy_generator.rb +5 -0
- metadata +8 -9
- data/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/bind-polyfill.js +0 -18
- data/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/object-assign-polyfill.js +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e9e397d8e0eedd30debf38384e87397a623e1ea
|
4
|
+
data.tar.gz: 241f192bb94fbab7eea74a6b1bd457a4bb6a9cd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73ce05cc30908832ad3ec3f9e6cc549f72dd6cddffb0be955e6ff3d5812c801b30fd8fd7c034e90aa319713944d2ef9a73a0387aeea3e938892aa25968450339
|
7
|
+
data.tar.gz: b08e8b525569e21b9e7be577e44fb563e6125c91c23b1079356af630f458c211a8bc05969e7de3d1408ce02b3b82a77f3441d5a0bd62b7d97ce8353655d6a33c
|
data/config/locales/eu.yml
CHANGED
@@ -27,10 +27,7 @@ capybara_options = {
|
|
27
27
|
File.join(File.dirname(__FILE__), "phantomjs_polyfills", "promise.js")
|
28
28
|
),
|
29
29
|
File.expand_path(
|
30
|
-
File.join(File.dirname(__FILE__), "phantomjs_polyfills", "
|
31
|
-
),
|
32
|
-
File.expand_path(
|
33
|
-
File.join(File.dirname(__FILE__), "phantomjs_polyfills", "object-assign-polyfill.js")
|
30
|
+
File.join(File.dirname(__FILE__), "phantomjs_polyfills", "phantomjs-shim.js")
|
34
31
|
)
|
35
32
|
],
|
36
33
|
js_errors: true,
|
@@ -0,0 +1,215 @@
|
|
1
|
+
/**
|
2
|
+
* Adapted from https://github.com/Raynos/function-bind
|
3
|
+
* Copyright 2013 Raynos.
|
4
|
+
* MIT license, see license.md for detail.
|
5
|
+
*/
|
6
|
+
|
7
|
+
(function() {
|
8
|
+
if (Function.prototype.bind) {
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
|
12
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
13
|
+
var slice = Array.prototype.slice;
|
14
|
+
var toStr = Object.prototype.toString;
|
15
|
+
var funcType = '[object Function]';
|
16
|
+
|
17
|
+
Function.prototype.bind = function bind(that) {
|
18
|
+
var target = this;
|
19
|
+
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
|
20
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
21
|
+
}
|
22
|
+
var args = slice.call(arguments, 1);
|
23
|
+
|
24
|
+
var binder = function () {
|
25
|
+
if (this instanceof bound) {
|
26
|
+
var result = target.apply(this, args.concat(slice.call(arguments)));
|
27
|
+
if (Object(result) === result) {
|
28
|
+
return result;
|
29
|
+
}
|
30
|
+
return this;
|
31
|
+
} else {
|
32
|
+
return target.apply(that, args.concat(slice.call(arguments)));
|
33
|
+
}
|
34
|
+
};
|
35
|
+
|
36
|
+
var boundLength = Math.max(0, target.length - args.length);
|
37
|
+
var boundArgs = [];
|
38
|
+
for (var i = 0; i < boundLength; i++) {
|
39
|
+
boundArgs.push('$' + i);
|
40
|
+
}
|
41
|
+
|
42
|
+
var bound = Function('binder', 'return function (' + boundArgs.join(',') +
|
43
|
+
'){ return binder.apply(this,arguments); }')(binder);
|
44
|
+
|
45
|
+
if (target.prototype) {
|
46
|
+
var Empty = function Empty() {};
|
47
|
+
Empty.prototype = target.prototype;
|
48
|
+
bound.prototype = new Empty();
|
49
|
+
Empty.prototype = null;
|
50
|
+
}
|
51
|
+
|
52
|
+
return bound;
|
53
|
+
};
|
54
|
+
|
55
|
+
}());
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Polyfill for requestAnimationFrame
|
59
|
+
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
60
|
+
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
61
|
+
* requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
|
62
|
+
* MIT license
|
63
|
+
*/
|
64
|
+
(function() {
|
65
|
+
var lastTime = 0;
|
66
|
+
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
67
|
+
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
68
|
+
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
69
|
+
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame']
|
70
|
+
|| window[vendors[x] + 'CancelRequestAnimationFrame'];
|
71
|
+
}
|
72
|
+
if(!window.requestAnimationFrame)
|
73
|
+
window.requestAnimationFrame = function(callback, element) {
|
74
|
+
var currTime = new Date().getTime();
|
75
|
+
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
76
|
+
var id = window.setTimeout(function() {
|
77
|
+
callback(currTime + timeToCall);
|
78
|
+
},
|
79
|
+
timeToCall);
|
80
|
+
lastTime = currTime + timeToCall;
|
81
|
+
return id;
|
82
|
+
};
|
83
|
+
if(!window.cancelAnimationFrame)
|
84
|
+
window.cancelAnimationFrame = function(id) {
|
85
|
+
clearTimeout(id);
|
86
|
+
};
|
87
|
+
}());
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Polyfill for CustomEvent
|
91
|
+
* Until PhantomJS v2.0 is out (see https://github.com/ariya/phantomjs/issues/11289)
|
92
|
+
*/
|
93
|
+
(function() {
|
94
|
+
function CustomEvent(event, params) {
|
95
|
+
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
96
|
+
var evt = document.createEvent('CustomEvent');
|
97
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
98
|
+
return evt;
|
99
|
+
};
|
100
|
+
|
101
|
+
CustomEvent.prototype = window.Event.prototype;
|
102
|
+
|
103
|
+
window.CustomEvent = CustomEvent;
|
104
|
+
})();
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Polyfill for String.startsWith
|
108
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
|
109
|
+
*/
|
110
|
+
(function() {
|
111
|
+
if (!String.prototype.startsWith) {
|
112
|
+
String.prototype.startsWith = function(searchString, position) {
|
113
|
+
position = position || 0;
|
114
|
+
return this.indexOf(searchString, position) === position;
|
115
|
+
};
|
116
|
+
}
|
117
|
+
})();
|
118
|
+
|
119
|
+
/**
|
120
|
+
* Polyfill for String.repeat
|
121
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
|
122
|
+
*/
|
123
|
+
(function() {
|
124
|
+
if (!String.prototype.repeat) {
|
125
|
+
String.prototype.repeat = function(count) {
|
126
|
+
'use strict';
|
127
|
+
if (this == null) {
|
128
|
+
throw new TypeError('can\'t convert ' + this + ' to object');
|
129
|
+
}
|
130
|
+
var str = '' + this;
|
131
|
+
count = +count;
|
132
|
+
if (count != count) {
|
133
|
+
count = 0;
|
134
|
+
}
|
135
|
+
if (count < 0) {
|
136
|
+
throw new RangeError('repeat count must be non-negative');
|
137
|
+
}
|
138
|
+
if (count == Infinity) {
|
139
|
+
throw new RangeError('repeat count must be less than infinity');
|
140
|
+
}
|
141
|
+
count = Math.floor(count);
|
142
|
+
if (str.length == 0 || count == 0) {
|
143
|
+
return '';
|
144
|
+
}
|
145
|
+
// Ensuring count is a 31-bit integer allows us to heavily optimize the
|
146
|
+
// main part. But anyway, most current (August 2014) browsers can't handle
|
147
|
+
// strings 1 << 28 chars or longer, so:
|
148
|
+
if (str.length * count >= 1 << 28) {
|
149
|
+
throw new RangeError('repeat count must not overflow maximum string size');
|
150
|
+
}
|
151
|
+
var rpt = '';
|
152
|
+
for (;;) {
|
153
|
+
if ((count & 1) == 1) {
|
154
|
+
rpt += str;
|
155
|
+
}
|
156
|
+
count >>>= 1;
|
157
|
+
if (count == 0) {
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
str += str;
|
161
|
+
}
|
162
|
+
// Could we try:
|
163
|
+
// return Array(count + 1).join(this);
|
164
|
+
return rpt;
|
165
|
+
}
|
166
|
+
}})();
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Polyfill for String.includes
|
170
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
|
171
|
+
*/
|
172
|
+
(function() {
|
173
|
+
if (!String.prototype.includes) {
|
174
|
+
String.prototype.includes = function(search, start) {
|
175
|
+
'use strict';
|
176
|
+
if (typeof start !== 'number') {
|
177
|
+
start = 0;
|
178
|
+
}
|
179
|
+
|
180
|
+
if (start + search.length > this.length) {
|
181
|
+
return false;
|
182
|
+
} else {
|
183
|
+
return this.indexOf(search, start) !== -1;
|
184
|
+
}
|
185
|
+
};
|
186
|
+
}
|
187
|
+
})();
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Polyfill for Object.assign
|
191
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
192
|
+
*/
|
193
|
+
if (typeof Object.assign != 'function') {
|
194
|
+
(function () {
|
195
|
+
Object.assign = function (target) {
|
196
|
+
'use strict';
|
197
|
+
if (target === undefined || target === null) {
|
198
|
+
throw new TypeError('Cannot convert undefined or null to object');
|
199
|
+
}
|
200
|
+
|
201
|
+
var output = Object(target);
|
202
|
+
for (var index = 1; index < arguments.length; index++) {
|
203
|
+
var source = arguments[index];
|
204
|
+
if (source !== undefined && source !== null) {
|
205
|
+
for (var nextKey in source) {
|
206
|
+
if (source.hasOwnProperty(nextKey)) {
|
207
|
+
output[nextKey] = source[nextKey];
|
208
|
+
}
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
return output;
|
213
|
+
};
|
214
|
+
})();
|
215
|
+
}
|
@@ -23,7 +23,7 @@ module TranslationHelpers
|
|
23
23
|
#
|
24
24
|
# field - the name of the field that should be filled, without the
|
25
25
|
# locale-related part (e.g. `:participatory_process_title`)
|
26
|
-
#
|
26
|
+
# tab_selector - a String representing the ID of the HTML element that holds
|
27
27
|
# the tabs for this input. It ususally is `"#<attribute_name>-tabs" (e.g.
|
28
28
|
# "#title-tabs")
|
29
29
|
# localized_values - a Hash where the keys are the locales IDs and the values
|
@@ -58,6 +58,11 @@ module Decidim
|
|
58
58
|
template "autoprefixer_initializer.rb", "#{dummy_path}/config/initializers/autoprefixer.rb"
|
59
59
|
end
|
60
60
|
|
61
|
+
def test_env
|
62
|
+
gsub_file "#{dummy_path}/config/environments/test.rb",
|
63
|
+
/allow_forgery_protection = (.*)/, 'allow_forgery_protection = true'
|
64
|
+
end
|
65
|
+
|
61
66
|
private
|
62
67
|
|
63
68
|
def dummy_path
|
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.7
|
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-
|
13
|
+
date: 2017-04-07 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.7
|
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.7
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: factory_girl_rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,14 +200,14 @@ dependencies:
|
|
200
200
|
requirements:
|
201
201
|
- - "~>"
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version: 1.
|
203
|
+
version: 1.14.0
|
204
204
|
type: :runtime
|
205
205
|
prerelease: false
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
208
|
- - "~>"
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: 1.
|
210
|
+
version: 1.14.0
|
211
211
|
- !ruby/object:Gem::Dependency
|
212
212
|
name: rails-controller-testing
|
213
213
|
requirement: !ruby/object:Gem::Requirement
|
@@ -367,8 +367,7 @@ files:
|
|
367
367
|
- lib/decidim/dev/test/rspec_support/helpers.rb
|
368
368
|
- lib/decidim/dev/test/rspec_support/html_matchers.rb
|
369
369
|
- lib/decidim/dev/test/rspec_support/i18n.rb
|
370
|
-
- lib/decidim/dev/test/rspec_support/phantomjs_polyfills/
|
371
|
-
- lib/decidim/dev/test/rspec_support/phantomjs_polyfills/object-assign-polyfill.js
|
370
|
+
- lib/decidim/dev/test/rspec_support/phantomjs_polyfills/phantomjs-shim.js
|
372
371
|
- lib/decidim/dev/test/rspec_support/phantomjs_polyfills/promise.js
|
373
372
|
- lib/decidim/dev/test/rspec_support/translation_helpers.rb
|
374
373
|
- lib/decidim/dev/test/rspec_support/warden.rb
|
@@ -399,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
399
398
|
version: '0'
|
400
399
|
requirements: []
|
401
400
|
rubyforge_project:
|
402
|
-
rubygems_version: 2.6.
|
401
|
+
rubygems_version: 2.6.11
|
403
402
|
signing_key:
|
404
403
|
specification_version: 4
|
405
404
|
summary: Decidim Dev tools
|
@@ -1,18 +0,0 @@
|
|
1
|
-
if (typeof Function.prototype.bind != 'function') {
|
2
|
-
Function.prototype.bind = function bind(obj) {
|
3
|
-
var args = Array.prototype.slice.call(arguments, 1),
|
4
|
-
self = this,
|
5
|
-
nop = function() {
|
6
|
-
},
|
7
|
-
bound = function() {
|
8
|
-
return self.apply(
|
9
|
-
this instanceof nop ? this : (obj || {}), args.concat(
|
10
|
-
Array.prototype.slice.call(arguments)
|
11
|
-
)
|
12
|
-
);
|
13
|
-
};
|
14
|
-
nop.prototype = this.prototype || {};
|
15
|
-
bound.prototype = new nop();
|
16
|
-
return bound;
|
17
|
-
};
|
18
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
|
2
|
-
if (typeof Object.assign != 'function') {
|
3
|
-
(function () {
|
4
|
-
Object.assign = function (target) {
|
5
|
-
'use strict';
|
6
|
-
if (target === undefined || target === null) {
|
7
|
-
throw new TypeError('Cannot convert undefined or null to object');
|
8
|
-
}
|
9
|
-
|
10
|
-
var output = Object(target);
|
11
|
-
for (var index = 1; index < arguments.length; index++) {
|
12
|
-
var source = arguments[index];
|
13
|
-
if (source !== undefined && source !== null) {
|
14
|
-
for (var nextKey in source) {
|
15
|
-
if (source.hasOwnProperty(nextKey)) {
|
16
|
-
output[nextKey] = source[nextKey];
|
17
|
-
}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
21
|
-
return output;
|
22
|
-
};
|
23
|
-
})();
|
24
|
-
}
|