html_email_creator 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,10 +15,11 @@ module HtmlEmailCreator
15
15
  end
16
16
 
17
17
  def save
18
- FileUtils.mkdir_p(@settings.output_path) unless File.exists?(@settings.output_path)
19
18
  file = File.join(@settings.output_path, "#{@output_basename}.#{@formatter.extension}")
20
- File.open(file, "w") do |file|
21
- file.write(get)
19
+ directory = File.dirname(file)
20
+ FileUtils.mkdir_p(directory) unless File.exists?(directory)
21
+ File.open(file, "w") do |opened_file|
22
+ opened_file.write(get)
22
23
  end
23
24
  file
24
25
  end
@@ -1,3 +1,5 @@
1
+ #encoding: UTF-8
2
+
1
3
  require 'nokogiri'
2
4
  require 'inline-style'
3
5
 
@@ -1,3 +1,3 @@
1
1
  module HtmlEmailCreator
2
- VERSION = "1.0.2" unless defined?(::HtmlEmailCreator::VERSION)
2
+ VERSION = "1.0.3" unless defined?(::HtmlEmailCreator::VERSION)
3
3
  end
@@ -1,5 +1,5 @@
1
1
  config:
2
- output: "basic_text"
2
+ output: "cool/basic_text"
3
3
  layout: "basic.liquid"
4
4
  data:
5
5
  title_content: "A variant"
@@ -98,8 +98,8 @@ eos
98
98
  it "should store all correct versions of emails recursively" do
99
99
  emails = creator.save_emails(".", true)
100
100
 
101
- read_fixture("complex_with_config", "Output", "basic_text.html").should == expected_basic_text_html
102
- read_fixture("complex_with_config", "Output", "basic_text.txt").should == expected_basic_text_txt
101
+ read_fixture("complex_with_config", "Output", "cool", "basic_text.html").should == expected_basic_text_html
102
+ read_fixture("complex_with_config", "Output", "cool", "basic_text.txt").should == expected_basic_text_txt
103
103
  read_fixture("with_config", "Output", "first.html").should == expected_first_html
104
104
  read_fixture("with_config", "Output", "first.txt").should == expected_first_txt
105
105
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 2
9
- version: 1.0.2
8
+ - 3
9
+ version: 1.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pekka Mattila