rails_external_assets 0.4.0 → 0.5.0

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: 75df987d26c4dedeb0a1f1ca9423f2568eace56d
4
- data.tar.gz: fc0d7637e15e50864a1ee5698158fa43c3b2726d
3
+ metadata.gz: d39b14eec9470919305b4a82a34e529f2bf233f8
4
+ data.tar.gz: 434440e6ed92d70a04f5fbd6d2faff6ffc00591f
5
5
  SHA512:
6
- metadata.gz: ed66d25349d5c8ebabce0bd3cda9fe08c603bc90270bbbe6ef2416a0bfbad4891a3464ab930741b67d4dcdce810095051ab218b532777757a4a419f6dd942c70
7
- data.tar.gz: 5e397b9fc5e03c6d6ce7187d42cf544fe34781f7e51c4ec19924a645b55f3fed0d1a62e20bede5e78c9988a0f516e07e4858beaceaceeaf98b90c3a7b0a7da75
6
+ metadata.gz: 9089982bb34984250bbf3dc9faf0119875e16feadb1580063909c330b4b67dbd989cf7eabd39225911f5ef72486abb369b6492070bec17dc107c8387fc253b21
7
+ data.tar.gz: 5417e10ac16be66e7585146fa59a804fb79baecfffc94c3f47a9acad5c1c207e4cf38ad60e6f6ab21ecf39dad010b72d0b964f17df8a522b9a5f391ec2c0a1f7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2018-4-24)
4
+
5
+ Added:
6
+
7
+ - Manifest file is now cached to prevent reads on each asset lookup. [868e707](../../commit/868e707)
8
+
3
9
  ## 0.4.0 (2017-1-10)
4
10
 
5
11
  Fixed:
data/README.md CHANGED
@@ -124,7 +124,7 @@ This is the file location off of Rails' `public/` folder that the external asset
124
124
 
125
125
  This is the file location of the asset manifest JSON file. The keys are the file paths pre-build, and the values are the file paths post-build.
126
126
 
127
- > Defaults to `public/external-assets/manfest.json`
127
+ > Defaults to `public/external-assets/manifest.json`
128
128
 
129
129
  **sprockets_directives**
130
130
 
@@ -2,6 +2,7 @@ require 'json'
2
2
 
3
3
  module RailsExternalAssets
4
4
  class AssetFinder
5
+ @@manifest_file = nil
5
6
  class << self
6
7
  def external_asset(path)
7
8
  external_path = File.join(RailsExternalAssets.config.base_path, asset_path(path))
@@ -15,11 +16,15 @@ module RailsExternalAssets
15
16
  end
16
17
 
17
18
  def asset_manifest
19
+ return @@manifest_file unless @@manifest_file.nil?
18
20
  manifest_file = RailsExternalAssets.config.manifest_file
19
21
  throw_invalid_manifest(manifest_file) unless File.file? manifest_file
20
- JSON.parse(File.read manifest_file)
22
+ @@manifest_file = JSON.parse(File.read manifest_file)
21
23
  end
22
24
 
25
+ def clear_manifest_cache
26
+ @@manifest_file = nil
27
+ end
23
28
 
24
29
  private
25
30
 
@@ -1,3 +1,3 @@
1
1
  module RailsExternalAssets
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_external_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Lehman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.6.6
173
+ rubygems_version: 2.5.2
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Use external assets, those built outside of Sprockets' asset pipeline, in