ruby_powerpoint 1.4.3 → 1.4.4
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 +8 -8
 - data/lib/ruby_powerpoint/version.rb +1 -1
 - data/ruby_powerpoint.gemspec +3 -3
 - data/spec/test_spec.rb +24 -24
 - metadata +6 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                ODkwZmI5ZDZhYzUyN2YwYmE3MWI5MGIxOGUwM2U2Y2RkNGE0NDkzZA==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                Y2JlZjIzZjcwYTBmNjI2Nzg4MTY4ZTI3NmM5M2EzOWUzZTMwNjRlYw==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                OTVkOTJkY2Q3OTA2Y2RmMGQyNmI4YjYwOTgyZDQzOTEzZDkzOGQ3NGYwN2Vk
         
     | 
| 
      
 10 
     | 
    
         
            +
                NzhhYzJkN2JiNjBmYjBhYTFkNWJlMjAyYjZhN2M3M2Q0YjkwZWEwZDEyN2I1
         
     | 
| 
      
 11 
     | 
    
         
            +
                OGI5MDhjNTkyYzBjZDY5OTU3YTZjZGFmY2E1Zjc4OWZhY2E3NjY=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                MzgxYzRmZjA2YmI3YjEzNjA3NzdmZDRlZTIwYzlmMTgyODhhZTllMTYwYzI2
         
     | 
| 
      
 14 
     | 
    
         
            +
                ZmYxZmJhZDY0YTM2N2Q5NTMwNWY4YTg1MDU4NDhmODBhNzBhNjlmZTUyYTM5
         
     | 
| 
      
 15 
     | 
    
         
            +
                MmM0NGUwOTMwNjEzYjJmZTg1MzE4OGRkY2UwMjViNzQ4MWExYjk=
         
     | 
    
        data/ruby_powerpoint.gemspec
    CHANGED
    
    | 
         @@ -22,8 +22,8 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
              spec.add_development_dependency "bundler", "~> 1.3"
         
     | 
| 
       24 
24 
     | 
    
         
             
              spec.add_development_dependency "rake"
         
     | 
| 
       25 
     | 
    
         
            -
              spec.add_development_dependency 'rspec', '~>  
     | 
| 
      
 25 
     | 
    
         
            +
              spec.add_development_dependency 'rspec', '~> 3'
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
              spec.add_dependency 'nokogiri', '~> 1.6 
     | 
| 
       28 
     | 
    
         
            -
              spec.add_dependency 'rubyzip', '~> 1.0' 
     | 
| 
      
 27 
     | 
    
         
            +
              spec.add_dependency 'nokogiri', '~> 1.6'
         
     | 
| 
      
 28 
     | 
    
         
            +
              spec.add_dependency 'rubyzip', '~> 1.0'
         
     | 
| 
       29 
29 
     | 
    
         
             
            end
         
     | 
    
        data/spec/test_spec.rb
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ require 'ruby_powerpoint' 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            describe 'RubyPowerpoint trying to parsing an invalid file.' do
         
     | 
| 
       4 
4 
     | 
    
         
             
              it 'not open an XLS file successfully.' do
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
      
 5 
     | 
    
         
            +
                expect { RubyPowerpoint::Presentation.new 'specs/fixtures/invalid.xls' }.to raise_error 'Not a valid file format.'
         
     | 
| 
       6 
6 
     | 
    
         
             
              end
         
     | 
| 
       7 
7 
     | 
    
         
             
            end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
         @@ -16,23 +16,23 @@ describe 'RubyPowerpoint parsing a sample PPTX file' do 
     | 
|
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
              it 'parse a PPTX file successfully.' do
         
     | 
| 
       19 
     | 
    
         
            -
                @deck. 
     | 
| 
       20 
     | 
    
         
            -
                @deck.slides. 
     | 
| 
       21 
     | 
    
         
            -
                @deck.slides.first.content. 
     | 
| 
       22 
     | 
    
         
            -
                @deck.slides.first.content. 
     | 
| 
      
 19 
     | 
    
         
            +
                expect(@deck).to_not be_nil
         
     | 
| 
      
 20 
     | 
    
         
            +
                expect(@deck.slides).to_not eql []
         
     | 
| 
      
 21 
     | 
    
         
            +
                expect(@deck.slides.first.content).to eql ["Some test ", "Powerpoint"]
         
     | 
| 
      
 22 
     | 
    
         
            +
                expect(@deck.slides.first.content).to eql  ["Some test ", "Powerpoint"]
         
     | 
| 
       23 
23 
     | 
    
         
             
                image_byte_stream_1 = @deck.slides.first.images.first.read
         
     | 
