dumpster 0.1.1 → 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.
- data/lib/dumpster/excel.rb +6 -0
 - data/lib/dumpster/version.rb +1 -1
 - data/spec/integration/excel/writer_spec.rb +8 -1
 - metadata +2 -2
 
    
        data/lib/dumpster/excel.rb
    CHANGED
    
    | 
         @@ -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
         
     | 
    
        data/lib/dumpster/version.rb
    CHANGED
    
    
| 
         @@ -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 '# 
     | 
| 
      
 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. 
     | 
| 
      
 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- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-06-26 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rake
         
     |