crender 0.0.1

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 ADDED
@@ -0,0 +1,6 @@
1
+ source :rubygems
2
+
3
+ group :development do
4
+ gem "rails"
5
+ gem "actionpack", "~> 3.2.3"
6
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,86 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ actionmailer (3.2.3)
5
+ actionpack (= 3.2.3)
6
+ mail (~> 2.4.4)
7
+ actionpack (3.2.3)
8
+ activemodel (= 3.2.3)
9
+ activesupport (= 3.2.3)
10
+ builder (~> 3.0.0)
11
+ erubis (~> 2.7.0)
12
+ journey (~> 1.0.1)
13
+ rack (~> 1.4.0)
14
+ rack-cache (~> 1.2)
15
+ rack-test (~> 0.6.1)
16
+ sprockets (~> 2.1.2)
17
+ activemodel (3.2.3)
18
+ activesupport (= 3.2.3)
19
+ builder (~> 3.0.0)
20
+ activerecord (3.2.3)
21
+ activemodel (= 3.2.3)
22
+ activesupport (= 3.2.3)
23
+ arel (~> 3.0.2)
24
+ tzinfo (~> 0.3.29)
25
+ activeresource (3.2.3)
26
+ activemodel (= 3.2.3)
27
+ activesupport (= 3.2.3)
28
+ activesupport (3.2.3)
29
+ i18n (~> 0.6)
30
+ multi_json (~> 1.0)
31
+ arel (3.0.2)
32
+ builder (3.0.0)
33
+ erubis (2.7.0)
34
+ hike (1.2.1)
35
+ i18n (0.6.0)
36
+ journey (1.0.3)
37
+ json (1.6.6)
38
+ mail (2.4.4)
39
+ i18n (>= 0.4.0)
40
+ mime-types (~> 1.16)
41
+ treetop (~> 1.4.8)
42
+ mime-types (1.18)
43
+ multi_json (1.2.0)
44
+ polyglot (0.3.3)
45
+ rack (1.4.1)
46
+ rack-cache (1.2)
47
+ rack (>= 0.4)
48
+ rack-ssl (1.3.2)
49
+ rack
50
+ rack-test (0.6.1)
51
+ rack (>= 1.0)
52
+ rails (3.2.3)
53
+ actionmailer (= 3.2.3)
54
+ actionpack (= 3.2.3)
55
+ activerecord (= 3.2.3)
56
+ activeresource (= 3.2.3)
57
+ activesupport (= 3.2.3)
58
+ bundler (~> 1.0)
59
+ railties (= 3.2.3)
60
+ railties (3.2.3)
61
+ actionpack (= 3.2.3)
62
+ activesupport (= 3.2.3)
63
+ rack-ssl (~> 1.3.2)
64
+ rake (>= 0.8.7)
65
+ rdoc (~> 3.4)
66
+ thor (~> 0.14.6)
67
+ rake (0.9.2.2)
68
+ rdoc (3.12)
69
+ json (~> 1.4)
70
+ sprockets (2.1.2)
71
+ hike (~> 1.2)
72
+ rack (~> 1.0)
73
+ tilt (~> 1.1, != 1.3.0)
74
+ thor (0.14.6)
75
+ tilt (1.3.3)
76
+ treetop (1.4.10)
77
+ polyglot
78
+ polyglot (>= 0.3.1)
79
+ tzinfo (0.3.33)
80
+
81
+ PLATFORMS
82
+ ruby
83
+
84
+ DEPENDENCIES
85
+ actionpack (~> 3.2.3)
86
+ rails
data/crender.gemspec ADDED
@@ -0,0 +1,9 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{crender}
3
+ s.version = "0.0.1"
4
+ s.files = ["./crender.gemspec", "./Gemfile", "./Gemfile.lock", "./init.rb", "./lib", "./lib/crender.rb", "./lib/render.rb"]
5
+ s.authors = ["Eugene Ovchynnykov"]
6
+ s.summary = "Add possibility to render controllers action from other controller"
7
+ s.homepage = 'https://github.com/nerohellier/crender'
8
+ s.licenses = ["MIT"]
9
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'crender'
data/lib/crender.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'action_controller'
2
+ require 'render'
data/lib/render.rb ADDED
@@ -0,0 +1,26 @@
1
+ module ActionController
2
+ module Rendering
3
+
4
+ alias_method :render_orig, :render
5
+ def render_controller(controller_class, options = {:action => :index})
6
+ status, headers, resp = controller_class.action(options[:action]).call(env)
7
+ render_orig :text => resp.body, :status => status
8
+ end
9
+
10
+ def controller_options(*args)
11
+ options = args.first
12
+ return options if options.is_a?(Hash) && options[:controller]
13
+ nil
14
+ end
15
+
16
+ def render(*args)
17
+ if options = controller_options(*args)
18
+ controller = options.delete(:controller)
19
+ render_controller(controller, options)
20
+ else
21
+ render_orig(*args)
22
+ end
23
+ end
24
+
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crender
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Eugene Ovchynnykov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-11 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description:
15
+ email:
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ./crender.gemspec
21
+ - ./Gemfile
22
+ - ./Gemfile.lock
23
+ - ./init.rb
24
+ - ./lib/crender.rb
25
+ - ./lib/render.rb
26
+ homepage: https://github.com/nerohellier/crender
27
+ licenses:
28
+ - MIT
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 1.8.15
48
+ signing_key:
49
+ specification_version: 3
50
+ summary: Add possibility to render controllers action from other controller
51
+ test_files: []