sinatra-assetpack 0.3.2 → 0.3.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: e742977ba0329b1f960c46f4294fa2cb860d35de
4
- data.tar.gz: 45e3dd99cc00c05bf524751f0a1f19e0a8a43693
3
+ metadata.gz: 55ba0d85167b1dcab1109b1ac78c9e36da5f15fc
4
+ data.tar.gz: bae9f997d86fda18ef4cb1564142db0463f91665
5
5
  SHA512:
6
- metadata.gz: 7b2d990a88e9acb49884f9d764fe5c7f8b17b045da773b245200f2ff3a21617429cd525358ca9cc594b859bf7725a8658446a1f53bfe63078f968646f211e719
7
- data.tar.gz: 23d6d7a5a7f2cdab53406e16a572ba068d46e3042607595032e19d8560f19ec8f64ffc78cd6adf3ca70a69fc67c7fa8e0cf6fd30e76c5f36441858e958907747
6
+ metadata.gz: f336d7eef59f6b4bc98ea19c31464bd1c1d564347f919b67cb3ef25b652494772e194898029b2c5569218e81974ffd8864c937906da28abc7a4930dfc6646fae
7
+ data.tar.gz: 2097ac2b02fbd0fd933a044a64803a71fa685e134e873508dd8490fbc6f08459896eef5eab6ea8c5a8eac1e915f0e0625177196bcdfa81fd3084f03cef3b2fe0
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.3.3 - April 29, 2014
2
+
3
+ * Fix : Skip CSS preprocessing for malformed URIs (#167)
4
+ * Fix : Updates dependent require calls on invocation (#168)
5
+ * Doc : Add doc for asset hosts (#156)
6
+
1
7
  ## v0.3.2 - January 10, 2014
2
8
 
3
9
  * Change : Support .ico files (#147)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sinatra-assetpack (0.3.2)
4
+ sinatra-assetpack (0.3.3)
5
5
  jsmin
6
6
  rack-test
7
7
  sinatra
data/README.md CHANGED
@@ -560,6 +560,38 @@ class App < Sinatra::Base
560
560
  end
561
561
  ```
562
562
 
563
+ ### assets.asset_hosts
564
+ Adds asset hosts to be used in production.
565
+
566
+ Useful for hosting your assets on CDNs.
567
+
568
+ ``` ruby
569
+ # Usage:
570
+ assets {
571
+ asset_hosts ['URL1', 'URL2']
572
+ }
573
+ ```
574
+
575
+ #### Example
576
+ In this example, all assets are served from multiple CDN subdomains:
577
+
578
+ ``` ruby
579
+ class App < Sinatra::Base
580
+ assets {
581
+ serve '/css', :from => 'app/css'
582
+ serve '/js', :from => 'app/js'
583
+
584
+ asset_hosts [
585
+ '//cdn-0.example.org',
586
+ '//cdn-1.example.org'
587
+ ]
588
+
589
+ css :a, ["/css/style.css"]
590
+ js :b, ["/js/hello.js"]
591
+ }
592
+ end
593
+ ```
594
+
563
595
  ## Helpers
564
596
 
565
597
  These are helpers you can use in your views.
data/certs/j15e.pem CHANGED
@@ -1,20 +1,22 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDRjCCAi6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
2
+ MIIDmjCCAoKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
3
3
  cGhpbGlwcGUuZG95bGUxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT
4
- 8ixkARkWA2NvbTAeFw0xMzAzMTEyMjM5MjNaFw0xNDAzMTEyMjM5MjNaMEkxGzAZ
4
+ 8ixkARkWA2NvbTAeFw0xNDA0MjkyMDM5MjNaFw0xNTA0MjkyMDM5MjNaMEkxGzAZ
5
5
  BgNVBAMMEmplYW5waGlsaXBwZS5kb3lsZTEVMBMGCgmSJomT8ixkARkWBWdtYWls
6
6
  MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
7
- CgKCAQEApQtzOyMoi48Pc0BRF++BXc2ulECpOypwYqnzIdbE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o89
11
+ meeO0/4Ud42gsROVQS32OJLmczJjRj9xY2tTKnIU76vEZouqiLKn8Ylwpb/n9d4W
12
+ Iq8ruVk2Q0XKrSYA2e+kPCt5M1DArQIDAQABo4GMMIGJMAkGA1UdEwQCMAAwCwYD
13
+ VR0PBAQDAgSwMB0GA1UdDgQWBBQRseuuQiwORxjEL3SmrCKF18k7HzAnBgNVHREE
14
+ IDAegRxqZWFucGhpbGlwcGUuZG95bGVAZ21haWwuY29tMCcGA1UdEgQgMB6BHGpl
15
+ YW5waGlsaXBwZS5kb3lsZUBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQADggEBAB2x
16
+ wa3rDskwP2dQT8vlVvNCiBc7lOw4TJkpd9l5wwep+6umh1GIFt80BZ5VomGo+1Sx
17
+ yUuD+VYOaaOLGDF5qqirIn5VDvjNpYKw6s8XKvKawWu61znAZkiklNz9YTog6mo1
18
+ 0/2ggQHWuMoSM8ZNUWg6UKRvSiT+3S0gGyfrybepm9ZFiQVFrFkgLQ+Lt/0vzBJD
19
+ osc8G2grd5N2ieCykW2dfdKftrAoHy9zstg0CTTkFHaoQesLfEE6HdGImfIe2qpJ
20
+ vo0Ni/EOoxL0d1qrp9TiARbe5JDIK4KWKJcyJrsOCnAUNwfqwf0riBGpsnCRwQi7
21
+ c8m4yoP9xz6wjpS7gxQ=
20
22
  -----END CERTIFICATE-----
@@ -1,4 +1,5 @@
1
1
  require 'rack/test'
2
+ require 'sinatra'
2
3
 
3
4
  module Sinatra
4
5
  module AssetPack
@@ -5,7 +5,13 @@ module Sinatra
5
5
  module Css
6
6
  def self.preproc(source, assets)
7
7
  source.gsub(/url\((["']?)(.*?)(["']?)\)/) do |match|
8
- uri = URI.parse($2)
8
+
9
+ # Not parsable by URI.parse
10
+ begin
11
+ uri = URI.parse($2)
12
+ rescue URI::InvalidURIError
13
+ next match
14
+ end
9
15
 
10
16
  # Not a valid complete url
11
17
  next match if uri.path.nil?
@@ -1,6 +1,6 @@
1
1
  module Sinatra
2
2
  module AssetPack
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
 
5
5
  # @deprecated Please use AssetPack::VERSION instead
6
6
  def self.version
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.strip.split("\n")
13
13
  s.executables = Dir['bin/*'].map { |f| File.basename(f) }
14
14
  s.cert_chain = ['certs/j15e.pem']
15
- s.signing_key = File.expand_path('~/.gem/private_key.pem') if $0 =~ /gem\z/
15
+ s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
16
16
  s.required_ruby_version = '>= 1.9.2'
17
17
 
18
18
  if File.exists?('UPGRADING')
@@ -0,0 +1,3 @@
1
+ form {
2
+ background-image: url('data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iM3B4IiB2aWV3Qm94PSIwIDAgNiAzIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2IDMiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwb2x5Z29uIHBvaW50cz0iNS45OTIsMCAyLjk5MiwzIC0wLjAwOCwwICIvPjwvc3ZnPg==');
3
+ }
data/test/preproc_test.rb CHANGED
@@ -42,9 +42,17 @@ class PreprocTest < UnitTest
42
42
  end
43
43
 
44
44
  test "ignores data-uris" do
45
- app.stubs(:clear_cach).returns(true)
45
+ app.stubs(:clear_cache).returns(true)
46
46
  app.stubs(:development?).returns(false)
47
47
  get '/css/bariol.css'
48
48
  assert body =~ %r{data:application/x-font-woff;charset=utf-8;base64,[A-Za-z0-9=/]{100,}}
49
49
  end
50
+
51
+ test "skips malformed data-uris" do
52
+ app.stubs(:clear_cache).returns(true)
53
+ app.stubs(:development?).returns(false)
54
+ get '/css/bad_uri.css'
55
+ puts body
56
+ assert body =~ %r{data:image/svg\+xml;base64, PHN2ZyB4bW}
57
+ end
50
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-assetpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rico Sta. Cruz
@@ -11,26 +11,28 @@ bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
- MIIDRjCCAi6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
14
+ MIIDmjCCAoKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
15
15
  cGhpbGlwcGUuZG95bGUxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT
16
- 8ixkARkWA2NvbTAeFw0xMzAzMTEyMjM5MjNaFw0xNDAzMTEyMjM5MjNaMEkxGzAZ
16
+ 8ixkARkWA2NvbTAeFw0xNDA0MjkyMDM5MjNaFw0xNTA0MjkyMDM5MjNaMEkxGzAZ
17
17
  BgNVBAMMEmplYW5waGlsaXBwZS5kb3lsZTEVMBMGCgmSJomT8ixkARkWBWdtYWls
18
18
  MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
19
- CgKCAQEApQtzOyMoi48Pc0BRF++BXc2ulECpOypwYqnzIdbE5+iLownixYB3KkKm
20
- VxIlo9pYWIp5JR+Uphv/P9vKJAIjfldtlus6o8xFT0HujXyEMMbFMGHH01PvDYkx
21
- vnMw5O6YVdtbsKvjknB4JOcOmxQAeXBunLBJk0huOLALlDW38UZF3AKNVPpR+Gst
22
- gTZCIAPq22wB9I0HYfyCitjrMVK4jTHgjPjNNQn4BhuhkqEWr5JkVtipGCUFyl45
23
- 2ISskOPckLW/qwCq4vyjVK6JIZb2Ei9DHtip44u7KjFEX5QdvHyu81xatMmtKvYn
24
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5waGlsaXBwZS5kb3lsZUBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQADggEBAB2x
28
+ wa3rDskwP2dQT8vlVvNCiBc7lOw4TJkpd9l5wwep+6umh1GIFt80BZ5VomGo+1Sx
29
+ yUuD+VYOaaOLGDF5qqirIn5VDvjNpYKw6s8XKvKawWu61znAZkiklNz9YTog6mo1
30
+ 0/2ggQHWuMoSM8ZNUWg6UKRvSiT+3S0gGyfrybepm9ZFiQVFrFkgLQ+Lt/0vzBJD
31
+ osc8G2grd5N2ieCykW2dfdKftrAoHy9zstg0CTTkFHaoQesLfEE6HdGImfIe2qpJ
32
+ vo0Ni/EOoxL0d1qrp9TiARbe5JDIK4KWKJcyJrsOCnAUNwfqwf0riBGpsnCRwQi7
33
+ c8m4yoP9xz6wjpS7gxQ=
32
34
  -----END CERTIFICATE-----
33
- date: 2014-01-10 00:00:00.000000000 Z
35
+ date: 2014-04-29 00:00:00.000000000 Z
34
36
  dependencies:
35
37
  - !ruby/object:Gem::Dependency
36
38
  name: jsmin
@@ -265,6 +267,7 @@ files:
265
267
  - test/app/.gitignore
266
268
  - test/app/Rakefile
267
269
  - test/app/app.rb
270
+ - test/app/app/css/bad_uri.scss
268
271
  - test/app/app/css/bariol.scss
269
272
  - test/app/app/css/behavior.htc
270
273
  - test/app/app/css/js2c.css
metadata.gz.sig CHANGED
Binary file