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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +32 -0
- data/certs/j15e.pem +17 -15
- data/lib/sinatra/assetpack.rb +1 -0
- data/lib/sinatra/assetpack/css.rb +7 -1
- data/lib/sinatra/assetpack/version.rb +1 -1
- data/sinatra-assetpack.gemspec +1 -1
- data/test/app/app/css/bad_uri.scss +3 -0
- data/test/preproc_test.rb +9 -1
- metadata +20 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55ba0d85167b1dcab1109b1ac78c9e36da5f15fc
|
4
|
+
data.tar.gz: bae9f997d86fda18ef4cb1564142db0463f91665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
|
-
|
2
|
+
MIIDmjCCAoKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
|
3
3
|
cGhpbGlwcGUuZG95bGUxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT
|
4
|
-
|
4
|
+
8ixkARkWA2NvbTAeFw0xNDA0MjkyMDM5MjNaFw0xNTA0MjkyMDM5MjNaMEkxGzAZ
|
5
5
|
BgNVBAMMEmplYW5waGlsaXBwZS5kb3lsZTEVMBMGCgmSJomT8ixkARkWBWdtYWls
|
6
6
|
MRMwEQYKCZImiZPyLGQBGRYD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CTTkFHaoQesLfEE6HdGImfIe2qpJ
|
20
|
+
vo0Ni/EOoxL0d1qrp9TiARbe5JDIK4KWKJcyJrsOCnAUNwfqwf0riBGpsnCRwQi7
|
21
|
+
c8m4yoP9xz6wjpS7gxQ=
|
20
22
|
-----END CERTIFICATE-----
|
data/lib/sinatra/assetpack.rb
CHANGED
@@ -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
|
-
|
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?
|
data/sinatra-assetpack.gemspec
CHANGED
@@ -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(
|
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(:
|
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.
|
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
|
-
|
14
|
+
MIIDmjCCAoKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
|
15
15
|
cGhpbGlwcGUuZG95bGUxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT
|
16
|
-
|
16
|
+
8ixkARkWA2NvbTAeFw0xNDA0MjkyMDM5MjNaFw0xNTA0MjkyMDM5MjNaMEkxGzAZ
|
17
17
|
BgNVBAMMEmplYW5waGlsaXBwZS5kb3lsZTEVMBMGCgmSJomT8ixkARkWBWdtYWls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
osc8G2grd5N2ieCykW2dfdKftrAoHy9zstg0CTTkFHaoQesLfEE6HdGImfIe2qpJ
|
32
|
+
vo0Ni/EOoxL0d1qrp9TiARbe5JDIK4KWKJcyJrsOCnAUNwfqwf0riBGpsnCRwQi7
|
33
|
+
c8m4yoP9xz6wjpS7gxQ=
|
32
34
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-
|
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
|