aaronchi-jrails 0.5.0 → 0.5.1
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/bin/jrails +2 -8
- data/lib/jrails.rb +1 -1
- data/rails/init.rb +2 -6
- data/tasks/jrails.rake +13 -16
- metadata +2 -2
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:
|
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:
|
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
|
|
data/lib/jrails.rb
CHANGED
@@ -33,7 +33,7 @@ module ActionView
|
|
33
33
|
USE_PROTECTION = const_defined?(:DISABLE_JQUERY_FORGERY_PROTECTION) ? !DISABLE_JQUERY_FORGERY_PROTECTION : true
|
34
34
|
|
35
35
|
unless const_defined? :JQUERY_VAR
|
36
|
-
JQUERY_VAR = '
|
36
|
+
JQUERY_VAR = 'jQuery'
|
37
37
|
end
|
38
38
|
|
39
39
|
unless const_defined? :JQCALLBACKS
|
data/rails/init.rb
CHANGED
@@ -1,18 +1,14 @@
|
|
1
|
-
# ====
|
2
1
|
# The following options can be changed by creating an initializer in config/initializers/jrails.rb
|
3
|
-
|
4
|
-
# ActionView::Helpers::PrototypeHelper::JQUERY_VAR
|
2
|
+
|
5
3
|
# jRails uses jQuery.noConflict() by default
|
6
|
-
# to use the
|
4
|
+
# to use the default jQuery varibale, use:
|
7
5
|
# ActionView::Helpers::PrototypeHelper::JQUERY_VAR = '$'
|
8
|
-
ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery'
|
9
6
|
|
10
7
|
# ActionView::Helpers::PrototypeHelper:: DISABLE_JQUERY_FORGERY_PROTECTION
|
11
8
|
# Set this to disable forgery protection in ajax calls
|
12
9
|
# This is handy if you want to use caching with ajax by injecting the forgery token via another means
|
13
10
|
# for an example, see http://henrik.nyh.se/2008/05/rails-authenticity-token-with-jquery
|
14
11
|
# ActionView::Helpers::PrototypeHelper::DISABLE_JQUERY_FORGERY_PROTECTION = true
|
15
|
-
# ====
|
16
12
|
|
17
13
|
ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery','jquery-ui','jrails']
|
18
14
|
ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
|
data/tasks/jrails.rake
CHANGED
@@ -1,28 +1,25 @@
|
|
1
1
|
namespace :jrails do
|
2
|
-
|
2
|
+
|
3
|
+
namespace :js do
|
3
4
|
desc "Copies the jQuery and jRails javascripts to public/javascripts"
|
4
|
-
task :
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aaronchi-jrails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Eisenberger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-08-
|
13
|
+
date: 2009-08-07 00:00:00 -07:00
|
14
14
|
default_executable: jrails
|
15
15
|
dependencies: []
|
16
16
|
|