asset 0.1.12 → 0.1.13

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: 1f834010e80a10840bf6589574d20d91d65b9e67
4
- data.tar.gz: d91f555db8a3259627c9737231764ce376038c97
3
+ metadata.gz: aa56707d89c8c2fa5650e219c0035d44f04c76b5
4
+ data.tar.gz: ef875488de30478045bf28906063559ddff6eb46
5
5
  SHA512:
6
- metadata.gz: 79ec326df9133c08d7a4c1694f5e1f80f2cb5cfa7fb22210de27792f610362aaeca3cfb320ba96f07d6d7eabf36e09a1a7b54ce8ad841f006e8fd1b93a1f2e06
7
- data.tar.gz: 20b2c66545006996f4bfc1a6ed6363533ac15c945c9a1aaf945306fb32adb2b5900214f4fa3ef5cb07f3e5b7b95a47fbac7b0bab9469469e2d01411b1524fdd1
6
+ metadata.gz: 5cef50cde999cc938a62720f83b975c3392bca36cac2227107111080dcd04d496f9720c6cbe9d60d9c0063118d2c41a71a041c49121a064ad9e0a590c85fdc2a
7
+ data.tar.gz: 7377e09d18a821d5e6e02784a3b3ad10c7bae49a1d4e09f0b26f8a67933ed3ddca6af361e97abb07c8edfab7276e6dc35d745a61a25998465753b2b10502d495
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ **Version 0.1.13** - *2017-01-26*
2
+
3
+ - Setting bundle last modified to boot time
4
+
1
5
  **Version 0.1.12** - *2017-01-26*
2
6
 
3
7
  - Reverted symlinks, assets must be file
data/asset.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'asset'
3
- s.version = '0.1.12'
4
- s.date = '2017-01-26'
3
+ s.version = '0.1.13'
4
+ s.date = '2017-01-27'
5
5
  s.summary = "Compress and serve your CSS and JS assets automatically"
6
6
  s.description = "The only thing you need for your assets."
7
7
  s.authors = ["Fugroup Limited"]
data/lib/assets/util.rb CHANGED
@@ -33,32 +33,22 @@ module Asset
33
33
 
34
34
  # Load manifest
35
35
  def self.load_manifest
36
- manifest = []
37
-
38
- Dir["#{Asset.path}/{css,js}/**/*.{css,js}"].each do |file|
36
+ Dir["#{Asset.path}/{css,js}/**/*.*"].map do |f|
39
37
  # Extract type and name
40
- file =~ /(js|css)\/(.+)$/; type, name = $1, $2
41
-
42
- # Get the modified time of the asset
43
- modified = mtime("#{type}/#{name}")
38
+ f =~ /(js|css)\/(.+)$/; type, name = $1, $2
44
39
 
45
40
  # Loading manifest with items
46
- manifest << ::Asset::Item.new(name, type, digest(File.read(file)), modified)
41
+ ::Asset::Item.new(name, type, digest(File.read(f)), mtime("#{type}/#{name}"))
47
42
  end
48
-
49
- manifest
50
43
  end
51
44
 
52
45
  # Load bundles for js and css
53
46
  def self.load_bundle(type)
54
- # Insert the bundle
55
- a = ::Asset.manifest.select{|r| r.type == type}
56
-
57
- # Get the max modified date and the keys
58
- max, keys = a.map{|r| r.modified}.max, a.map{|r| r.key}.join
47
+ # Find keys for the cache key (digest)
48
+ keys = ::Asset.manifest.select{|r| r.type == type}.map(&:key).join
59
49
 
60
50
  # Insert the bundle into the manifest
61
- ::Asset.manifest.insert(0, ::Asset::Item.new("bundle.#{type}", type, digest(keys), max))
51
+ ::Asset.manifest.insert(0, ::Asset::Item.new("bundle.#{type}", type, digest(keys), Time.now.utc))
62
52
  end
63
53
 
64
54
  # Load images into memory
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fugroup Limited
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-26 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack