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 CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -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
- if ajaxlib.requires
64
- ajaxlib.requires.each do |required_library, required_version|
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
@@ -4,7 +4,8 @@ class Ajaxlibs::Library::Jqueryui < Ajaxlibs::Library
4
4
  '1.6' ,
5
5
  '1.7.0',
6
6
  '1.7.1',
7
- '1.7.2']
7
+ '1.7.2',
8
+ '1.8.0']
8
9
 
9
10
  Requirements = {:all => {:jquery => nil}}
10
11
 
@@ -1,3 +1,5 @@
1
+ # JRails library, local support only.
2
+ # This is only the javascript support of JRails, you must install JRails plugin to have a full support.
1
3
  class Ajaxlibs::Library::Jrails < Ajaxlibs::Library
2
4
  Versions = ['0.5.0']
3
5
 
@@ -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(a, b)
8
- return 0 if a == b
9
- splitted_a, splitted_b = a.split('.'), b.split('.')
10
- splitted_a.each_with_index do |node, i|
11
- break if node < splitted_b[i]
12
- return 1 if node > splitted_b[i]
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