| 
       24 
24 
     | 
    
         
             
                File.open('temp_1.jpg', 'w'){|f| f.puts image_byte_stream_1}
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                @deck.slides.first.images.first. 
     | 
| 
       27 
     | 
    
         
            -
                @deck.slides.last.title. 
     | 
| 
       28 
     | 
    
         
            -
                @deck.slides.last.content. 
     | 
| 
      
 26 
     | 
    
         
            +
                expect(@deck.slides.first.images.first).to_not eql nil #"ppt/media/image1.jpeg"
         
     | 
| 
      
 27 
     | 
    
         
            +
                expect(@deck.slides.last.title).to eql "Some title here"
         
     | 
| 
      
 28 
     | 
    
         
            +
                expect(@deck.slides.last.content).to eql ["Some title here", "Some txt here", "Some ", "more text here."]
         
     | 
| 
       29 
29 
     | 
    
         
             
                image_byte_stream_2 = @deck.slides.last.images.first.read
         
     | 
| 
       30 
30 
     | 
    
         
             
                File.open('temp_2.jpg', 'w'){|f| f.puts image_byte_stream_2}
         
     | 
| 
       31 
31 
     | 
    
         
             
              end
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
              it "it parses Slide Notes of a PPTX  slides" do
         
     | 
| 
       34 
34 
     | 
    
         
             
                notes_content = @deck.slides[0].notes_content
         
     | 
| 
       35 
     | 
    
         
            -
                notes_content. 
     | 
| 
      
 35 
     | 
    
         
            +
                expect(notes_content).to eql ["Testing", " Multiline Notes.", "To be extracted here.", "Multiline notes extracted.", "1"]
         
     | 
| 
       36 
36 
     | 
    
         
             
              end
         
     | 
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
            end
         
     | 
| 
         @@ -47,36 +47,36 @@ describe 'open rime.pptx file' do 
     | 
|
| 
       47 
47 
     | 
    
         
             
              end
         
     | 
| 
       48 
48 
     | 
    
         | 
| 
       49 
49 
     | 
    
         
             
              it 'opened rime.pptx successfully' do
         
     | 
| 
       50 
     | 
    
         
            -
                @deck. 
     | 
| 
       51 
     | 
    
         
            -
                @deck.slides. 
     | 
| 
      
 50 
     | 
    
         
            +
                expect(@deck).to_not be_nil
         
     | 
| 
      
 51 
     | 
    
         
            +
                expect(@deck.slides).to_not eql []
         
     | 
| 
       52 
52 
     | 
    
         
             
              end
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
54 
     | 
    
         
             
              it 'should have the right number of slides' do
         
     | 
| 
       55 
     | 
    
         
            -
                @deck.slides.length. 
     | 
| 
      
 55 
     | 
    
         
            +
                expect(@deck.slides.length).to eql 12
         
     | 
| 
       56 
56 
     | 
    
         
             
              end
         
     | 
| 
       57 
57 
     | 
    
         | 
| 
       58 
58 
     | 
    
         
             
              it 'the old content method should work the same way' do
         
     | 
| 
       59 
     | 
    
         
            -
                @deck.slides[0].content. 
     | 
| 
      
 59 
     | 
    
         
            +
                expect(@deck.slides[0].content).to eql ["The Rime of the Ancient Mariner", "(text of 1834)", "http://rpo.library.utoronto.ca/poems/rime-ancient-mariner-text-1834"]
         
     | 
| 
       60 
60 
     | 
    
         
             
              end
         
     | 
| 
       61 
61 
     | 
    
         | 
| 
       62 
62 
     | 
    
         
             
              context 'the titles should be right' do
         
     | 
| 
       63 
63 
     | 
    
         
             
                it 'should be able to get a main slide (usually centered)' do
         
     | 
| 
       64 
     | 
    
         
            -
                  @deck.slides[0].title. 
     | 
| 
      
 64 
     | 
    
         
            +
                  expect(@deck.slides[0].title).to eql "The Rime of the Ancient Mariner"
         
     | 
| 
       65 
65 
     | 
    
         
             
                end
         
     | 
| 
       66 
66 
     | 
    
         
             
                it 'should be able to get regular slide titles' do
         
     | 
| 
       67 
     | 
    
         
            -
                  @deck.slides[1].title. 
     | 
| 
       68 
     | 
    
         
            -
                  @deck.slides[2].title. 
     | 
| 
       69 
     | 
    
         
            -
                  @deck.slides[3].title. 
     | 
