pdf-my-url 1.0.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 Kevin Sylvestre
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,17 @@
1
+ = PDFmyURL
2
+
3
+ A basic ruby-on-rails interface to http://pdfmyurl.com/
4
+
5
+ == Example
6
+
7
+ <%= pdf_my_url 'CBC', 'http://www.cbc.ca/' %>
8
+
9
+ <%= pdf_my_url 'BBC', 'http://www.bbc.co.uk/', :filename => 'BBC.pdf' %>
10
+
11
+ <%= pdf_my_url 'NY Times', 'http://www.nytimes.com/', :filename => 'NY-Times.pdf',
12
+ :page_height => 200, :page_width => 100,
13
+ :margin_top => 10, :margin_left => 5, :margin_right => 5, :margin_bottom => 10 %>
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2010 Kevin Sylvestre, released under the MIT license
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gemspec|
7
+ gemspec.name = "pdf-my-url"
8
+ gemspec.summary = "A basic ruby-on-rails interface to http://pdfmyurl.com/"
9
+ gemspec.homepage = "http://github.com/ksylvest/pdf-my-url"
10
+ gemspec.author = "Kevin Sylvestre"
11
+ end
12
+ rescue LoadError
13
+ puts "Jeweler not available. Install it with: gem install jeweler"
14
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'pdf-my-url'
@@ -0,0 +1,32 @@
1
+ module ActionView
2
+ module Helpers
3
+
4
+ def pdf_my_url(name, url, options = {})
5
+
6
+ parameters = ""
7
+
8
+ parameters += "&--filename=#{options[:filename]}" if options[:filename]
9
+
10
+ parameters += "&--orientation=Portrait" if options[:orientation] == :portrait
11
+ parameters += "&--orientation=Landscape" if options[:orientation] == :landscape
12
+
13
+ parameters += "&--page-size=#{options[:page_size]}" if options[:page_size]
14
+
15
+ parameters += "&--proxy=#{options[:proxy]}" if options[:proxy]
16
+ parameters += "&--username=#{options[:username]}" if options[:username]
17
+ parameters += "&--password=#{options[:password]}" if options[:password]
18
+
19
+ parameters += "&--page-width=#{options[:page_width]}" if options[:page_width]
20
+ parameters += "&--page-height=#{options[:page_height]}" if options[:page_height]
21
+
22
+ parameters += "&--margin-top=#{options[:margin_top]}" if options[:margin_top]
23
+ parameters += "&--margin-left=#{options[:margin_left]}" if options[:margin_left]
24
+ parameters += "&--margin-right=#{options[:margin_right]}" if options[:margin_right]
25
+ parameters += "&--margin-bottom=#{options[:margin_bottom]}" if options[:margin_bottom]
26
+
27
+ link_to name, "http://pdfmyurl.com/?url=#{url}#{parameters}"
28
+
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,41 @@
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{pdf-my-url}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Kevin Sylvestre"]
12
+ s.date = %q{2010-07-19}
13
+ s.extra_rdoc_files = [
14
+ "README.rdoc"
15
+ ]
16
+ s.files = [
17
+ "MIT-LICENSE",
18
+ "README.rdoc",
19
+ "Rakefile",
20
+ "VERSION",
21
+ "init.rb",
22
+ "lib/pdf-my-url.rb",
23
+ "pdf-my-url.gemspec"
24
+ ]
25
+ s.homepage = %q{http://github.com/ksylvest/pdf-my-url}
26
+ s.rdoc_options = ["--charset=UTF-8"]
27
+ s.require_paths = ["lib"]
28
+ s.rubygems_version = %q{1.3.7}
29
+ s.summary = %q{A basic ruby-on-rails interface to http://pdfmyurl.com/}
30
+
31
+ if s.respond_to? :specification_version then
32
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
33
+ s.specification_version = 3
34
+
35
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
36
+ else
37
+ end
38
+ else
39
+ end
40
+ end
41
+
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pdf-my-url
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Kevin Sylvestre
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-07-19 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description:
23
+ email:
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - README.rdoc
30
+ files:
31
+ - MIT-LICENSE
32
+ - README.rdoc
33
+ - Rakefile
34
+ - VERSION
35
+ - init.rb
36
+ - lib/pdf-my-url.rb
37
+ - pdf-my-url.gemspec
38
+ has_rdoc: true
39
+ homepage: http://github.com/ksylvest/pdf-my-url
40
+ licenses: []
41
+
42
+ post_install_message:
43
+ rdoc_options:
44
+ - --charset=UTF-8
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ hash: 3
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ requirements: []
66
+
67
+ rubyforge_project:
68
+ rubygems_version: 1.3.7
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: A basic ruby-on-rails interface to http://pdfmyurl.com/
72
+ test_files: []
73
+