fronton 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7654c544a8ad3e81b43f92ad480711864d038bd5
4
- data.tar.gz: fc8ef00eb70a114f76aa177e2712299d8aef2be8
3
+ metadata.gz: c8b2a7eeb7866101efc45c8b5403e62ab6599040
4
+ data.tar.gz: c97a76b060b4ad86eb03171adeefb90442ae3dc3
5
5
  SHA512:
6
- metadata.gz: 8f945ea15d7c3ddbe568d78c0a4b87725b53bbef383e1d4c24ef495475e3c68010baac104519aa350a7f08b06ca3e9ff593cc99d21f17ba18977b76dd1d48ec8
7
- data.tar.gz: 7dd52bb0083da7dd2e0f3f7447913b417589de50d92a9a16be77e8492c190c7c829bfb09326ab9b21f2ecf352f5c0d9faf2742d397d8724d67397f8d167329b2
6
+ metadata.gz: c5c89f46c43b1191aecf10f1e697c8bd7ba642d565b46562a5421ae968cc3019fd064d98c46c4fa0546e9763c2d5617202c6fd053f1b3c992ed7014ba13777ee
7
+ data.tar.gz: 7d3536566d98d26664e1e909fe32eb27a57885e0794913e567a0943875651f8c91e6570c3b618ff4a628181e0a6e9df1a87a77141efd8a1e316392430e6d9065
@@ -2,7 +2,7 @@ module Fronton
2
2
  class AssetsHelpers
3
3
  def initialize(options = {})
4
4
  @use_digest = options.fetch(:digest, false)
5
- @prefix = options.fetch(:prefix, '/assets')
5
+ @prefix = options.fetch(:prefix)
6
6
  @manifest = options.fetch(:manifest)
7
7
  end
8
8
 
data/lib/fronton/page.rb CHANGED
@@ -9,6 +9,7 @@ module Fronton
9
9
  @name = name
10
10
  @config = options.fetch(:config)
11
11
  @digest = options.fetch(:digest, false)
12
+ @prefix = options.fetch(:prefix, '/assets')
12
13
  @url = url
13
14
  end
14
15
 
@@ -18,7 +19,9 @@ module Fronton
18
19
 
19
20
  def save
20
21
  with_digest do
21
- File.open(save_path, 'w') { |f| f.write(content) }
22
+ with_prefix "#{config.assets_url}/assets" do
23
+ File.open(save_path, 'w') { |f| f.write(content) }
24
+ end
22
25
  end
23
26
  end
24
27
 
@@ -43,7 +46,7 @@ module Fronton
43
46
  end
44
47
 
45
48
  def helpers_options
46
- { digest: @digest, manifest: @config.manifest }
49
+ { digest: @digest, manifest: @config.manifest, prefix: @prefix }
47
50
  end
48
51
 
49
52
  def save_path
@@ -53,5 +56,12 @@ module Fronton
53
56
  def with_digest
54
57
  @digest = true; yield; @digest = false # rubocop:disable Style/Semicolon
55
58
  end
59
+
60
+ def with_prefix(prefix)
61
+ old_prefix = @prefix
62
+ @prefix = prefix
63
+ yield
64
+ @prefix = old_prefix
65
+ end
56
66
  end
57
67
  end
@@ -2,7 +2,7 @@ module Fronton
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 4
5
- TINY = 3
5
+ TINY = 4
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fronton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Aranda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
11
+ date: 2016-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport