eml_to_pdf_ext 0.5.8 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3008d2afdc1246af821e8f9b04cf7dd0c82f1326
4
- data.tar.gz: 4b42c67fb312a41200b318f4c07ce669ef806cdb
3
+ metadata.gz: 5ac64f039a8a88a5c6e07f418c54762a8a9a6951
4
+ data.tar.gz: a7b8e22249e42afa3a1e75dfce06a4aa8a7debb6
5
5
  SHA512:
6
- metadata.gz: 23a624a5a3582a1d1fc0172c50203743cee630fcfd799ffe84382c9e105a959f3628eeb81b29a83a8e9fa27cd6b474d1fcb3d3d16d6e17374124fc68598fbce8
7
- data.tar.gz: 7dec9f6954f372eb560f2724183d4e949868f1818a2f8618a0863fa0703be5c594adfc9440829e63973ee23ee4659a92b2ae26993f488e34c09e2b38214a05ba
6
+ metadata.gz: 4352972be6d531976003429416a23cac8336b8d64f33b4ac484bd4a9595fc96b0d68fa64a07a3cb9ab60aca2e64145d4dad59e14fa386bb4760574ef2d4be83f
7
+ data.tar.gz: bf0b1f690e44942946a6b239bbfcea28ee81a1381d335da0f1aeb7f5e059a714be276be003dcb808ed1516cb9a256b62609de8a4b414d4e2ce9553bb81fb6e6a
@@ -22,5 +22,5 @@ ratings:
22
22
  - "**.py"
23
23
  - "**.rb"
24
24
  exclude_paths:
25
- - lib/eml_to_pdf/extraction_step.rb
25
+ - lib/eml_to_pdf_ext/extraction_step.rb
26
26
  - test/
@@ -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
- Lint/Eval:
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: false
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/MethodCallParentheses:
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: false
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: false
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: false
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: false
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: false
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: false
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: false
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: false
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: false
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: false
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: false
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: false
1156
+ Enabled: true
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # EmlToPdf
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 'eml_to_pdf'
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 eml_to_pdf
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
- $ eml_to_pdf input-path output-path
52
+ $ eml_to_pdf_ext input-path output-path
53
53
 
54
54
  ## Development
55
55
 
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ Rake::TestTask.new do |t|
7
7
  end
8
8
 
9
9
  desc "Run tests"
10
- task :default => :test
10
+ task default: :test
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "eml_to_pdf"
4
+ require "eml_to_pdf_ext"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -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 'eml_to_pdf/version'
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 = EmlToPdf::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
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  if ARGV[0] && ARGV[1]
4
4
  require "bundler/setup"
5
- require "eml_to_pdf"
6
- EmlToPdf.convert(ARGV[0], ARGV[1])
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 EmlToPdf
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, @to_label, @cc_label, @date_label= 'From', 'To', 'Cc', 'Date'
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
@@ -1,4 +1,4 @@
1
- module EmlToPdf
1
+ module EmlToPdfExt
2
2
  class Converter
3
3
  def initialize(input_path, output_path)
4
4
  @input_path = input_path
@@ -2,7 +2,7 @@ require "pathname"
2
2
  require "nokogiri"
3
3
  require "erb"
4
4
 
5
- module EmlToPdf
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
- EmlToPdf.configuration.metadata_visible
100
+ EmlToPdfExt.configuration.metadata_visible
101
101
  end
102
102
 
103
103
  def links_enabled?
104
- EmlToPdf.configuration.links_enabled
104
+ EmlToPdfExt.configuration.links_enabled
105
105
  end
106
106
 
107
107
  def allowed_formats
108
- EmlToPdf.configuration.link_format_whitelist
108
+ EmlToPdfExt.configuration.link_format_whitelist
109
109
  end
110
110
  end
111
111
  end
@@ -1,4 +1,4 @@
1
- module EmlToPdf
1
+ module EmlToPdfExt
2
2
  class EmptyPart
3
3
  def multipart?
4
4
  false
@@ -1,4 +1,4 @@
1
- module EmlToPdf
1
+ module EmlToPdfExt
2
2
  class ExtractionStep
3
3
  MIME_TYPES = {
4
4
  plain_text: 'text/plain',
@@ -1,4 +1,4 @@
1
- module EmlToPdf
1
+ module EmlToPdfExt
2
2
  class ExtractionStepList
3
3
  def initialize(steps)
4
4
  @steps = steps
@@ -1,6 +1,6 @@
1
1
  require 'mail'
2
2
 
3
- module EmlToPdf
3
+ module EmlToPdfExt
4
4
  class FileEmailProvider
5
5
  def initialize(input_path)
6
6
  @email = Mail.read(input_path)
@@ -1,6 +1,6 @@
1
1
  require 'mail'
2
2
 
3
- module EmlToPdf
3
+ module EmlToPdfExt
4
4
  class MemoryEmailProvider
5
5
  def initialize(content)
6
6
  @email = Mail.new(content)
@@ -2,10 +2,10 @@ require "filesize"
2
2
  require "cgi"
3
3
  require "ostruct"
4
4
 
5
- module EmlToPdf
5
+ module EmlToPdfExt
6
6
  class MetadataContext < OpenStruct
7
7
  def config
8
- EmlToPdf.configuration
8
+ EmlToPdfExt.configuration
9
9
  end
10
10
 
11
11
  def format_attachment_size(attachment)
@@ -0,0 +1,3 @@
1
+ module EmlToPdfExt
2
+ VERSION = '0.6.0'
3
+ end
@@ -1,4 +1,4 @@
1
- module EmlToPdf
1
+ module EmlToPdfExt
2
2
  class Wkhtmltopdf
3
3
  class ConversionError < StandardError; end
4
4
 
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.5.8
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-09 00:00:00.000000000 Z
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/eml_to_pdf.rb
129
- - lib/eml_to_pdf/configuration.rb
130
- - lib/eml_to_pdf/converter.rb
131
- - lib/eml_to_pdf/email.rb
132
- - lib/eml_to_pdf/empty_part.rb
133
- - lib/eml_to_pdf/extraction_step.rb
134
- - lib/eml_to_pdf/extraction_step_list.rb
135
- - lib/eml_to_pdf/file_email_provider.rb
136
- - lib/eml_to_pdf/memory_email_provider.rb
137
- - lib/eml_to_pdf/metadata_context.rb
138
- - lib/eml_to_pdf/templates/heading.html.erb
139
- - lib/eml_to_pdf/templates/style.html
140
- - lib/eml_to_pdf/version.rb
141
- - lib/eml_to_pdf/wkhtmltopdf.rb
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:
@@ -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
@@ -1,3 +0,0 @@
1
- module EmlToPdf
2
- VERSION = '0.5.8'
3
- end