ajaxlibs 0.1.2 → 0.1.3
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.
- data/VERSION +1 -1
- data/lib/ajaxlibs/exceptions.rb +4 -0
- data/lib/ajaxlibs/includes_helper.rb +2 -4
- data/lib/ajaxlibs/libraries/jqueryui.rb +2 -1
- data/lib/ajaxlibs/libraries/jrails.rb +2 -0
- data/lib/ajaxlibs/library.rb +1 -1
- data/lib/ajaxlibs/versions_tools.rb +7 -6
- data/public/jqueryui/1.8.0/jquery-ui.js +10921 -0
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/ajaxlibs/exceptions.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
# Global Ajaxlibs exception
|
1
2
|
class Ajaxlibs::Exception < StandardError
|
2
3
|
end
|
3
4
|
|
5
|
+
# LibraryNotFound exception, raised if library was not found
|
4
6
|
class Ajaxlibs::Exception::LibraryNotFound < Ajaxlibs::Exception
|
7
|
+
|
5
8
|
end
|
6
9
|
|
10
|
+
# VersionNotFound exception, raised if particular version of a library was not found
|
7
11
|
class Ajaxlibs::Exception::VersionNotFound < Ajaxlibs::Exception
|
8
12
|
end
|
@@ -60,10 +60,8 @@ module Ajaxlibs::IncludesHelper
|
|
60
60
|
|
61
61
|
result = []
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
result << javascript_include_library(required_library, :version => required_version)
|
66
|
-
end
|
63
|
+
ajaxlib.requires.each do |required_library, required_version|
|
64
|
+
result << javascript_include_library(required_library, :version => required_version)
|
67
65
|
end
|
68
66
|
|
69
67
|
result << ajaxlib
|
data/lib/ajaxlibs/library.rb
CHANGED
@@ -41,7 +41,7 @@ class Ajaxlibs::Library
|
|
41
41
|
|
42
42
|
# Returns requirements for a library (for example, prototype for scriptaculous)
|
43
43
|
def requires
|
44
|
-
self.class::Requirements[@version] || self.class::Requirements[:all]
|
44
|
+
self.class::Requirements[@version] || self.class::Requirements[:all] || {}
|
45
45
|
end
|
46
46
|
|
47
47
|
# Library name based on class name
|
@@ -4,12 +4,13 @@ module Ajaxlibs::VersionsTools
|
|
4
4
|
# * 1 if a > b
|
5
5
|
# * 0 if a == b
|
6
6
|
# * -1 if a < b
|
7
|
-
def self.compare(
|
8
|
-
return 0 if
|
9
|
-
splitted_a, splitted_b =
|
10
|
-
splitted_a.each_with_index do |
|
11
|
-
|
12
|
-
|
7
|
+
def self.compare(version_a, version_b)
|
8
|
+
return 0 if version_a == version_b
|
9
|
+
splitted_a, splitted_b = version_a.split('.'), version_b.split('.')
|
10
|
+
splitted_a.each_with_index do |a_node, idx|
|
11
|
+
b_node = splitted_b[idx]
|
12
|
+
break if a_node < b_node
|
13
|
+
return 1 if a_node > b_node
|
13
14
|
end
|
14
15
|
return -1
|
15
16
|
end
|