rails-pdf-renderer 0.1.0 → 0.2.0
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +4 -0
- data/lib/rails/pdf/renderer/config.rb +1 -1
- data/lib/rails/pdf/renderer/path_helper.rb +0 -29
- data/lib/rails/pdf/renderer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 635626eb338910dea84efeacce856656c41171b8a5a82b42b2a57bdc390708c1
|
4
|
+
data.tar.gz: 34c4691e4fae6a8ab800bd5676b167d6852798677878e573fd3a3fc59d584c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e49d098a493f007935eca1f92bc09e5d72bdb65354b3e6c3220b0f642cb1802af26aec192b85ff18a7af2dbadcfb82e0b27ec7642038c61b0fdf760c790e0a94
|
7
|
+
data.tar.gz: 55846d3cf4e8d89b3004edc0946e52cbd38df023ad418ddf6bf012f43036efb84a54c835b0349f982de9c8ab401d23eec9bc48a3b9ddd3b3012853eeeb0323bf
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [0.2.0]
|
6
|
+
### Fixes
|
7
|
+
- Removed hardcoded URL
|
8
|
+
- Removed unused helper methods
|
9
|
+
|
5
10
|
## [0.1.0]
|
6
11
|
### New Features
|
7
12
|
- Initial version
|
data/README.md
CHANGED
@@ -16,6 +16,10 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
16
16
|
|
17
17
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
18
18
|
|
19
|
+
## Releasing new gems
|
20
|
+
1. Update version.rb
|
21
|
+
2. Run `rake release` to release a new gem
|
22
|
+
|
19
23
|
## Contributing
|
20
24
|
|
21
25
|
Bug reports and pull requests are welcome on GitHub at https://github.com/erikaxel/rails-pdf-renderer.
|
@@ -3,7 +3,7 @@ class RailsPdfRenderer
|
|
3
3
|
include ActiveSupport::Configurable
|
4
4
|
|
5
5
|
config_accessor :auth_key
|
6
|
-
config_accessor
|
6
|
+
config_accessor :url
|
7
7
|
config_accessor(:basic_auth) { false }
|
8
8
|
config_accessor(:default_protocol) { "https" }
|
9
9
|
|
@@ -1,36 +1,7 @@
|
|
1
1
|
class RailsPdfRenderer
|
2
2
|
module PathHelper
|
3
|
-
def self.root_path
|
4
|
-
String === Rails.root ? Pathname.new(Rails.root) : Rails.root
|
5
|
-
end
|
6
|
-
|
7
3
|
def self.add_extension(filename, extension)
|
8
4
|
filename.to_s.split('.').include?(extension) ? filename : "#{filename}.#{extension}"
|
9
5
|
end
|
10
|
-
|
11
|
-
def wicked_pdf_stylesheet_link_tag(*sources)
|
12
|
-
css_dir = PathHelper.root_path.join('public', 'stylesheets')
|
13
|
-
css_text = sources.collect do |source|
|
14
|
-
source = PathHelper.add_extension(source, 'css')
|
15
|
-
"<style type='text/css'>#{File.read(css_dir.join(source))}</style>"
|
16
|
-
end.join("\n")
|
17
|
-
css_text.respond_to?(:html_safe) ? css_text.html_safe : css_text
|
18
|
-
end
|
19
|
-
|
20
|
-
def wicked_pdf_image_tag(img, options = {})
|
21
|
-
image_tag "file:///#{PathHelper.root_path.join('public', 'images', img)}", options
|
22
|
-
end
|
23
|
-
|
24
|
-
def wicked_pdf_javascript_src_tag(jsfile, options = {})
|
25
|
-
jsfile = PathHelper.add_extension(jsfile, 'js')
|
26
|
-
type = ::Mime.respond_to?(:[]) ? ::Mime[:js] : ::Mime::JS # ::Mime[:js] cannot be used in Rails 2.3.
|
27
|
-
src = "file:///#{PathHelper.root_path.join('public', 'javascripts', jsfile)}"
|
28
|
-
content_tag('script', '', { 'type' => type, 'src' => path_to_javascript(src) }.merge(options))
|
29
|
-
end
|
30
|
-
|
31
|
-
def wicked_pdf_javascript_include_tag(*sources)
|
32
|
-
js_text = sources.collect { |source| wicked_pdf_javascript_src_tag(source, {}) }.join("\n")
|
33
|
-
js_text.respond_to?(:html_safe) ? js_text.html_safe : js_text
|
34
|
-
end
|
35
6
|
end
|
36
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-pdf-renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Axel Nielsen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.5.21
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Create PDFs directly from Rails.
|