i18n-assets 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/i18n/assets/sprockets.rb +6 -1
- data/lib/i18n/assets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmViNjBlODE1MzZiNjZlYzllN2ViYTZlMTJlYzdhNGVjMWI0OTk5OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWIwODk5ZjU1M2RkMmIxNjNmZWEzNzk5Y2ViMmVlODcyMmE2MDdlOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTEyNDdhMWVmOTQ3ZWRmMTEwZjgyMGViMTJhZTFjZWEyN2NjNjE2ZmZhZDUx
|
10
|
+
MzE5Y2ZlOGViZWZkMzFkOTNhNDRjZjY2YjU3ODQwOThjYmFmMjRjNTVkNTBl
|
11
|
+
ZThkOTNlYzE0YTYzMzdkN2Y1NjEzMDI2OGY1MjRmNmQzYTc0ZmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODlkM2ZlZDEwMzA0YzAyNjBkNTZiOTI2YWFlZTU4MDdjNGEyODM5ZmJiZDNj
|
14
|
+
MjMwOWE5YTJiNWM5N2U3ZWQ4ZWM3NGU1N2ZiODgxMzcyYTA3M2U0ZTRkMzQ0
|
15
|
+
ZDUyYmUxYjgyYmU2ZWFmOTg5NmMyZTRkZjUxMTRkN2NiZjlhMDg=
|
data/Gemfile.lock
CHANGED
@@ -5,6 +5,7 @@ unless defined?(Sprockets::LOCALIZABLE_ASSETS_REGEX)
|
|
5
5
|
LOCALIZABLE_ASSETS_EXT = %w( js css )
|
6
6
|
LOCALIZABLE_ASSETS_REGEX = Regexp.new("\\.(?:#{ LOCALIZABLE_ASSETS_EXT * '|' })")
|
7
7
|
LOCALIZABLE_COMPILABLE_ASSETS_REGEX = Regexp.new("\\.(?:#{ LOCALIZABLE_ASSETS_EXT * '|' })\\..+$")
|
8
|
+
GLOBAL_ASSET_REGEX = /^(https?)?:\/\//
|
8
9
|
|
9
10
|
module Helpers
|
10
11
|
module RailsHelper
|
@@ -117,7 +118,7 @@ unless defined?(Sprockets::LOCALIZABLE_ASSETS_REGEX)
|
|
117
118
|
alias_method :compute_public_path_without_locale, :compute_public_path
|
118
119
|
|
119
120
|
def compute_public_path(source, dir, options = nil)
|
120
|
-
source = prepend_locale(source) if file_localizable?(source, options) && !file_already_localized?(source)
|
121
|
+
source = prepend_locale(source) if local_resource?(source) && file_localizable?(source, options) && !file_already_localized?(source)
|
121
122
|
compute_public_path_without_locale(source, dir, options)
|
122
123
|
end
|
123
124
|
|
@@ -127,6 +128,10 @@ unless defined?(Sprockets::LOCALIZABLE_ASSETS_REGEX)
|
|
127
128
|
"#{ I18n.locale }/#{ source }"
|
128
129
|
end
|
129
130
|
|
131
|
+
def local_resource?(source)
|
132
|
+
source !~ Sprockets::GLOBAL_ASSET_REGEX
|
133
|
+
end
|
134
|
+
|
130
135
|
def file_localizable?(source, options)
|
131
136
|
source =~ Sprockets::LOCALIZABLE_ASSETS_REGEX || Sprockets::LOCALIZABLE_ASSETS_EXT.include?(options.try(:[], :ext))
|
132
137
|
end
|
data/lib/i18n/assets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Gladkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|