easy_responders 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ == Easy Responders
2
+
3
+ A gem for Rails 3.0 adding the `responders` method to ActionController::Base, allowing you to setup per controller which responders you want included.
4
+
5
+ === Example
6
+
7
+ class InvitationsController < ApplicationController
8
+ responders :pagination, :ordering
9
+ end
10
+
11
+ === Installation
12
+
13
+ You can just require it in your Gemfile:
14
+
15
+ gem 'easy_responders'
@@ -0,0 +1,15 @@
1
+ begin
2
+ require 'jeweler'
3
+
4
+ Jeweler::Tasks.new do |gemspec|
5
+ gemspec.name = "easy_responders"
6
+ gemspec.summary = "Easily setup responders in your controller"
7
+ gemspec.description = "#{gemspec.summary}"
8
+ gemspec.email = "jan@openminds.be"
9
+ gemspec.homepage = "http://github.com/DefV/easy_responders"
10
+ gemspec.authors = ["Jan De Poorter"]
11
+ end
12
+ Jeweler::GemcutterTasks.new
13
+ rescue LoadError
14
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
15
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,43 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{easy_responders}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jan De Poorter"]
12
+ s.date = %q{2010-03-15}
13
+ s.description = %q{Easily setup responders in your controller}
14
+ s.email = %q{jan@openminds.be}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ "MIT-LICENSE",
20
+ "README.rdoc",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "easy_responders.gemspec",
24
+ "lib/easy_responders.rb",
25
+ "lib/easy_responders/railtie.rb"
26
+ ]
27
+ s.homepage = %q{http://github.com/DefV/easy_responders}
28
+ s.rdoc_options = ["--charset=UTF-8"]
29
+ s.require_paths = ["lib"]
30
+ s.rubygems_version = %q{1.3.6}
31
+ s.summary = %q{Easily setup responders in your controller}
32
+
33
+ if s.respond_to? :specification_version then
34
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
35
+ s.specification_version = 3
36
+
37
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
38
+ else
39
+ end
40
+ else
41
+ end
42
+ end
43
+
@@ -0,0 +1,14 @@
1
+ require 'easy_responders/railtie'
2
+
3
+ module EasyResponders
4
+ def responders *responders
5
+ if responders.any?
6
+ responder_class = Class.new(responder)
7
+ responders.each do |responder|
8
+ responder = responder.is_a?(Module) ? responder : "#{responder.to_s.classify}Responder".constantize
9
+ responder_class.send(:include, responder)
10
+ end
11
+ self.responder = responder_class
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ module EasyResponders
2
+ class Railtie < Rails::Railtie
3
+ railtie_name 'easy_responders'
4
+
5
+ initializer 'easy_responders.extend_actioncontroller' do |app|
6
+ ActionController::Base.extend EasyResponders
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: easy_responders
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Jan De Poorter
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-15 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Easily setup responders in your controller
22
+ email: jan@openminds.be
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README.rdoc
29
+ files:
30
+ - MIT-LICENSE
31
+ - README.rdoc
32
+ - Rakefile
33
+ - VERSION
34
+ - easy_responders.gemspec
35
+ - lib/easy_responders.rb
36
+ - lib/easy_responders/railtie.rb
37
+ has_rdoc: true
38
+ homepage: http://github.com/DefV/easy_responders
39
+ licenses: []
40
+
41
+ post_install_message:
42
+ rdoc_options:
43
+ - --charset=UTF-8
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ segments:
51
+ - 0
52
+ version: "0"
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ requirements: []
61
+
62
+ rubyforge_project:
63
+ rubygems_version: 1.3.6
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Easily setup responders in your controller
67
+ test_files: []
68
+