artwork 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/artwork/version.rb +1 -1
- data/lib/artwork/view.rb +12 -4
- metadata +3 -3
data/lib/artwork/version.rb
CHANGED
data/lib/artwork/view.rb
CHANGED
@@ -2,10 +2,7 @@ module Artwork
|
|
2
2
|
module View
|
3
3
|
def activate_resolution_independence
|
4
4
|
content_tag :script do
|
5
|
-
Thread.current[:artwork_script] ||=
|
6
|
-
artwork_script_path = Artwork.root_path + '/assets/javascripts/artwork.js'
|
7
|
-
Uglifier.compile(File.read(artwork_script_path)).html_safe
|
8
|
-
end
|
5
|
+
Thread.current[:artwork_script] ||= compile_artwork_script
|
9
6
|
end
|
10
7
|
end
|
11
8
|
|
@@ -43,5 +40,16 @@ module Artwork
|
|
43
40
|
record.name
|
44
41
|
end
|
45
42
|
end
|
43
|
+
|
44
|
+
def compile_artwork_script
|
45
|
+
artwork_script_path = Artwork.root_path + '/assets/javascripts/artwork.js'
|
46
|
+
compiled_script = Uglifier.compile(File.read(artwork_script_path))
|
47
|
+
|
48
|
+
if compiled_script.respond_to?(:html_safe)
|
49
|
+
compiled_script.html_safe
|
50
|
+
else
|
51
|
+
compiled_script
|
52
|
+
end
|
53
|
+
end
|
46
54
|
end
|
47
55
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dimitar Dimitrov
|