asset 0.1.3 → 0.1.4

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: 4e2cdcf6a4a6b0f479b75196656f1dee83cbdc03
4
- data.tar.gz: caac933ea274c7b56d577326feeafe7e7a97ecc3
3
+ metadata.gz: f6278ea671a78e4cf156bb1dad148e268d11dcb9
4
+ data.tar.gz: b445698bdb23def5a03fa76c2ac1fbff5a673f12
5
5
  SHA512:
6
- metadata.gz: 48635c80768eab2b81e8aef4bd299025d5d3feae593043363f23a7e1cc1acb441303f23a3ee3d4b8a70ebb554bbc521954a3c4b2b64db46cf2eddfdbd8bfec13
7
- data.tar.gz: bad81f56d84f5f77fe103591be8721a0d66bbaceccd7aa45e107aa62142c2a57654a350158d4dbcf5bc2df960864c67d785825747baa74079ed4971dbfe35e06
6
+ metadata.gz: b02ccb480ae994e3570013dd78ed99f4347686bdd6dd919ad1f7f213a9368be23713680c9820cebf19501bb7fa144ba06b705a31eaadff90d7e86cc799727ed1
7
+ data.tar.gz: 0d2d320cad89f38253d244d7489be2acf39f1ab61878c3648d44809408f99bfc27ceb66d0067cab2ac6e5ad2fbfdc0ffd25f9a7c9469469919834fbcaaba4aa8
@@ -1,3 +1,7 @@
1
+ **Version 0.1.4** - *2017-01-18*
2
+
3
+ - Moved images to /images instead of /assets/images
4
+
1
5
  **Version 0.1.3** - *2017-01-18*
2
6
 
3
7
  - Added more greedy regex for files with dashes
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'asset'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
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."
@@ -22,10 +22,16 @@ module Asset
22
22
 
23
23
  # Image tags
24
24
  def image_tag(path)
25
- b = ::Asset.images[path] rescue nil
25
+ %{<img src="#{image_url(path)}">}
26
+ end
27
+
28
+ # Image URL
29
+ def image_url(path)
26
30
  # Just slip through if the path starts with http(s) or //
27
- src = path =~ /^(http[s]?)?:?\/\// ? path : %{/assets/images/#{path}}
28
- %{<img src="#{src}#{b ? "?#{b}" : ''}">}
31
+ src = path =~ /^(http[s]?)?:?\/\// ? path : %{/images/#{path}}
32
+
33
+ # Return the path with timestamp if possible
34
+ %{#{src}#{(b = (::Asset.images[path] rescue nil)) ? "?#{b}" : ''}}
29
35
  end
30
36
 
31
37
  private
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fugroup Limited