lalala 4.0.0.dev.66 → 4.0.0.dev.71

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fbd4496eb2038546c4ae89643c167660279bce7
4
- data.tar.gz: 243c92364932cb6845fd878b77c6f7dea1708116
3
+ metadata.gz: 53b9132ad4862fd665528e46a51ae41409f472fb
4
+ data.tar.gz: 6557e2d81cbb7fe71fa0be8e0f21c3df317a763a
5
5
  SHA512:
6
- metadata.gz: ce534fc6d6e05abb6556dcaf90b76163fea21ca60d51b6dd5628f7379557d85787ba3cb100e658127a341e4a77e8112a187eaab8532ce2fb82e84d837f70807a
7
- data.tar.gz: ad2f247857b0b55655a94e6635f5d07aee828554dbbf4f1e16600eaf3a5d098fff95106dc80a5f80e0920fbe35dfee9e87238ccc23d62b00f0dd2207d2601b5d
6
+ metadata.gz: 6471354e1b415bb167edcc537a431c3b144ab8b69202693c0c2ea2c13d247aa23a6fb7e92eb99cb523492fc409ce425964a5396a9734ef5c974917ab11db8c8e
7
+ data.tar.gz: 2b013f3ce49ceaff9a0e5f839361d14bfed304d080d693bd4eac80def8333317fefec6c9ffaff0012d4445d3b1556b0016af5754297a112febc4af4a62452cc0
data/lib/lalala.rb CHANGED
@@ -27,7 +27,6 @@ module Lalala
27
27
  require 'stringex'
28
28
  require 'activeadmin'
29
29
 
30
- require 'formtastic/inputs/grid_input'
31
30
 
32
31
  if groups.include?(:assets)
33
32
  require 'lalala/assets'
@@ -41,9 +40,12 @@ module Lalala
41
40
  require 'lalala/test'
42
41
  end
43
42
 
43
+ require 'formtastic/inputs/grid_input'
44
+
44
45
  autoload :ExtActiveRecord
45
46
  autoload :ExtRack
46
47
  autoload :ExtI18n
48
+ autoload :ExtWithAdvisoryLock
47
49
 
48
50
  autoload :Markdown
49
51
  autoload :Pages
data/lib/lalala/engine.rb CHANGED
@@ -43,6 +43,10 @@ module Lalala
43
43
 
44
44
  end
45
45
 
46
+ ActiveSupport.on_load :active_record do
47
+ Lalala::ExtWithAdvisoryLock.patch!
48
+ end
49
+
46
50
  Formtastic::FormBuilder.send(
47
51
  :include, Lalala::ExtI18n::InputHelper)
48
52
 
@@ -0,0 +1,11 @@
1
+ module Lalala::ExtWithAdvisoryLock
2
+ extend ActiveSupport::Autoload
3
+
4
+ autoload :Flock
5
+
6
+ def self.patch!
7
+ require 'with_advisory_lock/flock'
8
+ WithAdvisoryLock::Flock.send :include, Lalala::ExtWithAdvisoryLock::Flock
9
+ end
10
+
11
+ end
@@ -0,0 +1,21 @@
1
+ module Lalala::ExtWithAdvisoryLock::Flock
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ remove_method :filename
6
+ alias_method :filename, :_ng_filename
7
+ end
8
+
9
+ def _ng_filename
10
+ @filename ||= begin
11
+ safe = @lock_name.gsub(/[^a-z0-9]/i, '')
12
+ fn = "lock-#{safe}-#{@lock_name.to_s.hash}"
13
+
14
+ dir = File.join(Rails.application.paths['tmp'].first, 'locks')
15
+ FileUtils.mkdir_p(dir)
16
+
17
+ File.join(dir, fn)
18
+ end
19
+ end
20
+
21
+ end
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "66"
3
+ BUILD = "71"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.66
4
+ version: 4.0.0.dev.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -1477,6 +1477,8 @@ files:
1477
1477
  - lib/lalala/ext_rack/canonical_url.rb
1478
1478
  - lib/lalala/ext_rack/i18n_negotiator.rb
1479
1479
  - lib/lalala/ext_rack/page_loader.rb
1480
+ - lib/lalala/ext_with_advisory_lock.rb
1481
+ - lib/lalala/ext_with_advisory_lock/flock.rb
1480
1482
  - lib/lalala/markdown.rb
1481
1483
  - lib/lalala/markdown/active_model.rb
1482
1484
  - lib/lalala/markdown/handlers/base.rb