sinatra-assets_linker 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/lib/sinatra-assets_linker/version.rb +1 -1
- data/lib/sinatra/assets_linker.rb +5 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzljZmNhZTM1OTFjMGZjMGJlMTMzNWZlYjRmYjZlZjc3NGQyZDA4MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTI4MDJjZDc2YWMwZGJjYTA0NjI1NTZkZjI5OTljYzQxN2YzNTY1MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWQ4ZTJlZjA5ZmI3YTQ5YWQ2NDY1ZTg3YTVjNGE2NjNiMDRlNWUzZjZmYzI3
|
10
|
+
NzljNGIyMTI5NmZiNDRkYjYwYjQ4ZTcwYmQwNDVhNjA0YmQxN2EyNWUyZjU2
|
11
|
+
OGQxNjVkZDE5YmJmNjc1MGI3YjA0MTAwNzZmMzBkMGNlOGJhZTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmIwODM3YWMwYTI3ZjU4M2NhN2U5MWNhZTA4ZTZlNjI0Mzg4YTMwMTRiNTgw
|
14
|
+
MjFkZjY0MTdiYTNjZDdkNDMyODYyNDBkZWNmOTE2NGRjMDMzMmI4YzFhNzY4
|
15
|
+
MWQ3NjlhNjVmMjcxN2MxZWIwMTdlYzRiYjRjOWUxZWEyOTg0MDY=
|
data/CHANGELOG.md
CHANGED
@@ -23,21 +23,18 @@ module Sinatra
|
|
23
23
|
module AssetsLinker
|
24
24
|
|
25
25
|
def css_uri(file_name, add_script_name = true)
|
26
|
-
cdn_url = get_settings(:cdn_url)
|
27
26
|
css_dir = get_settings(:css_dir, 'stylesheets')
|
28
|
-
generate_uri(
|
27
|
+
generate_uri(css_dir, file_name, add_script_name)
|
29
28
|
end
|
30
29
|
|
31
30
|
def js_uri(file_name, add_script_name = true)
|
32
|
-
cdn_url = get_settings(:cdn_url)
|
33
31
|
js_dir = get_settings(:js_dir, 'javascripts')
|
34
|
-
generate_uri(
|
32
|
+
generate_uri(js_dir, file_name, add_script_name)
|
35
33
|
end
|
36
34
|
|
37
35
|
def img_uri(file_name, add_script_name = true)
|
38
|
-
cdn_url = get_settings(:cdn_url)
|
39
36
|
img_dir = get_settings(:img_dir, 'images')
|
40
|
-
generate_uri(
|
37
|
+
generate_uri(img_dir, file_name, add_script_name)
|
41
38
|
end
|
42
39
|
|
43
40
|
private
|
@@ -46,9 +43,10 @@ module Sinatra
|
|
46
43
|
settings.respond_to?(key) ? settings.send(key) : default
|
47
44
|
end
|
48
45
|
|
49
|
-
def generate_uri(
|
46
|
+
def generate_uri(assets_dir, file_name, add_script_name)
|
50
47
|
absolute_path = false
|
51
48
|
relative_url = uri(File.join(assets_dir, file_name), absolute_path, add_script_name)
|
49
|
+
cdn_url = get_settings(:cdn_url)
|
52
50
|
return File.join(cdn_url, relative_url) unless cdn_url.nil?
|
53
51
|
relative_url
|
54
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-assets_linker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Szymon Kopciewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.2.
|
116
|
+
rubygems_version: 2.2.5
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: The Sinatra helper for the assets links.
|