ajax 1.1.3 → 1.1.4
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/Gemfile.lock +1 -1
- data/README.rdoc +1 -0
- data/VERSION +1 -1
- data/lib/ajax/helpers/task_helper.rb +7 -3
- data/lib/ajax/rspec.rb +2 -1
- data/lib/ajax/rspec/extension.rb +0 -4
- data/lib/ajax/rspec/helpers.rb +1 -2
- data/lib/ajax/rspec/integration.rb +9 -8
- data/tasks/ajax_tasks.rake +3 -3
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -10,6 +10,7 @@ As of May 2010 Ajax is being used live in production on kazaa.com[http://www.kaz
|
|
10
10
|
|
11
11
|
== Changelog
|
12
12
|
|
13
|
+
* v1.1.4: Fix RSpec 2 integration
|
13
14
|
* v1.1.3: Guard against possible nil values for the redirect_to url and the referrers
|
14
15
|
* v1.1.2: Fix Rails 3 render hook so it doesn't break rendering with no layout e.g. <tt>render :json => ...</tt>
|
15
16
|
* v1.1.1: Backwards compatibility fix for Rails < 3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.4
|
@@ -14,7 +14,9 @@ module Ajax
|
|
14
14
|
UPDATE_JAVASCRIPT_FILES = %w[
|
15
15
|
public/javascripts/ajax.js]
|
16
16
|
|
17
|
-
def copy_unless_exists(file, from_dir=
|
17
|
+
def copy_unless_exists(file, from_dir=nil, to_dir=nil)
|
18
|
+
to_dir ||= Rails.root.to_s
|
19
|
+
from_dir ||= Ajax.root.to_s
|
18
20
|
from_file, to_file = File.join(from_dir, file), File.join(to_dir, file)
|
19
21
|
if File.exist?(to_file)
|
20
22
|
return false
|
@@ -27,7 +29,9 @@ module Ajax
|
|
27
29
|
e
|
28
30
|
end
|
29
31
|
|
30
|
-
def copy_and_overwrite(file, from_dir=
|
32
|
+
def copy_and_overwrite(file, from_dir=nil, to_dir=nil)
|
33
|
+
to_dir ||= Rails.root.to_s
|
34
|
+
from_dir ||= Ajax.root.to_s
|
31
35
|
from_file, to_file = File.join(from_dir, file), File.join(to_dir, file)
|
32
36
|
FileUtils.mkdir_p(File.dirname(to_file)) unless File.directory?(File.dirname(to_file))
|
33
37
|
FileUtils.cp(from_file, to_file)
|
@@ -51,4 +55,4 @@ module Ajax
|
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
54
|
-
end
|
58
|
+
end
|
data/lib/ajax/rspec.rb
CHANGED
data/lib/ajax/rspec/extension.rb
CHANGED
data/lib/ajax/rspec/helpers.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
# Only require integration module when extensions are included.
|
2
2
|
# RSpec integration. Add a before filter to disable Ajax before all tests.
|
3
3
|
module Ajax::RSpec::Integration
|
4
|
-
if defined?(RSpec)
|
5
|
-
RSpec.configure do |c|
|
6
|
-
c.
|
7
|
-
|
4
|
+
if defined?(::RSpec)
|
5
|
+
::RSpec.configure do |c|
|
6
|
+
c.include(Ajax::RSpec::Extension)
|
7
|
+
c.before :all do
|
8
|
+
disable_ajax
|
8
9
|
end
|
9
10
|
end
|
10
|
-
elsif defined?(Spec)
|
11
|
-
Spec::Runner.configure do |c|
|
11
|
+
elsif defined?(::Spec)
|
12
|
+
::Spec::Runner.configure do |c|
|
12
13
|
c.before :all do
|
13
|
-
|
14
|
+
disable_ajax
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -21,4 +22,4 @@ module ActiveSupport
|
|
21
22
|
class TestCase
|
22
23
|
include Ajax::RSpec::Extension
|
23
24
|
end
|
24
|
-
end
|
25
|
+
end
|
data/tasks/ajax_tasks.rake
CHANGED
@@ -42,12 +42,12 @@ END
|
|
42
42
|
namespace :install do
|
43
43
|
desc "Copy Ajax integration spec tests into spec/integration."
|
44
44
|
task :specs do
|
45
|
-
file = Ajax.app.root + 'spec/integration/ajax_spec.rb'
|
45
|
+
file = (Ajax.app.root + 'spec/integration/ajax_spec.rb').to_s
|
46
46
|
if File.exist?(file)
|
47
47
|
puts "already exists: #{file}" if verbose
|
48
48
|
else
|
49
49
|
FileUtils.mkdir_p(File.dirname(file))
|
50
|
-
FileUtils.cp(file.sub(Ajax.app.root, Ajax.root), file)
|
50
|
+
FileUtils.cp(file.sub(Ajax.app.root.to_s, Ajax.root.to_s), file)
|
51
51
|
puts "created: #{file}" if verbose
|
52
52
|
end
|
53
53
|
end
|
@@ -61,4 +61,4 @@ END
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
|
-
end
|
64
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ajax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 4
|
10
|
+
version: 1.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Karl Varga
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-06 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|