ajaxlibs 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -70,6 +70,12 @@ will produce :
70
70
  <script src="/javascripts/ajaxlibs/prototype/1.6.1.0/prototype.js?1267013480" type="text/javascript"></script>
71
71
  <script src="/javascripts/ajaxlibs/scriptaculous/1.8.3/scriptaculous.js?1267013481" type="text/javascript"></script>
72
72
 
73
+ === define alternate production environments
74
+
75
+ You can define alternate production environments to use CDNs under those environments :
76
+
77
+ Ajaxlibs::ProductionEnvironments << 'another_production_environment'
78
+
73
79
  == Installation
74
80
 
75
81
  First, install gem on your system and servers. You can also specify it as a dependency on your rails enviroment :
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -1,3 +1,3 @@
1
1
  module Ajaxlibs
2
- GoogleJSAPI = "http://www.google.com/jsapi"
2
+ ProductionEnvironments = ['production']
3
3
  end
@@ -50,7 +50,7 @@ module Ajaxlibs::IncludesHelper
50
50
  library = library.to_sym
51
51
  version = options.delete(:version)
52
52
  local = options.delete(:local)
53
- options[:source] ||= (local === true or (local.nil? and RAILS_ENV != 'production')) ? :local : :remote
53
+ options[:source] ||= (local === true or (local.nil? and not Ajaxlibs::ProductionEnvironments.include?(RAILS_ENV))) ? :local : :remote
54
54
  ajaxlib = Ajaxlibs::Library.by_name(library, options.merge({:version => version}))
55
55
 
56
56
  @included_javascript_libraries ||= []