webpulser-jrails 0.4.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -3,7 +3,7 @@
3
3
  * Add the document.ready syntax on javascript_tag helpers to work
4
4
  when javascripts (jquery-ui jrails) are include a bottom
5
5
 
6
- 0.4.1 (31 July 2009)
6
+ 0.5.0 (31 July 2009)
7
7
  * Gemification
8
8
  * Support for Ruby 1.9.X
9
9
  * Updated to jQuery 1.3.2
@@ -13,15 +13,12 @@ tasks from gem plugins
13
13
  * Changed default to use jQuery compatibility name (not $)
14
14
  * Created a scrub task that will remove the prototype / script.aculo.us
15
15
  javascript files
16
-
17
- SVN
18
16
  * better approximate scriptaculous effect names
19
17
  * add support for page[:element_id].visual_effect(:effect) as well as page.visual_effect(:effect, :element_id)
20
18
  * added a reset form function to jrails.js (stolen from jquery form)
21
19
  * can now use jquery selectors in all functions
22
20
  * added javascript_function helper to render inline rjs helpers
23
21
  * better support for sortable_element
24
- * updated to jquery-ui 1.5.1
25
22
 
26
23
  0.4.0 (16 June 2008)
27
24
  * updated to jquery-ui 1.5 & merged js into single file
data/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2008 Aaron Eisenberger
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ = jRails
2
+
3
+ jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers.
4
+
5
+ == Resources
6
+
7
+ Install
8
+
9
+ * .script/plugin install git://github.com/aaronchi/jrails.git
10
+
11
+ Project Site
12
+
13
+ * http://code.google.com/p/ennerchi
14
+
15
+ Web Site
16
+
17
+ * http://www.ennerchi.com/projects/jrails
18
+
19
+ Group Site
20
+
21
+ * http://groups.google.com/group/jrails
data/bin/jrails CHANGED
@@ -14,22 +14,16 @@ task :help do
14
14
  rakeapp.display_tasks_and_comments
15
15
  end
16
16
 
17
- desc "Copies the jQuery and jRails javascripts to public/javascripts"
18
- task :update do
19
- Rake::Task['jrails:update:javascripts'].invoke
20
- end
21
-
22
17
  desc 'Installs the jQuery and jRails javascripts to public/javascripts'
23
18
  task :install do
24
- Rake::Task['jrails:update:javascripts'].invoke
19
+ Rake::Task['jrails:js:install'].invoke
25
20
  end
26
21
 
27
22
  desc 'Remove the prototype / script.aculo.us javascript files'
28
23
  task :scrub do
29
- Rake::Task['jrails:scrub'].invoke
24
+ Rake::Task['jrails:js:scrub'].invoke
30
25
  end
31
26
 
32
-
33
27
  rakeapp.init("jrails")
34
28
  task :default => [:help]
35
29
 
