call-responder 0.0.2
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.
- checksums.yaml +7 -0
- data/lib/call_responder.rb +27 -0
- metadata +73 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 18f858c61b42618caf29d3e049a9383bd8fd4a0c
|
4
|
+
data.tar.gz: 5ad0aec288554f2c6652998f1f39be621fba07fc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a8431a55074f940e89a8762eaa04fe5097b6ae1df6900d25ddef40225e90ee3904bb53e9dab50225aa938fd2b4e86c499edf0e71e73f4d74b2ffce8bf2e002bd
|
7
|
+
data.tar.gz: 1225ceaa0549b62dc0ebee5e528a13ea83c337619f4ad2819eebf0bcbb1980d2afa6d7606ecc62aac25b72fc2f0bb990c5c0f3d0417d6e51df56fa9dc707f299
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CallResponder < ActionController::Responder
|
2
|
+
|
3
|
+
attr_reader :controller, :request, :format, :resource, :resources, :options
|
4
|
+
def initialize(controller, resources, options={})
|
5
|
+
super
|
6
|
+
@controller = controller
|
7
|
+
@request = @controller.request
|
8
|
+
@format = @controller.formats.first
|
9
|
+
@formats = [ :report ]
|
10
|
+
@config = YAML::load(File.open('config/responder.yml'))
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_format
|
14
|
+
to_pdf if @format == 'pdf'
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_pdf
|
19
|
+
stream = RestClient.post(@config["url"],
|
20
|
+
{
|
21
|
+
:file => controller.render_to_string(:formats => @formats)
|
22
|
+
}
|
23
|
+
)
|
24
|
+
|
25
|
+
controller.send_data( stream, :filename => @request.fullpath.gsub("/","") )
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: call-responder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rodrigo Oliveira
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-08-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: actionpack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rest-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.6.7
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.6.7
|
41
|
+
description: A simple gem that creates a responder that makes a request for a service,
|
42
|
+
with the HTML content as parameter and responds the stream of the response.
|
43
|
+
email: rodrigo.dealer@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/call_responder.rb
|
49
|
+
homepage: https://github.com/rodrigodealer/call-responder
|
50
|
+
licenses:
|
51
|
+
- MIT
|
52
|
+
metadata: {}
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 2.0.3
|
70
|
+
signing_key:
|
71
|
+
specification_version: 4
|
72
|
+
summary: Call responder
|
73
|
+
test_files: []
|