sinatra-sprockets-ext 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +7 -1
- data/lib/sinatra-sprockets-ext.rb +1 -0
- data/lib/sinatra/sprockets/helpers.rb +3 -10
- data/lib/sinatra/sprockets/version.rb +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -6,7 +6,11 @@ Sinatra extension for Sprockets integration.
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
gem 'sinatra-sprockets-ext'
|
9
|
+
gem 'sinatra-sprockets-ext'
|
10
|
+
|
11
|
+
or `gem install sinatra-sprockets-ext` and then manually require it:
|
12
|
+
|
13
|
+
require 'sinatra/sprockets'
|
10
14
|
|
11
15
|
Currently requires 1.9 (1.8 is near end-of-life anyway).
|
12
16
|
|
@@ -45,3 +49,5 @@ You'll also get helper functions that will be familiar to those who use Rails:
|
|
45
49
|
|
46
50
|
Copyright © 2012 J. Andrew Marshall. All rights reserved.
|
47
51
|
License is available in the LICENSE file.
|
52
|
+
|
53
|
+
Special thanks to [those who have contributed](https://github.com/amarshall/sinatra-sprockets/graphs/contributors)!
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'sinatra/sprockets'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Sinatra::Sprockets
|
2
2
|
module Helpers
|
3
3
|
def asset_path source, options = {}
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
source = source.logical_path if source.respond_to?(:logical_path)
|
5
|
+
path = asset_paths.compute_public_path(source, config.prefix, options.merge(:body => true))
|
6
|
+
options[:body] ? "#{path}?body=1" : path
|
7
7
|
end
|
8
8
|
|
9
9
|
def image_path source, options = {}
|
@@ -37,7 +37,6 @@ module Sinatra::Sprockets
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def stylesheet_link_tag(*sources)
|
40
|
-
options = {}
|
41
40
|
debug = config.debug
|
42
41
|
body = false
|
43
42
|
digest = config.digest
|
@@ -55,12 +54,6 @@ module Sinatra::Sprockets
|
|
55
54
|
end.join("\n")
|
56
55
|
end
|
57
56
|
|
58
|
-
def asset_path(source, options={})
|
59
|
-
source = source.logical_path if source.respond_to?(:logical_path)
|
60
|
-
path = asset_paths.compute_public_path(source, config.prefix, options.merge(:body => true))
|
61
|
-
options[:body] ? "#{path}?body=1" : path
|
62
|
-
end
|
63
|
-
|
64
57
|
private
|
65
58
|
|
66
59
|
def assets_environment
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-sprockets-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- LICENSE
|
40
40
|
- README.md
|
41
41
|
- Rakefile
|
42
|
+
- lib/sinatra-sprockets-ext.rb
|
42
43
|
- lib/sinatra/sprockets.rb
|
43
44
|
- lib/sinatra/sprockets/asset_paths.rb
|
44
45
|
- lib/sinatra/sprockets/configuration.rb
|