sibu 1.0.11 → 1.0.12

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: ddad9d6305d71605c692e8dbdafadb0c6cce1d7a
4
- data.tar.gz: 91539711c089a4d111dede2965a554051c590dc5
3
+ metadata.gz: d80e0d86c6b0ae3ee81f45775acf1c021fe15a17
4
+ data.tar.gz: 712c3383c6bb99034f988e9ecd45933f7cd60957
5
5
  SHA512:
6
- metadata.gz: e025dc9b575fedeb91471848f78487b4ba1e3e7fbb19e81822bc31576aae2cd764326ce75bd6e39dd2d2b9ea0901d30f5b33bcef1a26a354a62f90f3d3d74a05
7
- data.tar.gz: cb43b5c568dcd4c9323944645c2ab6935f81988d8a95fe3c47902115db8070bf8e2f10253174d8eaa73074f63348bce2acb724e0c69171e1ff8540355a8db827
6
+ metadata.gz: a51aca986aff80d8a5c0341aa6081bf464f66ee74eacae47aedf730035a123d19edf9219e4d3df56e00b3adf56dfb2aff72841677b2459ceec37a1892f09ccb5
7
+ data.tar.gz: 79751582c4674b13b2d7da12cd50224d2073f695bdb746d2d222457eb97c5a4ccb01fb9962777ff71c95313c4c4f554b26a5da8d47661f4200469f9236cf0fe5
@@ -38,8 +38,8 @@ module Sibu
38
38
 
39
39
  def update
40
40
  if @site.update(site_params)
41
- if conf[:custom_styles] && @site.previous_changes.has_key?(:custom_data)
42
- generate_styles(@site)
41
+ if conf[:custom_styles]
42
+ generate_styles(@site, @site.previous_changes.has_key?(:custom_data))
43
43
  end
44
44
  if @site.previous_changes.has_key?(:version)
45
45
  @site.update_paths
@@ -61,7 +61,7 @@ module Sibu
61
61
  if new_site.save
62
62
  if conf[:custom_styles]
63
63
  generate_styles(@site)
64
- generate_styles(new_site)
64
+ generate_styles(new_site, true)
65
65
  end
66
66
  redirect_to sites_url, notice: "Le site a bien été copié."
67
67
  else
@@ -81,8 +81,8 @@ module Sibu
81
81
  params.require(:site).permit!
82
82
  end
83
83
 
84
- def generate_styles(site)
85
- ds = Sibu::DynamicStyle.new(site.id)
84
+ def generate_styles(site, force_styles = false)
85
+ ds = Sibu::DynamicStyle.new(site.id, force_styles)
86
86
  ds.compile
87
87
  end
88
88
  end
@@ -3,9 +3,9 @@ module Sibu
3
3
 
4
4
  attr_reader :site, :body, :env, :filename, :scss_file, :styles_changed
5
5
 
6
- def initialize(site_id)
6
+ def initialize(site_id, force_styles = false)
7
7
  @site = Sibu::Site.find(site_id)
8
- @styles_changed = @site.style.nil? || styles_changed?(@site.style_url)
8
+ @styles_changed = @site.style.nil? || force_styles || styles_changed?(@site.style_url)
9
9
  if @styles_changed
10
10
  @filename = "#{site_id}_#{Time.current.to_i}"
11
11
  @scss_file = File.new(scss_file_path, 'w')
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '1.0.11'
2
+ VERSION = '1.0.12'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-02 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails