asset 0.1.2 → 0.1.3

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: 45bfd8e5aba5d8941fc5dad1e7b6cfb13618f51e
4
- data.tar.gz: fa9dfa2916357553683779b8988d60604fbd8a90
3
+ metadata.gz: 4e2cdcf6a4a6b0f479b75196656f1dee83cbdc03
4
+ data.tar.gz: caac933ea274c7b56d577326feeafe7e7a97ecc3
5
5
  SHA512:
6
- metadata.gz: b3f53b15353d381dde1a06e2a798bcfcbab10bb3e5089d8bb3a216dcbb5d252830fe3a52d3e450374cd2dd0af7eec2a80563465a8e1d89eb8e24b9ea5ef97106
7
- data.tar.gz: 6a6eec4c65c51c5b8bfc3803aecb63dbd743a94e892e113ff28799ebfd2cbd5784fb3e4b117d5bac88e0ca54886147149dfe5d1cf5716983330ba2a76f8e46ff
6
+ metadata.gz: 48635c80768eab2b81e8aef4bd299025d5d3feae593043363f23a7e1cc1acb441303f23a3ee3d4b8a70ebb554bbc521954a3c4b2b64db46cf2eddfdbd8bfec13
7
+ data.tar.gz: bad81f56d84f5f77fe103591be8721a0d66bbaceccd7aa45e107aa62142c2a57654a350158d4dbcf5bc2df960864c67d785825747baa74079ed4971dbfe35e06
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ **Version 0.1.3** - *2017-01-18*
2
+
3
+ - Added more greedy regex for files with dashes
4
+
5
+ **Version 0.1.2** - *2017-01-18*
6
+
7
+ - Removed old options, manifest is now only for bundle
8
+
1
9
  **Version 0.1.1** - *2017-01-16*
2
10
 
3
11
  - Moved image timestamps to startup
data/asset.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'asset'
3
- s.version = '0.1.2'
3
+ s.version = '0.1.3'
4
4
  s.date = '2017-01-18'
5
5
  s.summary = "Compress and serve your CSS and JS automatically"
6
6
  s.description = "The only thing you need for your assets."
@@ -25,7 +25,7 @@ module Asset
25
25
  b = ::Asset.images[path] rescue nil
26
26
  # Just slip through if the path starts with http(s) or //
27
27
  src = path =~ /^(http[s]?)?:?\/\// ? path : %{/assets/images/#{path}}
28
- %{<img src="#{src}#{b ? "?#{b}" : ''}">} rescue path
28
+ %{<img src="#{src}#{b ? "?#{b}" : ''}">}
29
29
  end
30
30
 
31
31
  private
@@ -37,7 +37,7 @@ module Asset
37
37
  item = ::Asset.manifest.find{|i| i.path == path}
38
38
 
39
39
  # Src is same as path if item not found
40
- item ? item.files.map{|f| yield(asset_url(f))} : yield(path)
40
+ item ? item.sources.map{|f| yield(asset_url(f))} : yield(path)
41
41
  end.flatten.join("\n")
42
42
  end
43
43
 
data/lib/assets/item.rb CHANGED
@@ -12,8 +12,13 @@ module Asset
12
12
  end
13
13
 
14
14
  # Get the files for this item
15
- def files
16
- (@app and !p?) ? bundle_files : [@path]
15
+ def files(bundle = true)
16
+ (@app and bundle) ? bundle_files : [@path]
17
+ end
18
+
19
+ # Get the sources for this item
20
+ def sources
21
+ files(!p?)
17
22
  end
18
23
 
19
24
  # Get the full path
data/lib/assets/router.rb CHANGED
@@ -20,7 +20,7 @@ module Asset
20
20
  # Match /assets?/:type/path
21
21
  when /^(\/assets)?\/(js|css)\/(.+)/
22
22
  type, path = $2, $3
23
- path =~ /-([a-f0-9]{1,32})/
23
+ path =~ /-([a-f0-9]{1,32})\.(css|js)$/
24
24
  path.gsub!("-#{@key}", '') if (@key = $1)
25
25
 
26
26
  # Find the item
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fugroup Limited