eml_to_pdf_ext 0.5.8 → 0.6.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/.codeclimate.yml +1 -1
- data/.rubocop.yml +15 -15
- data/README.md +4 -4
- data/Rakefile +1 -1
- data/bin/console +1 -1
- data/eml_to_pdf.gemspec +2 -2
- data/exe/eml_to_pdf +2 -2
- data/lib/eml_to_pdf_ext.rb +29 -0
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/configuration.rb +5 -2
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/converter.rb +1 -1
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/email.rb +4 -4
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/empty_part.rb +1 -1
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/extraction_step.rb +1 -1
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/extraction_step_list.rb +1 -1
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/file_email_provider.rb +1 -1
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/memory_email_provider.rb +1 -1
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/metadata_context.rb +2 -2
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/templates/heading.html.erb +0 -0
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/templates/style.html +0 -0
- data/lib/eml_to_pdf_ext/version.rb +3 -0
- data/lib/{eml_to_pdf → eml_to_pdf_ext}/wkhtmltopdf.rb +1 -1
- metadata +16 -16
- data/lib/eml_to_pdf.rb +0 -29
- data/lib/eml_to_pdf/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ac64f039a8a88a5c6e07f418c54762a8a9a6951
|
4
|
+
data.tar.gz: a7b8e22249e42afa3a1e75dfce06a4aa8a7debb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4352972be6d531976003429416a23cac8336b8d64f33b4ac484bd4a9595fc96b0d68fa64a07a3cb9ab60aca2e64145d4dad59e14fa386bb4760574ef2d4be83f
|
7
|
+
data.tar.gz: bf0b1f690e44942946a6b239bbfcea28ee81a1381d335da0f1aeb7f5e059a714be276be003dcb808ed1516cb9a256b62609de8a4b414d4e2ce9553bb81fb6e6a
|
data/.codeclimate.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -81,7 +81,7 @@ Lint/EnsureReturn:
|
|
81
81
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
|
82
82
|
Enabled: true
|
83
83
|
|
84
|
-
|
84
|
+
Security/Eval:
|
85
85
|
Description: 'The use of eval represents a serious security risk.'
|
86
86
|
Enabled: true
|
87
87
|
|
@@ -657,7 +657,7 @@ Style/HashSyntax:
|
|
657
657
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
658
658
|
{ :a => 1, :b => 2 }.
|
659
659
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
660
|
-
Enabled:
|
660
|
+
Enabled: true
|
661
661
|
|
662
662
|
Style/IfUnlessModifier:
|
663
663
|
Description: >-
|
@@ -716,7 +716,7 @@ Style/LineEndConcatenation:
|
|
716
716
|
line end.
|
717
717
|
Enabled: false
|
718
718
|
|
719
|
-
Style/
|
719
|
+
Style/MethodCallWithoutArgsParentheses:
|
720
720
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
721
721
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
722
722
|
Enabled: false
|
@@ -790,17 +790,17 @@ Style/Next:
|
|
790
790
|
Style/NilComparison:
|
791
791
|
Description: 'Prefer x.nil? to x == nil.'
|
792
792
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
793
|
-
Enabled:
|
793
|
+
Enabled: true
|
794
794
|
|
795
795
|
Style/NonNilCheck:
|
796
796
|
Description: 'Checks for redundant nil checks.'
|
797
797
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
|
798
|
-
Enabled:
|
798
|
+
Enabled: true
|
799
799
|
|
800
800
|
Style/Not:
|
801
801
|
Description: 'Use ! instead of not.'
|
802
802
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
803
|
-
Enabled:
|
803
|
+
Enabled: true
|
804
804
|
|
805
805
|
Style/NumericLiterals:
|
806
806
|
Description: >-
|
@@ -835,7 +835,7 @@ Style/ParallelAssignment:
|
|
835
835
|
matches on both sides of the assignment.
|
836
836
|
This also provides performance benefits
|
837
837
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
|
838
|
-
Enabled:
|
838
|
+
Enabled: true
|
839
839
|
|
840
840
|
Style/ParenthesesAroundCondition:
|
841
841
|
Description: >-
|
@@ -896,7 +896,7 @@ Style/RedundantSelf:
|
|
896
896
|
Style/RegexpLiteral:
|
897
897
|
Description: 'Use / or %r around regular expressions.'
|
898
898
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
899
|
-
Enabled:
|
899
|
+
Enabled: true
|
900
900
|
|
901
901
|
Style/RescueEnsureAlignment:
|
902
902
|
Description: 'Align rescues and ensures correctly.'
|
@@ -959,12 +959,12 @@ Style/SpaceAfterMethodName:
|
|
959
959
|
Do not put a space between a method name and the opening
|
960
960
|
parenthesis in a method definition.
|
961
961
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
962
|
-
Enabled:
|
962
|
+
Enabled: true
|
963
963
|
|
964
964
|
Style/SpaceAfterNot:
|
965
965
|
Description: Tracks redundant space after the ! operator.
|
966
966
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
|
967
|
-
Enabled:
|
967
|
+
Enabled: true
|
968
968
|
|
969
969
|
Style/SpaceAfterSemicolon:
|
970
970
|
Description: 'Use spaces after semicolons.'
|
@@ -1072,7 +1072,7 @@ Style/SymbolProc:
|
|
1072
1072
|
Style/Tab:
|
1073
1073
|
Description: 'No hard tabs.'
|
1074
1074
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
1075
|
-
Enabled:
|
1075
|
+
Enabled: true
|
1076
1076
|
|
1077
1077
|
Style/TrailingBlankLines:
|
1078
1078
|
Description: 'Checks trailing blank lines and final newline.'
|
@@ -1082,17 +1082,17 @@ Style/TrailingBlankLines:
|
|
1082
1082
|
Style/TrailingCommaInArguments:
|
1083
1083
|
Description: 'Checks for trailing comma in parameter lists.'
|
1084
1084
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
|
1085
|
-
Enabled:
|
1085
|
+
Enabled: true
|
1086
1086
|
|
1087
1087
|
Style/TrailingCommaInLiteral:
|
1088
1088
|
Description: 'Checks for trailing comma in literals.'
|
1089
1089
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
1090
|
-
Enabled:
|
1090
|
+
Enabled: true
|
1091
1091
|
|
1092
1092
|
Style/TrailingWhitespace:
|
1093
1093
|
Description: 'Avoid trailing whitespace.'
|
1094
1094
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
|
1095
|
-
Enabled:
|
1095
|
+
Enabled: true
|
1096
1096
|
|
1097
1097
|
Style/TrivialAccessors:
|
1098
1098
|
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
@@ -1153,4 +1153,4 @@ Style/WhileUntilModifier:
|
|
1153
1153
|
Style/WordArray:
|
1154
1154
|
Description: 'Use %w or %W for arrays of words.'
|
1155
1155
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
1156
|
-
Enabled:
|
1156
|
+
Enabled: true
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# EmlToPdfExt
|
2
2
|
|
3
3
|
Welcome to SwordPL/EmlToPdf fork.
|
4
4
|
A small converter to convert an eml file to a pdf.
|
@@ -11,7 +11,7 @@ This gem uses `wkhtmltopdf`. You can get the installer from [here](http://wkhtml
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem '
|
14
|
+
gem 'eml_to_pdf_ext'
|
15
15
|
```
|
16
16
|
|
17
17
|
And then execute:
|
@@ -20,7 +20,7 @@ And then execute:
|
|
20
20
|
|
21
21
|
Or install it yourself as:
|
22
22
|
|
23
|
-
$ gem install
|
23
|
+
$ gem install eml_to_pdf_ext
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
@@ -49,7 +49,7 @@ EmlToPdf.convert("~/Desktop/my_test_email.eml", "~/Desktop/converted_email.pdf")
|
|
49
49
|
|
50
50
|
Or you can use the executable
|
51
51
|
|
52
|
-
$
|
52
|
+
$ eml_to_pdf_ext input-path output-path
|
53
53
|
|
54
54
|
## Development
|
55
55
|
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/eml_to_pdf.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'eml_to_pdf_ext/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'eml_to_pdf_ext'
|
8
|
-
spec.version =
|
8
|
+
spec.version = EmlToPdfExt::VERSION
|
9
9
|
spec.authors = ['Yves Siegrist', 'Hubert Pomorski']
|
10
10
|
spec.email = %w(Elektron1c97@gmail.com hubert.pomorski@sabre.com)
|
11
11
|
|
data/exe/eml_to_pdf
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
if ARGV[0] && ARGV[1]
|
4
4
|
require "bundler/setup"
|
5
|
-
require "
|
6
|
-
|
5
|
+
require "eml_to_pdf_ext"
|
6
|
+
EmlToPdfExt.convert(ARGV[0], ARGV[1])
|
7
7
|
else
|
8
8
|
puts %{Please provide an input as well as an output path\nExample: emltopdf test-email.eml output.pdf}
|
9
9
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "eml_to_pdf_ext/version"
|
2
|
+
require "eml_to_pdf_ext/configuration"
|
3
|
+
require "eml_to_pdf_ext/converter"
|
4
|
+
require "eml_to_pdf_ext/converter"
|
5
|
+
require "eml_to_pdf_ext/email"
|
6
|
+
require "eml_to_pdf_ext/wkhtmltopdf"
|
7
|
+
require "eml_to_pdf_ext/metadata_context"
|
8
|
+
require "eml_to_pdf_ext/extraction_step"
|
9
|
+
require "eml_to_pdf_ext/extraction_step_list"
|
10
|
+
require "eml_to_pdf_ext/file_email_provider"
|
11
|
+
require "eml_to_pdf_ext/memory_email_provider"
|
12
|
+
|
13
|
+
module EmlToPdfExt
|
14
|
+
def self.convert(input, output)
|
15
|
+
Converter.new(input, output).convert
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.configure
|
19
|
+
yield configuration if block_given?
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.configuration
|
23
|
+
@configuration ||= Configuration.new
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.reset_configuration!
|
27
|
+
@configuration = Configuration.new
|
28
|
+
end
|
29
|
+
end
|
@@ -1,9 +1,12 @@
|
|
1
|
-
module
|
1
|
+
module EmlToPdfExt
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :from_label, :to_label, :cc_label, :date_label, :metadata_visible, :links_enabled, :link_format_whitelist
|
4
4
|
|
5
5
|
def initialize
|
6
|
-
@from_label
|
6
|
+
@from_label = 'From'
|
7
|
+
@to_label = 'To'
|
8
|
+
@cc_label = 'Cc'
|
9
|
+
@date_label = 'Date'
|
7
10
|
@date_format = lambda { |date| date.strftime('%Y-%m-%d %H:%M:%S %z') }
|
8
11
|
@metadata_visible = true
|
9
12
|
@links_enabled = true
|
@@ -2,7 +2,7 @@ require "pathname"
|
|
2
2
|
require "nokogiri"
|
3
3
|
require "erb"
|
4
4
|
|
5
|
-
module
|
5
|
+
module EmlToPdfExt
|
6
6
|
class Email
|
7
7
|
TEMPLATES_PATH = Pathname.new(File.expand_path(__dir__)) + 'templates'
|
8
8
|
|
@@ -97,15 +97,15 @@ module EmlToPdf
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def display_metadata?
|
100
|
-
|
100
|
+
EmlToPdfExt.configuration.metadata_visible
|
101
101
|
end
|
102
102
|
|
103
103
|
def links_enabled?
|
104
|
-
|
104
|
+
EmlToPdfExt.configuration.links_enabled
|
105
105
|
end
|
106
106
|
|
107
107
|
def allowed_formats
|
108
|
-
|
108
|
+
EmlToPdfExt.configuration.link_format_whitelist
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eml_to_pdf_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yves Siegrist
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-02-
|
12
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -125,20 +125,20 @@ files:
|
|
125
125
|
- bin/setup
|
126
126
|
- eml_to_pdf.gemspec
|
127
127
|
- exe/eml_to_pdf
|
128
|
-
- lib/
|
129
|
-
- lib/
|
130
|
-
- lib/
|
131
|
-
- lib/
|
132
|
-
- lib/
|
133
|
-
- lib/
|
134
|
-
- lib/
|
135
|
-
- lib/
|
136
|
-
- lib/
|
137
|
-
- lib/
|
138
|
-
- lib/
|
139
|
-
- lib/
|
140
|
-
- lib/
|
141
|
-
- lib/
|
128
|
+
- lib/eml_to_pdf_ext.rb
|
129
|
+
- lib/eml_to_pdf_ext/configuration.rb
|
130
|
+
- lib/eml_to_pdf_ext/converter.rb
|
131
|
+
- lib/eml_to_pdf_ext/email.rb
|
132
|
+
- lib/eml_to_pdf_ext/empty_part.rb
|
133
|
+
- lib/eml_to_pdf_ext/extraction_step.rb
|
134
|
+
- lib/eml_to_pdf_ext/extraction_step_list.rb
|
135
|
+
- lib/eml_to_pdf_ext/file_email_provider.rb
|
136
|
+
- lib/eml_to_pdf_ext/memory_email_provider.rb
|
137
|
+
- lib/eml_to_pdf_ext/metadata_context.rb
|
138
|
+
- lib/eml_to_pdf_ext/templates/heading.html.erb
|
139
|
+
- lib/eml_to_pdf_ext/templates/style.html
|
140
|
+
- lib/eml_to_pdf_ext/version.rb
|
141
|
+
- lib/eml_to_pdf_ext/wkhtmltopdf.rb
|
142
142
|
- tmp/.gitkeep
|
143
143
|
homepage: https://github.com/SwordPL/eml_to_pdf
|
144
144
|
licenses:
|
data/lib/eml_to_pdf.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require "eml_to_pdf/version"
|
2
|
-
require "eml_to_pdf/configuration"
|
3
|
-
require "eml_to_pdf/converter"
|
4
|
-
require "eml_to_pdf/converter"
|
5
|
-
require "eml_to_pdf/email"
|
6
|
-
require "eml_to_pdf/wkhtmltopdf"
|
7
|
-
require "eml_to_pdf/metadata_context"
|
8
|
-
require "eml_to_pdf/extraction_step"
|
9
|
-
require "eml_to_pdf/extraction_step_list"
|
10
|
-
require "eml_to_pdf/file_email_provider"
|
11
|
-
require "eml_to_pdf/memory_email_provider"
|
12
|
-
|
13
|
-
module EmlToPdf
|
14
|
-
def self.convert(input, output)
|
15
|
-
Converter.new(input, output).convert
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.configure
|
19
|
-
yield configuration if block_given?
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.configuration
|
23
|
-
@configuration ||= Configuration.new
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.reset_configuration!
|
27
|
-
@configuration = Configuration.new
|
28
|
-
end
|
29
|
-
end
|
data/lib/eml_to_pdf/version.rb
DELETED