| 
       70 
     | 
    
         
            -
                  @deck.slides[4].title. 
     | 
| 
       71 
     | 
    
         
            -
                  @deck.slides[8].title. 
     | 
| 
      
 67 
     | 
    
         
            +
                  expect(@deck.slides[1].title).to eql "Argument"
         
     | 
| 
      
 68 
     | 
    
         
            +
                  expect(@deck.slides[2].title).to eql "PART I"
         
     | 
| 
      
 69 
     | 
    
         
            +
                  expect(@deck.slides[3].title).to eql "PART II"
         
     | 
| 
      
 70 
     | 
    
         
            +
                  expect(@deck.slides[4].title).to eql "Part III"
         
     | 
| 
      
 71 
     | 
    
         
            +
                  expect(@deck.slides[8].title).to eql "There's more"
         
     | 
| 
       72 
72 
     | 
    
         
             
                end
         
     | 
| 
       73 
73 
     | 
    
         
             
                it 'should return nil if the slide has no title' do
         
     | 
| 
       74 
     | 
    
         
            -
                  @deck.slides[5].title. 
     | 
| 
       75 
     | 
    
         
            -
                  @deck.slides[6].title. 
     | 
| 
      
 74 
     | 
    
         
            +
                  expect(@deck.slides[5].title).to be_nil
         
     | 
| 
      
 75 
     | 
    
         
            +
                  expect(@deck.slides[6].title).to be_nil
         
     | 
| 
       76 
76 
     | 
    
         
             
                end
         
     | 
| 
       77 
77 
     | 
    
         | 
| 
       78 
78 
     | 
    
         
             
                it 'should only get one title even if there are two things that visually look like titles' do
         
     | 
| 
       79 
     | 
    
         
            -
                  @deck.slides[7].title. 
     | 
| 
      
 79 
     | 
    
         
            +
                  expect(@deck.slides[7].title).to eql "What if we have two"
         
     | 
| 
       80 
80 
     | 
    
         
             
                end
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
82 
     | 
    
         
             
                context 'when slide contains paragraph' do
         
     | 
| 
         @@ -85,11 +85,11 @@ describe 'open rime.pptx file' do 
     | 
|
| 
       85 
85 
     | 
    
         
             
                  end
         
     | 
| 
       86 
86 
     | 
    
         | 
| 
       87 
87 
     | 
    
         
             
                  it 'should return the list of paragraphs' do
         
     | 
| 
       88 
     | 
    
         
            -
                    @slide.paragraphs.count. 
     | 
| 
      
 88 
     | 
    
         
            +
                    expect(@slide.paragraphs.count).to eql 2
         
     | 
| 
       89 
89 
     | 
    
         
             
                  end
         
     | 
| 
       90 
90 
     | 
    
         | 
| 
       91 
91 
     | 
    
         
             
                  it 'should return the content of the paragraph' do
         
     | 
| 
       92 
     | 
    
         
            -
                    @slide.paragraphs[0].content. 
     | 
| 
      
 92 
     | 
    
         
            +
                    expect(@slide.paragraphs[0].content).to eq ['Argument']
         
     | 
| 
       93 
93 
     | 
    
         
             
                  end
         
     | 
| 
       94 
94 
     | 
    
         
             
                end
         
     | 
| 
       95 
95 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ruby_powerpoint
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.4. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.4.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - pythonicrubyist
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-02-14 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -44,28 +44,28 @@ dependencies: 
     | 
|
| 
       44 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
45 
     | 
    
         
             
                - - ~>
         
     | 
| 
       46 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version:  
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '3'
         
     | 
| 
       48 
48 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
52 
     | 
    
         
             
                - - ~>
         
     | 
| 
       53 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version:  
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '3'
         
     | 
| 
       55 
55 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       56 
56 
     | 
    
         
             
              name: nokogiri
         
     | 
| 
       57 
57 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       58 
58 
     | 
    
         
             
                requirements:
         
     | 
| 
       59 
59 
     | 
    
         
             
                - - ~>
         
     | 
| 
       60 
60 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       61 
     | 
    
         
            -
                    version: 1.6 
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '1.6'
         
     | 
| 
       62 
62 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       63 
63 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       64 
64 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       65 
65 
     | 
    
         
             
                requirements:
         
     | 
| 
       66 
66 
     | 
    
         
             
                - - ~>
         
     | 
| 
       67 
67 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       68 
     | 
    
         
            -
                    version: 1.6 
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '1.6'
         
     | 
| 
       69 
69 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       70 
70 
     | 
    
         
             
              name: rubyzip
         
     | 
| 
       71 
71 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     |