faxijaxy 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '>=3.0.0.beta4'
data/Rakefile CHANGED
@@ -10,6 +10,7 @@ begin
10
10
  gem.email = "sax@livinginthepast.org"
11
11
  gem.homepage = "http://github.com/sax/faxijaxy"
12
12
  gem.authors = ["Eric Saxby", "adamlogic"]
13
+ gem.add_dependency 'rails', '>=3.0.0.beta4'
13
14
  gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
16
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{faxijaxy}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Eric Saxby", "adamlogic"]
12
- s.date = %q{2010-06-29}
12
+ s.date = %q{2010-06-30}
13
13
  s.description = %q{jquery.form requires that :js and :json file upload forms have their responses wrapped in textarea tags. This gem builds on the jaxy_file_uploads by adamlogic to add that support to Rails 3.}
14
14
  s.email = %q{sax@livinginthepast.org}
15
15
  s.extra_rdoc_files = [
@@ -19,12 +19,15 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".gitignore",
22
+ "Gemfile",
22
23
  "LICENSE",
23
24
  "README.textile",
24
25
  "Rakefile",
25
26
  "VERSION",
26
27
  "faxijaxy.gemspec",
28
+ "init.rb",
27
29
  "lib/faxijaxy.rb",
30
+ "lib/faxijaxy/railtie.rb",
28
31
  "rails/init.rb",
29
32
  "test/helper.rb",
30
33
  "test/test_faxijaxy.rb"
@@ -44,11 +47,14 @@ Gem::Specification.new do |s|
44
47
  s.specification_version = 3
45
48
 
46
49
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
+ s.add_runtime_dependency(%q<rails>, [">= 3.0.0.beta4"])
47
51
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
48
52
  else
53
+ s.add_dependency(%q<rails>, [">= 3.0.0.beta4"])
49
54
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
50
55
  end
51
56
  else
57
+ s.add_dependency(%q<rails>, [">= 3.0.0.beta4"])
52
58
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
53
59
  end
54
60
  end
data/init.rb ADDED
@@ -0,0 +1,8 @@
1
+ $:.push "rails/activesupport/lib"
2
+ $:.push "rails/actionpack/lib"
3
+
4
+ require 'action_controller'
5
+ require 'faxijaxy'
6
+ config.to_prepare do
7
+ ActionController::Base.send(:include, FaxiJaxi)
8
+ end
@@ -1,17 +1,20 @@
1
1
  module FaxiJaxy
2
- def self.included(base)
3
- base.after_filter :faxijaxify
4
- end
5
-
6
- private
2
+ require 'faxijaxy/railtie' if defined?(Rails)
3
+ end
7
4
 
8
- def faxijaxify
9
- if request.content_type == :multipart_form && (request.format == :js || request.format == :json)
10
- # formatting the response as js may wrap the response in <pre>
11
- response.content_type = nil
5
+ module ActionController
6
+ class Base
12
7
 
13
- # jquery-form expects the js response to be in a textarea
14
- response.body = "<textarea>#{response.body}</textarea>"
8
+ private
9
+
10
+ def faxijaxify
11
+ if request.content_type == 'multipart/form-data' && (request.format == :js || request.format == :json)
12
+ # formatting the response as js may wrap the response in <pre>
13
+ response.content_type = nil
14
+
15
+ # jquery-form expects the js response to be in a textarea
16
+ response.body = "<textarea>#{response.body}</textarea>"
17
+ end
15
18
  end
16
19
  end
17
20
  end
@@ -0,0 +1,9 @@
1
+ require 'faxijaxy'
2
+
3
+ module FaxiJaxy
4
+ class Railtie < Rails::Railtie
5
+ config.to_prepare do
6
+ ActionController::Base.send(:after_filter, :faxijaxify)
7
+ end
8
+ end
9
+ end
@@ -1 +1,5 @@
1
- ActionController::Base.send(:include, FaxiJaxi)
1
+ $:.push "rails/activesupport/lib"
2
+ $:.push "rails/actionpack/lib"
3
+
4
+ require 'action_controller'
5
+ require 'faxijaxy'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faxijaxy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Saxby
@@ -16,13 +16,30 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-06-29 00:00:00 -07:00
19
+ date: 2010-06-30 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- name: thoughtbot-shoulda
23
+ name: rails
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: -1848230024
31
+ segments:
32
+ - 3
33
+ - 0
34
+ - 0
35
+ - beta4
36
+ version: 3.0.0.beta4
37
+ type: :runtime
38
+ version_requirements: *id001
39
+ - !ruby/object:Gem::Dependency
40
+ name: thoughtbot-shoulda
41
+ prerelease: false
42
+ requirement: &id002 !ruby/object:Gem::Requirement
26
43
  none: false
27
44
  requirements:
28
45
  - - ">="
@@ -32,7 +49,7 @@ dependencies:
32
49
  - 0
33
50
  version: "0"
34
51
  type: :development
35
- version_requirements: *id001
52
+ version_requirements: *id002
36
53
  description: jquery.form requires that :js and :json file upload forms have their responses wrapped in textarea tags. This gem builds on the jaxy_file_uploads by adamlogic to add that support to Rails 3.
37
54
  email: sax@livinginthepast.org
38
55
  executables: []
@@ -45,12 +62,15 @@ extra_rdoc_files:
45
62
  files:
46
63
  - .document
47
64
  - .gitignore
65
+ - Gemfile
48
66
  - LICENSE
49
67
  - README.textile
50
68
  - Rakefile
51
69
  - VERSION
52
70
  - faxijaxy.gemspec
71
+ - init.rb
53
72
  - lib/faxijaxy.rb
73
+ - lib/faxijaxy/railtie.rb
54
74
  - rails/init.rb
55
75
  - test/helper.rb
56
76
  - test/test_faxijaxy.rb