@@ -0,0 +1,9 @@
1
+ # Install hook code here
2
+ puts "Copying files..."
3
+ dir = "javascripts"
4
+ ["jquery-ui.js", "jquery.js", "jrails.js"].each do |js_file|
5
+ dest_file = File.join(RAILS_ROOT, "public", dir, js_file)
6
+ src_file = File.join(File.dirname(__FILE__) , dir, js_file)
7
+ FileUtils.cp_r(src_file, dest_file)
8
+ end
9
+ puts "Files copied - Installation complete!"
@@ -1 +1 @@
1
- (function($){$.ajaxSettings.accepts._default = "text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&field.type=="text"||field.type=="textarea"){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||self.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o){e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"()")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);
1
+ (function($){$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&(field.type=="text"||field.type=="textarea"||field.type=="password")){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){var observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||el.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o,options){if(options){speed=options.duration*1000}else{speed=null}e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);
@@ -57,7 +57,7 @@
57
57
  fieldEvent: function(el, obs) {
58
58
  var field = el[0] || el, e = 'change';
59
59
  if (field.type == 'radio' || field.type == 'checkbox') e = 'click';
60
- else if (obs && field.type == 'text' || field.type == 'textarea') e = 'keyup';
60
+ else if (obs && (field.type == 'text' || field.type == 'textarea' || field.type == 'password')) e = 'keyup';
61
61
  return e;
62
62
  }
63
63
  });
@@ -117,9 +117,14 @@
117
117
 
118
118
  (function($) {
119
119
  $.fn.extend({
120
- visualEffect : function(o) {
120
+ visualEffect : function(o, options) {
121
+ if (options) {
122
+ speed = options.duration * 1000;
123
+ } else {
124
+ speed = null;
125
+ }
121
126
  e = o.replace(/\_(.)/g, function(m, l){return l.toUpperCase()});
122
- return eval('$(this).'+e+'()');
127
+ return eval('$(this).'+e+'('+ speed + ')');
123
128
  },
124
129
  appear : function(speed, callback) {
125
130
  return this.fadeIn(speed, callback);
@@ -0,0 +1,78 @@
1
+ #
2
+ # jQuery Selector Assertions (modifications to the prototype/scriptaculous assertions)
3
+ #
4
+ # From http://pastie.org/303776
5
+ #
6
+ # 1. Make sure to use '#' prefix when referring to element IDs in assert_select_rjs(),
7
+ # like this:
8
+ # assert_select_rjs :replace_html, '#someid'
9
+ # instead of prototype convention:
10
+ # assert_select_rjs :replace_html, 'someid'
11
+ #
12
+ # We monkey-patch some RJS-matching constants for assert_select_rjs to work
13
+ # with jQuery-based code as opposed to Prototype's:
14
+ #
15
+ module ActionController
16
+ module Assertions
17
+ module SelectorAssertions
18
+ silence_warnings do
19
+ RJS_PATTERN_HTML = "\"((\\\\\"|[^\"])*)\""
20
+ # RJS_ANY_ID = "\"([^\"])*\""
21
+ # better match with single or double quoted ids
22
+ RJS_ANY_ID = "[\"']([^\"])*[\"']"
23
+
24
+ RJS_STATEMENTS = {
25
+ :chained_replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
26
+ :chained_replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.updateWith\\(#{RJS_PATTERN_HTML}\\)",
27
+ :replace_html => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.html\\(#{RJS_PATTERN_HTML}\\)",
28
+ :replace => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.replaceWith\\(#{RJS_PATTERN_HTML}\\)",
29
+ :insert_top => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.prepend\\(#{RJS_PATTERN_HTML}\\)",
30
+ :insert_bottom => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.append\\(#{RJS_PATTERN_HTML}\\)",
31
+ :effect => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\(",
32
+ :highlight => "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.effect\\('highlight'"
33
+
34
+ =begin TODO:
35
+
36
+ I've never used the chained_* so I don't know if they work.
37
+
38
+ I couldn't seem to get assert_select_rjs to actually match the single quoted ids
39
+ which are created by some of the effects like ...
40
+ ... jQuery('#item_1559').effect('highlight',{},1000);
41
+ so I modified jrails/lib/jrails.rb line 337
42
+ ... javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{mode || 'effect'}('#{name}'"
43
+ to
44
+ ... javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{mode || 'effect'}('#{name}'"
45
+ so it writes double quotes like most of the others. This change should probably be
46
+ done to the others, but as I don't use them so haven't tested them.
47
+
48
+ My other option seemed to require modifying rails' selector_assertions.rb line 427
49
+ ... id ? statement.gsub(RJS_ANY_ID, "\"#{id}\"") : statement
50
+ which forces the expectation that the id is double quoted. If I changed it to
51
+ ... statement.gsub(RJS_ANY_ID, "[\"']{1}#{id}[\"']{1}")
52
+ I believe that it would work as the logic seemed to work in some testing.
53
+ I have not actually tried to modify rails, as this file doesn't seem to
54
+ actually be in the git repository.
55
+
56
+
57
+ jrails now uses a nonconflict option so $ is jQuery. I put both in the pattern in case it gets changed.
58
+
59
+ :insert_after => "",
60
+ :insert_before => "",
61
+ =end
62
+
63
+ }
64
+
65
+ [:remove, :show, :hide, :toggle, :reset ].each do |action|
66
+ RJS_STATEMENTS[action] = "\(jQuery|$\)\\(#{RJS_ANY_ID}\\)\\.#{action}\\(\\)"
67
+ end
68
+
69
+ # TODO:
70
+ #RJS_STATEMENTS[:insert_html] = "Element.insert\\(#{RJS_ANY_ID}, \\{ (#{RJS_INSERTIONS.join('|')}):
71
+ #{RJS_PATTERN_HTML} \\}\\)"
72
+
73
+ RJS_STATEMENTS[:any] = Regexp.new("(#{RJS_STATEMENTS.values.join('|')})")
74
+ RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/
75
+ end
76
+ end
77
+ end
78
+ end
@@ -30,8 +30,10 @@ module ActionView
30
30
 
31
31
  module PrototypeHelper
32
32
 
33
+ USE_PROTECTION = const_defined?(:DISABLE_JQUERY_FORGERY_PROTECTION) ? !DISABLE_JQUERY_FORGERY_PROTECTION : true
34
+
33
35
  unless const_defined? :JQUERY_VAR
34
- JQUERY_VAR = '$'
36
+ JQUERY_VAR = 'jQuery'
35
37
  end
36
38
 
37
39
  unless const_defined? :JQCALLBACKS
@@ -148,7 +150,7 @@ module ActionView
148
150
  end
149
151
  end
150
152
 
151
- if respond_to?('protect_against_forgery?') && protect_against_forgery?
153
+ if USE_PROTECTION && respond_to?('protect_against_forgery?') && protect_against_forgery?
152
154
  if js_options['data']
153
155
  js_options['data'] << " + '&"
154
156
  else
@@ -197,10 +199,11 @@ module ActionView
197
199
  def build_callbacks(options)
198
200
  callbacks = {}
199
201
  options[:beforeSend] = '';
200
- [:uninitialized,:loading,:loaded].each do |key|
202
+ [:uninitialized,:loading].each do |key|
201
203
  options[:beforeSend] << (options[key].last == ';' ? options.delete(key) : options.delete(key) << ';') if options[key]
202
204
  end
203
205
  options.delete(:beforeSend) if options[:beforeSend].blank?
206
+ options[:complete] = options.delete(:loaded) if options[:loaded]
204
207
  options[:error] = options.delete(:failure) if options[:failure]
205
208
  if options[:update]
206
209
  if options[:update].is_a?(Hash)
@@ -315,7 +318,7 @@ module ActionView
315
318
  js_options = js_options.merge(effect[:options]) if effect[:options]
316
319
  end
317
320
 
318
- [:color, :direction].each do |option|
321
+ [:color, :direction, :startcolor, :endcolor].each do |option|
319
322
  js_options[option] = "'#{js_options[option]}'" if js_options[option]
320
323
  end
321
324
 
@@ -327,11 +330,13 @@ module ActionView
327
330
  end
328
331
 
329
332
  if ['fadeIn','fadeOut','fadeToggle'].include?(name)
330
- javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{name}("
333
+ # 090905 - Jake - changed ' to \" so it passes assert_select_rjs with an id
334
+ javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{name}("
331
335
  javascript << "#{speed}" unless speed.nil?
332
336
  javascript << ");"
333
337
  else
334
- javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{mode || 'effect'}('#{name}'"
338
+ # 090905 - Jake - changed ' to \" so it passes "assert_select_rjs :effect, ID"
339
+ javascript = "#{JQUERY_VAR}(\"#{jquery_id(element_id)}\").#{mode || 'effect'}('#{name}'"
335
340
  javascript << ",#{options_for_javascript(js_options)}" unless speed.nil? && js_options.empty?
336
341
  javascript << ",#{speed}" unless speed.nil?
337
342
  javascript << ");"
@@ -352,9 +357,9 @@ module ActionView
352
357
  options[:dropOnEmpty] = false unless options[:dropOnEmpty]
353
358
  options[:helper] = "'clone'" if options[:ghosting] == true
354
359
  options[:axis] = case options.delete(:constraint)
355
- when "vertical"
360
+ when "vertical", :vertical
356
361
  "y"
357
- when "horizontal"
362
+ when "horizontal", :horizontal
358
363
  "x"
359
364
  when false
360
365
  nil
@@ -366,7 +371,13 @@ module ActionView
366
371
  options.delete(:ghosting)
367
372
 
368
373
  if options[:onUpdate] || options[:url]
369
- options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]'})"
374
+ if options[:format]
375
+ options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]', expression:#{options[:format]}})"
376
+ options.delete(:format)
377
+ else
378
+ options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]'})"
379
+ end
380
+
370
381
  options[:onUpdate] ||= "function(){" + remote_function(options) + "}"
371
382
  end
372
383
 
@@ -1,9 +1,16 @@
1
- # I made this the default, because it adds very little to the
2
- # the size of the generated code and increases compatibility
3
- # If it is a real problem redefine it in an initializer
4
- ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery'
1
+ # The following options can be changed by creating an initializer in config/initializers/jrails.rb
2
+
3
+ # jRails uses jQuery.noConflict() by default
4
+ # to use the default jQuery varibale, use:
5
+ # ActionView::Helpers::PrototypeHelper::JQUERY_VAR = '$'
6
+
7
+ # ActionView::Helpers::PrototypeHelper:: DISABLE_JQUERY_FORGERY_PROTECTION
8
+ # Set this to disable forgery protection in ajax calls
9
+ # This is handy if you want to use caching with ajax by injecting the forgery token via another means
10
+ # for an example, see http://henrik.nyh.se/2008/05/rails-authenticity-token-with-jquery
11
+ # ActionView::Helpers::PrototypeHelper::DISABLE_JQUERY_FORGERY_PROTECTION = true
5
12
 
6
13
  ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery','jquery-ui','jrails']
7
14
  ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
8
15
  require 'jrails'
9
-
16
+ require 'jquery_selector_assertions' if RAILS_ENV == 'test'
@@ -1,28 +1,25 @@
1
1
  namespace :jrails do
2
- namespace :update do
2
+
3
+ namespace :js do
3
4
  desc "Copies the jQuery and jRails javascripts to public/javascripts"
4
- task :javascripts do
5
+ task :install do
5
6
  puts "Copying files..."
6
7
  project_dir = RAILS_ROOT + '/public/javascripts/'
7
8
  scripts = Dir[File.join(File.dirname(__FILE__), '..', '/javascripts/', '*.js')]
8
9
  FileUtils.cp(scripts, project_dir)
9
10
  puts "files copied successfully."
10
11
  end
11
- end
12
-
13
- namespace :install do
14
- desc "Installs the jQuery and jRails javascripts to public/javascripts"
15
- task :javascripts do
16
- Rake::Task['jrails:update:javascripts'].invoke
17
- end
18
- end
19
12
 
20
- desc 'Remove the prototype / script.aculo.us javascript files'
21
- task :scrub do
22
- files = %W[controls.js dragdrop.js effects.js prototype.js]
23
- project_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
24
- files.each do |fname|
25
- FileUtils.rm File.join(project_dir, fname)
13
+ desc 'Remove the prototype / script.aculo.us javascript files'
14
+ task :scrub do
15
+ puts "Removing files..."
16
+ files = %W[controls.js dragdrop.js effects.js prototype.js]
17
+ project_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
18
+ files.each do |fname|
19
+ FileUtils.rm(File.join(project_dir, fname)) if File.exists?(File.join(project_dir, fname))
20
+ end
21
+ puts "files removed successfully."
26
22
  end
27
23
  end
24
+
28
25
  end
metadata CHANGED
@@ -1,72 +1,79 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpulser-jrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
5
10
  platform: ruby
6
11
  authors:
7
- - aaronchi
12
+ - Aaron Eisenberger
8
13
  - Patrick Hurley
9
14
  - Cyril LEPAGNOT
10
15
  autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
18
 
14
- date: 2009-08-04 00:00:00 -07:00
15
- default_executable:
19
+ date: 2009-10-20 00:00:00 +02:00
20
+ default_executable: jrails
16
21
  dependencies: []
17
22
 
18
- description: jRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.
19
- email: cyril.lepagnot@webpulser.com
23
+ description: Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.
24
+ email: aaronchi@gmail.com
20
25
  executables:
21
26
  - jrails
22
27
  extensions: []
23
28
 
24
- extra_rdoc_files: []
25
-
26
- files:
29
+ extra_rdoc_files:
27
30
  - CHANGELOG
28
- - Manifest.txt
29
- - README
30
- - init.rb
31
- - bin
31
+ - LICENSE
32
+ - README.rdoc
33
+ files:
32
34
  - bin/jrails
33
- - javascripts
35
+ - init.rb
36
+ - install.rb
34
37
  - javascripts/jquery-ui.js
35
38
  - javascripts/jquery.js
36
39
  - javascripts/jrails.js
37
- - javascripts/sources
38
40
  - javascripts/sources/jrails.js
39
- - lib
41
+ - lib/jquery_selector_assertions.rb
40
42
  - lib/jrails.rb
41
- - tasks
42
- - tasks/jrails.rake
43
43
  - rails/init.rb
44
- has_rdoc: false
44
+ - tasks/jrails.rake
45
+ - CHANGELOG
46
+ - LICENSE
47
+ - README.rdoc
48
+ has_rdoc: true
45
49
  homepage: http://ennerchi.com/projects/jrails
46
- licenses:
47
- post_install_message:
48
- rdoc_options: []
50
+ licenses: []
49
51
 
52
+ post_install_message:
53
+ rdoc_options:
54
+ - --charset=UTF-8
50
55
  require_paths:
51
56
  - lib
52
57
  required_ruby_version: !ruby/object:Gem::Requirement
53
58
  requirements:
54
59
  - - ">="
55
60
  - !ruby/object:Gem::Version
61
+ segments:
62
+ - 0
56
63
  version: "0"
57
- version:
58
64
  required_rubygems_version: !ruby/object:Gem::Requirement
59
65
  requirements:
60
66
  - - ">="
61
67
  - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
62
70
  version: "0"
63
- version:
64
71
  requirements: []
65
72
 
66
- rubyforge_project:
67
- rubygems_version: 1.3.5
73
+ rubyforge_project: jrails
74
+ rubygems_version: 1.3.6
68
75
  signing_key:
69
- specification_version: 2
76
+ specification_version: 3
70
77
  summary: jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers.
71
78
  test_files: []
72
79
 
@@ -1,17 +0,0 @@
1
- CHANGELOG
2
- Manifest.txt
3
- README
4
- init.rb
5
- bin
6
- bin/jrails
7
- javascripts
8
- javascripts/jquery-ui.js
9
- javascripts/jquery.js
10
- javascripts/jrails.js
11
- javascripts/sources
12
- javascripts/sources/jrails.js
13
- lib
14
- lib/jrails.rb
15
- tasks/
16
- tasks/jrails.rake
17
- rails/init.rb
data/README DELETED
@@ -1,26 +0,0 @@
1
- = jRails
2
-
3
- jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers.
4
- I (Patrick), modified the plugin to work as a gem and to support Ruby 1.9.X. All bugs
5
- are probably my fault, thanks to the original author.
6
-
7
- == Resources
8
-
9
- Install
10
-
11
- * in your project directory :
12
- * jrails install
13
- * and in environement.rb
14
- * config.gem 'webpulser-jrails', :source => 'http://gems.github.com', :lib => 'jrails'
15
-
16
- Project Site
17
-
18
- * http://code.google.com/p/ennerchi/
19
-
20
- Web Site
21
-
22
- * http://www.ennerchi.com/projects/jrails
23
-
24
- Group Site
25
-
26
- * http://groups.google.com/group/jrails