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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjdlNWEzNmYxMjk3OTI0ZmY5NDFjZDZhNDgzNjY0YjMwYjUyNGE2YQ==
4
+ MzljZmNhZTM1OTFjMGZjMGJlMTMzNWZlYjRmYjZlZjc3NGQyZDA4MQ==
5
5
  data.tar.gz: !binary |-
6
- NDA4ZjgwNzQ4ODc2OGE4NDM4MzcxZjlmOGNhMTk4YzFhZGMwZmNjMQ==
6
+ YTI4MDJjZDc2YWMwZGJjYTA0NjI1NTZkZjI5OTljYzQxN2YzNTY1MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDg0NjcxMzMyNDcyOWVmNTY5ZmE1ODdiZmI1Y2JhMjIyMjNlNWE0MWEzN2Vi
10
- NDFjMzRmZWNiNjQ1Y2FiMDU4MDE5NGEyZTFiMzE1NGY0NWMwMzg2OGM4YjI3
11
- ODFjZmM0ZjMwNjIyODIzZDBmY2Y4ZjFkZTA3NTc3ODI1NWZhYjM=
9
+ ZWQ4ZTJlZjA5ZmI3YTQ5YWQ2NDY1ZTg3YTVjNGE2NjNiMDRlNWUzZjZmYzI3
10
+ NzljNGIyMTI5NmZiNDRkYjYwYjQ4ZTcwYmQwNDVhNjA0YmQxN2EyNWUyZjU2
11
+ OGQxNjVkZDE5YmJmNjc1MGI3YjA0MTAwNzZmMzBkMGNlOGJhZTQ=
12
12
  data.tar.gz: !binary |-
13
- YzUxODcwMzYyZDg1ZGEyMzAzOTA0OGFhNDkwZjg4NjdkNTllMDVjZTVkYjZl
14
- ZjE2MDQwMTA5NWVkYmFhZmRlYzVmYjIxMzk3YjA2MzkxNWRlNWVkMTYwZDc3
15
- NTgwMzBiZjdhMzNhOWNiMzNkNGU2ZTliYmRjMTE4YjE1MzljM2U=
13
+ NmIwODM3YWMwYTI3ZjU4M2NhN2U5MWNhZTA4ZTZlNjI0Mzg4YTMwMTRiNTgw
14
+ MjFkZjY0MTdiYTNjZDdkNDMyODYyNDBkZWNmOTE2NGRjMDMzMmI4YzFhNzY4
15
+ MWQ3NjlhNjVmMjcxN2MxZWIwMTdlYzRiYjRjOWUxZWEyOTg0MDY=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.0.5 (2015.07.01)
2
+
3
+ * refactor
4
+
1
5
  === 1.0.4 (2015.06.23)
2
6
 
3
7
  * update dockerfiles
@@ -18,5 +18,5 @@
18
18
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
20
  module SinatraAssetsLinker
21
- VERSION = '1.0.4'
21
+ VERSION = '1.0.5'
22
22
  end
@@ -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(cdn_url, css_dir, file_name, add_script_name)
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(cdn_url, js_dir, file_name, add_script_name)
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(cdn_url, img_dir, file_name, add_script_name)
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(cdn_url, assets_dir, file_name, add_script_name)
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
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-06-23 00:00:00.000000000 Z
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.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.