jquery-ui-rails 0.2.1 → 0.2.2
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.
Potentially problematic release.
This version of jquery-ui-rails might be problematic. Click here for more details.
- data/History.md +4 -0
- data/README.md +4 -0
- data/Rakefile +22 -10
- data/lib/jquery/ui/rails/version.rb +1 -1
- metadata +8 -8
data/History.md
CHANGED
data/README.md
CHANGED
@@ -242,6 +242,10 @@ Now point your browser at [http://localhost:3000/](http://localhost:3000/).
|
|
242
242
|
from the jQuery UI sources, we can package all the other themes in the
|
243
243
|
[ThemeRoller](http://jqueryui.com/themeroller/) gallery.
|
244
244
|
|
245
|
+
Perhaps we can also add helper tasks to help developers generate assets for
|
246
|
+
their own custom themes or for third-party themes (like
|
247
|
+
[Selene](http://gravityonmars.github.com/Selene/)).
|
248
|
+
|
245
249
|
If you still want a different theme right now, you could probably download
|
246
250
|
a custom theme and require the theme CSS *after* requiring any other jQuery
|
247
251
|
UI CSS files you need, making sure to serve up the theme images correctly.
|
data/Rakefile
CHANGED
@@ -26,6 +26,13 @@ def get_js_dependencies(basename)
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def protect_copyright_notice(source_code)
|
30
|
+
# YUI does not minify comments starting with "/*!"
|
31
|
+
# The i18n files start with non-copyright comments, so we require a newline
|
32
|
+
# to avoid protecting those
|
33
|
+
source_code.gsub!(/\A\s*\/\*\r?\n/, "/*!\n")
|
34
|
+
end
|
35
|
+
|
29
36
|
desc "Remove the vendor directory"
|
30
37
|
task :clean do
|
31
38
|
FileUtils.rm_rf 'vendor'
|
@@ -44,7 +51,9 @@ task :javascripts do
|
|
44
51
|
out.write("//= require #{mod}\n")
|
45
52
|
end
|
46
53
|
out.write("\n") unless dep_modules.empty?
|
47
|
-
source_code = File.read(path)
|
54
|
+
source_code = File.read(path)
|
55
|
+
source_code.gsub!('@VERSION', VERSION)
|
56
|
+
protect_copyright_notice(source_code)
|
48
57
|
out.write(source_code)
|
49
58
|
end
|
50
59
|
end
|
@@ -62,7 +71,8 @@ task :stylesheets do
|
|
62
71
|
Dir.glob("jquery-ui/themes/base/*.css").each do |path|
|
63
72
|
basename = File.basename(path)
|
64
73
|
source_code = File.read(path)
|
65
|
-
|
74
|
+
source_code.gsub!('@VERSION', VERSION)
|
75
|
+
protect_copyright_notice(source_code)
|
66
76
|
extra_dependencies = []
|
67
77
|
extra_dependencies << 'jquery.ui.core' unless basename =~ /\.(all|base|core)\./
|
68
78
|
# Is "theme" listed among the dependencies for the matching JS file?
|
@@ -78,14 +88,16 @@ task :stylesheets do
|
|
78
88
|
# Add after first comment block
|
79
89
|
source_code = source_code.sub(/\A((.*?\*\/\n)?)/m, "\\1/*\n *= require #{dep}\n */\n")
|
80
90
|
end
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
91
|
+
# Use "require" instead of @import
|
92
|
+
source_code.gsub!(/^@import (.*)$/) { |s|
|
93
|
+
m = s.match(/^@import (url\()?"(?<module>[-_.a-zA-Z]+)\.css"\)?;/) \
|
94
|
+
or fail "Cannot parse import: #{s}"
|
95
|
+
"/*\n *= require #{m['module']}\n */"
|
96
|
+
}
|
97
|
+
# Be cute: collapse multiple require comment blocks into one
|
98
|
+
source_code.gsub!(/^( \*= require .*)\n \*\/(\n+)\/\*\n(?= \*= require )/, '\1\2')
|
99
|
+
# Replace hard-coded image URLs with asset path helpers
|
100
|
+
source_code.gsub!(/url\(images\/([-_.a-zA-Z0-9]+)\)/, 'url(<%= image_path("jquery-ui/\1") %>)')
|
89
101
|
File.open("#{target_dir}/#{basename}.erb", "w") do |out|
|
90
102
|
out.write(source_code)
|
91
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-ui-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &9365400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *9365400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jquery-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &9365020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *9365020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: execjs
|
38
|
-
requirement: &
|
38
|
+
requirement: &9364220 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '1.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *9364220
|
47
47
|
description: jQuery UI's JavaScript, CSS, and image files packaged for the Rails 3.1+
|
48
48
|
asset pipeline
|
49
49
|
email:
|