dumpster 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,12 @@ module Dumpster
8
8
  @model = model
9
9
  end
10
10
 
11
+ def write_to_string
12
+ file = Tempfile.new('dumpster_excel_export.xlsx')
13
+ write_to_file(file.path)
14
+ File.read(file.path)
15
+ end
16
+
11
17
  def write_to_file(path)
12
18
  package = Axlsx::Package.new
13
19
  workbook = package.workbook
@@ -1,3 +1,3 @@
1
1
  module Dumpster
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  require 'integration/spec_helper'
2
3
 
3
4
  describe Dumpster::Excel::Writer do
@@ -6,7 +7,13 @@ describe Dumpster::Excel::Writer do
6
7
  let(:model) { Dumpster::Model::Generic.new(data) }
7
8
  subject { described_class.new(model) }
8
9
 
9
- it '#write_to_file schreibt die CSV Daten in eine Datei' do
10
+ it '#write_to_string gibt die Daten als String zurück' do
11
+ excel = subject.write_to_string
12
+ excel.should_not be_nil
13
+ excel.should_not == ''
14
+ end
15
+
16
+ it '#write_to_file schreibt die Daten in eine Excel Datei' do
10
17
  output_path = File.join(File.dirname(__FILE__), 'output', 'example.xlsx')
11
18
  FileUtils.rm_f(output_path)
12
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumpster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-20 00:00:00.000000000 Z
12
+ date: 2012-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake