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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDQ5OTcyMTU2OTg4M2JjN2JkYzI4MjZjZGM0NGFhMzk0MTMzOGRkNA==
4
+ ODkwZmI5ZDZhYzUyN2YwYmE3MWI5MGIxOGUwM2U2Y2RkNGE0NDkzZA==
5
5
  data.tar.gz: !binary |-
6
- M2I2ZDgxZGM3OWRhNDBkYmZjYTgyNWQwNTA0MTI5ZmUwMzQ5YTE3Nw==
6
+ Y2JlZjIzZjcwYTBmNjI2Nzg4MTY4ZTI3NmM5M2EzOWUzZTMwNjRlYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2I4ZWZlOWFhMDRjN2E0ZDEzYjExMDY0ZTc4NjM1NzYyNGFiMWY3MmNlN2Ix
10
- MDJlMDZjYmRhNDNiYWNkYTcxNmM4NDM3ZDU0OTExMzBjOWE1NDQ2YmRhNDU4
11
- NGUxNWYxOWQ4MDQ5MDI1NWY1MjM4YTM3M2JkZTg0MWVkNzBiNTE=
9
+ OTVkOTJkY2Q3OTA2Y2RmMGQyNmI4YjYwOTgyZDQzOTEzZDkzOGQ3NGYwN2Vk
10
+ NzhhYzJkN2JiNjBmYjBhYTFkNWJlMjAyYjZhN2M3M2Q0YjkwZWEwZDEyN2I1
11
+ OGI5MDhjNTkyYzBjZDY5OTU3YTZjZGFmY2E1Zjc4OWZhY2E3NjY=
12
12
  data.tar.gz: !binary |-
13
- ZWI2ZjA1YTIyZTllODBjYmQ2MGRmZTMzMjJjMDgxOTJiODQ2MGNiOTgzMWQz
14
- YzgwODk1NzgyMWI3NmYxN2RjYTZkOTdkMTIwYmRhOGNkODY1ODlmYWIxZTAw
15
- Mjk4ZGNmYmM2NmJiZDJjNTQ0ZjI5YzE1ZmIzNzMxOTY2ZGIzN2Q=
13
+ MzgxYzRmZjA2YmI3YjEzNjA3NzdmZDRlZTIwYzlmMTgyODhhZTllMTYwYzI2
14
+ ZmYxZmJhZDY0YTM2N2Q5NTMwNWY4YTg1MDU4NDhmODBhNzBhNjlmZTUyYTM5
15
+ MmM0NGUwOTMwNjEzYjJmZTg1MzE4OGRkY2UwMjViNzQ4MWExYjk=
@@ -1,3 +1,3 @@
1
1
  module RubyPowerpoint
2
- VERSION = "1.4.3"
2
+ VERSION = "1.4.4"
3
3
  end
@@ -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', '~> 2.13.0'
25
+ spec.add_development_dependency 'rspec', '~> 3'
26
26
 
27
- spec.add_dependency 'nokogiri', '~> 1.6.0'
28
- spec.add_dependency 'rubyzip', '~> 1.0'
27
+ spec.add_dependency 'nokogiri', '~> 1.6'
28
+ spec.add_dependency 'rubyzip', '~> 1.0'
29
29
  end
@@ -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
- lambda { RubyPowerpoint::Presentation.new 'specs/fixtures/invalid.xls' }.should raise_error 'Not a valid file format.'
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.should_not be_nil
20
- @deck.slides.should_not eql []
21
- @deck.slides.first.content.should eql ["Some test ", "Powerpoint"]
22
- @deck.slides.first.content.should eql ["Some test ", "Powerpoint"]
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.should_not eql nil #"ppt/media/image1.jpeg"
27
- @deck.slides.last.title.should eql "Some title here"
28
- @deck.slides.last.content.should eql ["Some title here", "Some txt here", "Some ", "more text here."]
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.should eql ["Testing", " Multiline Notes.", "To be extracted here.", "Multiline notes extracted.", "1"]
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.should_not be_nil
51
- @deck.slides.should_not eql []
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.should eql 12
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.should eql ["The Rime of the Ancient Mariner", "(text of 1834)", "http://rpo.library.utoronto.ca/poems/rime-ancient-mariner-text-1834"]
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.should eql "The Rime of the Ancient Mariner"
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.should eql "Argument"
68
- @deck.slides[2].title.should eql "PART I"
69
- @deck.slides[3].title.should eql "PART II"
70
- @deck.slides[4].title.should eql "Part III"
71
- @deck.slides[8].title.should eql "There's more"
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.should be_nil
75
- @deck.slides[6].title.should be_nil
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.should eql "What if we have two"
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.should eql 2
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.should eq ['Argument']
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.3
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: 2016-10-19 00:00:00.000000000 Z
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: 2.13.0
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: 2.13.0
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.0
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.0
68
+ version: '1.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubyzip
71
71
  requirement: !ruby/object:Gem::Requirement