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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- ajax (1.1.3)
4
+ ajax (1.1.4)
5
5
  json
6
6
  rack
7
7
 
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.3
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=Ajax.root, to_dir=Rails.root)
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=Ajax.root, to_dir=Rails.root)
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
@@ -1,2 +1,3 @@
1
1
  require 'ajax/rspec/extension'
2
- require 'ajax/rspec/helpers'
2
+ require 'ajax/rspec/helpers'
3
+ require 'ajax/rspec/integration'
@@ -1,10 +1,6 @@
1
1
  module Ajax
2
2
  module RSpec
3
3
  module Extension
4
- def included(base)
5
- require 'ajax/rspec/integration'
6
- end
7
-
8
4
  def integrate_ajax
9
5
  Ajax.enabled = true
10
6
  end
@@ -3,7 +3,6 @@ require 'uri'
3
3
  module Ajax
4
4
  module RSpec
5
5
  module Helpers
6
-
7
6
  def create_app
8
7
  @app = Class.new { def call(env); true; end }.new
9
8
  end
@@ -92,4 +91,4 @@ module Ajax
92
91
  end
93
92
  end
94
93
  end
95
- end
94
+ end
@@ -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.before do
7
- ::Ajax.enabled = false
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
- ::Ajax.enabled = false
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
@@ -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: 21
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 3
10
- version: 1.1.3
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-05 00:00:00 -07:00
18
+ date: 2011-05-06 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency