jquery-rails 3.1.4 → 4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +32 -0
- data/CHANGELOG.md +87 -0
- data/CONTRIBUTING.md +103 -7
- data/Gemfile +18 -0
- data/{LICENSE → MIT-LICENSE} +2 -2
- data/README.md +34 -39
- data/Rakefile +32 -21
- data/VERSIONS.md +20 -1
- data/jquery-rails.gemspec +7 -5
- data/lib/jquery/assert_select.rb +141 -89
- data/lib/jquery/rails/version.rb +5 -3
- data/lib/jquery/rails.rb +1 -3
- data/test/assert_select_jquery_test.rb +91 -0
- data/test/test_helper.rb +6 -0
- data/vendor/assets/javascripts/jquery.js +2706 -2006
- data/vendor/assets/javascripts/jquery.min.js +5 -5
- data/vendor/assets/javascripts/jquery.min.map +1 -1
- data/vendor/assets/javascripts/jquery2.js +9814 -0
- data/vendor/assets/javascripts/jquery2.min.js +4 -0
- data/vendor/assets/javascripts/jquery2.min.map +1 -0
- data/vendor/assets/javascripts/jquery3.js +10909 -0
- data/vendor/assets/javascripts/jquery3.min.js +2 -0
- data/vendor/assets/javascripts/jquery3.min.map +1 -0
- data/vendor/assets/javascripts/jquery_ujs.js +173 -77
- metadata +42 -23
- data/lib/generators/jquery/install/install_generator.rb +0 -50
- data/lib/jquery/rails/railtie.rb +0 -18
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'rails'
|
2
|
-
|
3
|
-
# Supply generator for Rails 3.0.x or if asset pipeline is not enabled
|
4
|
-
if ::Rails.version < "3.1" || !::Rails.application.config.assets.enabled
|
5
|
-
module Jquery
|
6
|
-
module Generators
|
7
|
-
class InstallGenerator < ::Rails::Generators::Base
|
8
|
-
|
9
|
-
desc "This generator installs jQuery #{Jquery::Rails::JQUERY_VERSION} and jQuery-ujs"
|
10
|
-
source_root File.expand_path('../../../../../vendor/assets/javascripts', __FILE__)
|
11
|
-
|
12
|
-
def remove_prototype
|
13
|
-
Rails::PROTOTYPE_JS.each do |name|
|
14
|
-
remove_file "public/javascripts/#{name}.js"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def copy_jquery
|
19
|
-
say_status("copying", "jQuery (#{Jquery::Rails::JQUERY_VERSION})", :green)
|
20
|
-
copy_file "jquery.js", "public/javascripts/jquery.js"
|
21
|
-
copy_file "jquery.min.js", "public/javascripts/jquery.min.js"
|
22
|
-
end
|
23
|
-
|
24
|
-
def copy_ujs_driver
|
25
|
-
say_status("copying", "jQuery UJS adapter (#{Jquery::Rails::JQUERY_UJS_VERSION[0..5]})", :green)
|
26
|
-
remove_file "public/javascripts/rails.js"
|
27
|
-
copy_file "jquery_ujs.js", "public/javascripts/jquery_ujs.js"
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
else
|
34
|
-
module Jquery
|
35
|
-
module Generators
|
36
|
-
class InstallGenerator < ::Rails::Generators::Base
|
37
|
-
desc "Just show instructions so people will know what to do when mistakenly using generator for Rails 3.1 apps"
|
38
|
-
|
39
|
-
def do_nothing
|
40
|
-
say_status("deprecated", "You are using Rails 3.1 with the asset pipeline enabled, so this generator is not needed.")
|
41
|
-
say_status("", "The necessary files are already in your asset pipeline.")
|
42
|
-
say_status("", "Just add `//= require jquery` and `//= require jquery_ujs` to your app/assets/javascripts/application.js")
|
43
|
-
say_status("", "If you upgraded your app from Rails 3.0 and still have jquery.js, rails.js, or jquery_ujs.js in your javascripts, be sure to remove them.")
|
44
|
-
say_status("", "If you do not want the asset pipeline enabled, you may turn it off in application.rb and re-run this generator.")
|
45
|
-
# ok, nothing
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
data/lib/jquery/rails/railtie.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Used to ensure that Rails 3.0.x, as well as Rails >= 3.1 with asset pipeline disabled
|
2
|
-
# get the minified version of the scripts included into the layout in production.
|
3
|
-
module Jquery
|
4
|
-
module Rails
|
5
|
-
class Railtie < ::Rails::Railtie
|
6
|
-
config.before_configuration do
|
7
|
-
if config.action_view.javascript_expansions
|
8
|
-
jq_defaults = ::Rails.env.production? || ::Rails.env.test? ? %w(jquery.min) : %w(jquery)
|
9
|
-
|
10
|
-
# Merge the jQuery scripts, remove the Prototype defaults and finally add 'jquery_ujs'
|
11
|
-
# at the end, because load order is important
|
12
|
-
config.action_view.javascript_expansions[:defaults] -= PROTOTYPE_JS + ['rails']
|
13
|
-
config.action_view.javascript_expansions[:defaults] |= jq_defaults + ['jquery_ujs']
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|