middleman-presentation 0.15.8 → 0.16.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -4
- data/Rakefile +8 -3
- data/bin/middleman-presentation +9 -1
- data/bin/mp +9 -1
- data/lib/middleman-presentation.rb +1 -71
- data/middleman-presentation.gemspec +7 -20
- metadata +14 -357
- data/.gitignore +0 -33
- data/.rdebugrc +0 -7
- data/.rspec +0 -5
- data/.simplecov +0 -8
- data/.travis.yml +0 -8
- data/.yardopts +0 -5
- data/CONTRIBUTING.md +0 -44
- data/Gemfile +0 -49
- data/Gemfile.lock +0 -328
- data/Guardfile +0 -13
- data/LICENSE.software +0 -21
- data/README.md +0 -608
- data/RELEASE_NOTES.md +0 -36
- data/config/license_finder.yml +0 -13
- data/config/rubocop/exclude.yml +0 -25
- data/config/rubocop/include.yml +0 -142
- data/cucumber.yml +0 -2
- data/doc/licenses/dependencies.csv +0 -55
- data/doc/licenses/dependencies.db +0 -0
- data/doc/licenses/dependencies.html +0 -1415
- data/doc/licenses/dependencies.md +0 -603
- data/doc/licenses/dependencies_detailed.csv +0 -190
- data/features/create_presentation-cli.feature +0 -312
- data/features/create_theme-cli.feature +0 -62
- data/features/grouping_slides.feature +0 -116
- data/features/ignore_slides.feature +0 -86
- data/features/image_gallery.feature +0 -58
- data/features/init_application-cli.feature +0 -91
- data/features/init_predefined_slides.feature +0 -13
- data/features/presentation.feature +0 -113
- data/features/show_config-cli.feature +0 -27
- data/features/show_style-cli.feature +0 -21
- data/features/show_support_information-cli.feature +0 -12
- data/features/slide-cli.feature +0 -311
- data/features/step_definitions.rb +0 -135
- data/features/support/ci.rb +0 -3
- data/features/support/env.rb +0 -19
- data/features/support/reporting.rb +0 -2
- data/features/version_number.feature +0 -18
- data/fixtures/images/image01.png +0 -0
- data/fixtures/images/image02.png +0 -0
- data/lib/middleman-presentation/cli/create.rb +0 -14
- data/lib/middleman-presentation/cli/create_presentation.rb +0 -308
- data/lib/middleman-presentation/cli/create_theme.rb +0 -77
- data/lib/middleman-presentation/cli/init.rb +0 -34
- data/lib/middleman-presentation/cli/reset_thor.rb +0 -18
- data/lib/middleman-presentation/cli/runner.rb +0 -18
- data/lib/middleman-presentation/cli/show.rb +0 -37
- data/lib/middleman-presentation/commands/presentation.rb +0 -23
- data/lib/middleman-presentation/commands/slide.rb +0 -86
- data/lib/middleman-presentation/commands/style.rb +0 -29
- data/lib/middleman-presentation/comparable_slide.rb +0 -69
- data/lib/middleman-presentation/css_class_extracter.rb +0 -41
- data/lib/middleman-presentation/custom_template.rb +0 -11
- data/lib/middleman-presentation/erb_template.rb +0 -11
- data/lib/middleman-presentation/existing_slide.rb +0 -133
- data/lib/middleman-presentation/extension.rb +0 -12
- data/lib/middleman-presentation/file_extensions.rb +0 -60
- data/lib/middleman-presentation/frontend_component.rb +0 -82
- data/lib/middleman-presentation/group_template.rb +0 -11
- data/lib/middleman-presentation/helpers.rb +0 -11
- data/lib/middleman-presentation/helpers/images.rb +0 -38
- data/lib/middleman-presentation/helpers/slides.rb +0 -31
- data/lib/middleman-presentation/helpers/tests.rb +0 -13
- data/lib/middleman-presentation/ignore_file.rb +0 -52
- data/lib/middleman-presentation/liquid_template.rb +0 -11
- data/lib/middleman-presentation/logger.rb +0 -8
- data/lib/middleman-presentation/main.rb +0 -40
- data/lib/middleman-presentation/markdown_template.rb +0 -11
- data/lib/middleman-presentation/new_slide.rb +0 -145
- data/lib/middleman-presentation/predefined_slide_templates_directory.rb +0 -11
- data/lib/middleman-presentation/presentation_config.rb +0 -48
- data/lib/middleman-presentation/slide_group.rb +0 -38
- data/lib/middleman-presentation/slide_list.rb +0 -46
- data/lib/middleman-presentation/transformers/file_keeper.rb +0 -13
- data/lib/middleman-presentation/transformers/group_slides.rb +0 -34
- data/lib/middleman-presentation/transformers/ignore_slides.rb +0 -28
- data/lib/middleman-presentation/transformers/remove_duplicate_slides.rb +0 -32
- data/lib/middleman-presentation/transformers/sort_slides.rb +0 -13
- data/lib/middleman-presentation/version.rb +0 -8
- data/locales/de.yml +0 -9
- data/locales/en.yml +0 -18
- data/script/bootstrap +0 -11
- data/script/ci +0 -3
- data/spec/css_class_extracter_spec.rb +0 -28
- data/spec/existing_slide_spec.rb +0 -158
- data/spec/frontend_resource_spec.rb +0 -87
- data/spec/ignore_file_spec.rb +0 -74
- data/spec/new_slide_spec.rb +0 -136
- data/spec/shared_examples/.keep +0 -0
- data/spec/slide_group_spec.rb +0 -69
- data/spec/slide_list_spec.rb +0 -90
- data/spec/spec_helper.rb +0 -19
- data/spec/support/ci.rb +0 -20
- data/spec/support/environment.rb +0 -18
- data/spec/support/filesystem.rb +0 -22
- data/spec/support/reporting.rb +0 -2
- data/spec/support/rspec.rb +0 -9
- data/spec/support/string.rb +0 -2
- data/spec/transformers/file_keeper_spec.rb +0 -23
- data/spec/transformers/group_slides_spec.rb +0 -44
- data/spec/transformers/ignore_slides_spec.rb +0 -64
- data/spec/transformers/remove_duplicate_slides_spec.rb +0 -120
- data/spec/transformers/sort_slides_spec.rb +0 -17
- data/templates/.bowerrc.tt +0 -4
- data/templates/.gitignore +0 -5
- data/templates/LICENSE.presentation +0 -1
- data/templates/Rakefile +0 -59
- data/templates/bower.json.tt +0 -8
- data/templates/config.yaml.tt +0 -41
- data/templates/data/config.yml.tt +0 -9
- data/templates/data/metadata.yml.tt +0 -77
- data/templates/predefined_slides.d/00.html.erb.tt +0 -23
- data/templates/predefined_slides.d/999980.html.erb.tt +0 -4
- data/templates/predefined_slides.d/999981.html.erb.tt +0 -21
- data/templates/predefined_slides.d/999982.html.erb.tt +0 -3
- data/templates/presentation_theme/bower.json.tt +0 -20
- data/templates/presentation_theme/images/.keep +0 -0
- data/templates/presentation_theme/javascripts/%theme_name%.js.tt +0 -0
- data/templates/presentation_theme/stylesheets/%theme_name%.scss.tt +0 -9
- data/templates/presentation_theme/stylesheets/_fonts.scss.tt +0 -0
- data/templates/presentation_theme/stylesheets/_images.scss.tt +0 -5
- data/templates/presentation_theme/stylesheets/_theme.scss.tt +0 -251
- data/templates/script/bootstrap +0 -5
- data/templates/script/build +0 -3
- data/templates/script/export +0 -34
- data/templates/script/presentation +0 -3
- data/templates/script/slide +0 -3
- data/templates/script/start +0 -43
- data/templates/slides/custom.md.tt +0 -3
- data/templates/slides/erb.tt +0 -5
- data/templates/slides/group.tt +0 -3
- data/templates/slides/liquid.tt +0 -5
- data/templates/slides/markdown.tt +0 -3
- data/templates/source/index.html.erb +0 -1
- data/templates/source/javascripts/application.js.tt +0 -3
- data/templates/source/layout.erb +0 -89
- data/templates/source/stylesheets/application.scss.tt +0 -3
data/spec/spec_helper.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
$LOAD_PATH << File.expand_path('../../lib', __FILE__)
|
3
|
-
|
4
|
-
require 'simplecov'
|
5
|
-
SimpleCov.command_name 'rspec'
|
6
|
-
SimpleCov.start
|
7
|
-
|
8
|
-
# Pull in all of the gems including those in the `test` group
|
9
|
-
require 'bundler'
|
10
|
-
Bundler.require :default, :test, :development
|
11
|
-
|
12
|
-
require 'middleman-presentation'
|
13
|
-
|
14
|
-
# Loading support files
|
15
|
-
Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
|
16
|
-
Dir.glob(::File.expand_path('../shared_examples/*.rb', __FILE__)).each { |f| require_relative f }
|
17
|
-
|
18
|
-
# Avoid writing "describe MyModule::MyClass do [..]" but "describe MyClass do [..]"
|
19
|
-
include Middleman::Presentation
|
data/spec/support/ci.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# Test helpers
|
4
|
-
require 'middleman-presentation/helpers/tests'
|
5
|
-
|
6
|
-
module Middleman
|
7
|
-
module Presentation
|
8
|
-
# Spec Helpers
|
9
|
-
module SpecHelper
|
10
|
-
# Helpers for ci
|
11
|
-
module Ci
|
12
|
-
include Middleman::Presentation::Helpers::Tests
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
RSpec.configure do |c|
|
19
|
-
c.include Middleman::Presentation::SpecHelper::Ci
|
20
|
-
end
|
data/spec/support/environment.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'fedux_org_stdlib/environment'
|
3
|
-
|
4
|
-
module Middleman
|
5
|
-
module Presentation
|
6
|
-
# Spec Helpers
|
7
|
-
module SpecHelper
|
8
|
-
# Helpers for environment
|
9
|
-
module Environment
|
10
|
-
include FeduxOrgStdlib::Environment
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
RSpec.configure do |c|
|
17
|
-
c.include Middleman::Presentation::SpecHelper::Environment
|
18
|
-
end
|
data/spec/support/filesystem.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'fedux_org_stdlib/filesystem'
|
3
|
-
|
4
|
-
module Middleman
|
5
|
-
module Presentation
|
6
|
-
module SpecHelper
|
7
|
-
# Helpers for filesystem
|
8
|
-
module Filesystem
|
9
|
-
include FeduxOrgStdlib::Filesystem
|
10
|
-
|
11
|
-
def root_directory
|
12
|
-
::File.expand_path('../../../', __FILE__)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
RSpec.configure do |c|
|
20
|
-
c.include Middleman::Presentation::SpecHelper::Filesystem
|
21
|
-
c.before(:each) { cleanup_working_directory }
|
22
|
-
end
|
data/spec/support/reporting.rb
DELETED
data/spec/support/rspec.rb
DELETED
data/spec/support/string.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Transformers::FileKeeper do
|
5
|
-
context '#transform' do
|
6
|
-
it 'removes directories from array and keep files' do
|
7
|
-
|
8
|
-
slide1 = instance_double('Middleman::Presentation::NewSlide')
|
9
|
-
allow(slide1).to receive(:path).and_return create_file('01.html.erb')
|
10
|
-
|
11
|
-
slide2 = instance_double('Middleman::Presentation::NewSlide')
|
12
|
-
allow(slide2).to receive(:path).and_return create_directory('01_dir')
|
13
|
-
|
14
|
-
slides = []
|
15
|
-
slides << slide2
|
16
|
-
slides << slide1
|
17
|
-
|
18
|
-
slides = Transformers::FileKeeper.new.transform(slides)
|
19
|
-
expect(slides).to include slide1
|
20
|
-
expect(slides).not_to include slide2
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Transformers::GroupSlides do
|
5
|
-
context '#initialize' do
|
6
|
-
it 'requires a base directory' do
|
7
|
-
template = double('Template')
|
8
|
-
allow(template).to receive(:result)
|
9
|
-
|
10
|
-
expect do
|
11
|
-
Transformers::GroupSlides.new(template: template)
|
12
|
-
end.not_to raise_error
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
context '#transforms' do
|
17
|
-
it 'groups slides with same group' do
|
18
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
19
|
-
allow(slide1).to receive(:group).and_return 'group'
|
20
|
-
allow(slide1).to receive(:group?).and_return true
|
21
|
-
allow(slide1).to receive(:render).and_return '01'
|
22
|
-
|
23
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
24
|
-
allow(slide2).to receive(:group).and_return 'group'
|
25
|
-
allow(slide2).to receive(:group?).and_return true
|
26
|
-
allow(slide2).to receive(:render).and_return '02'
|
27
|
-
|
28
|
-
slide3 = instance_double('Middleman::Presentation::ExistingSlide')
|
29
|
-
allow(slide3).to receive(:group).and_return nil
|
30
|
-
allow(slide3).to receive(:group?).and_return false
|
31
|
-
allow(slide3).to receive(:render).and_return '03'
|
32
|
-
|
33
|
-
transformer = Transformers::GroupSlides.new(template: Erubis::Eruby.new('<%= slides %>'))
|
34
|
-
result = transformer.transform [slide1, slide2, slide3]
|
35
|
-
|
36
|
-
expect(result).not_to include slide1
|
37
|
-
expect(result).not_to include slide2
|
38
|
-
expect(result).to include slide3
|
39
|
-
|
40
|
-
group = result.first
|
41
|
-
expect(group.render { |s| s }).to include "01\n02"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Transformers::IgnoreSlides do
|
5
|
-
context '#transform' do
|
6
|
-
it 'ignores slides based on file name' do
|
7
|
-
ignore_file = create_file '.slidesignore', <<-EOS.strip_heredoc
|
8
|
-
02.html.md
|
9
|
-
EOS
|
10
|
-
|
11
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
12
|
-
allow(slide1).to receive(:match?).and_return(false)
|
13
|
-
|
14
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
15
|
-
allow(slide2).to receive(:match?).and_return(false)
|
16
|
-
allow(slide2).to receive(:match?).with(/(?-mix:^!$)|(?-mix:02.html.md)/).and_return(true)
|
17
|
-
|
18
|
-
transformer = Transformers::IgnoreSlides.new ignore_file: ignore_file
|
19
|
-
result = transformer.transform([slide1, slide2])
|
20
|
-
|
21
|
-
expect(result).to include slide1
|
22
|
-
expect(result).not_to include slide2
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'unignores slides based on file name' do
|
26
|
-
ignore_file = create_file '.slidesignore', <<-EOS.strip_heredoc
|
27
|
-
.md$
|
28
|
-
!02.html.md
|
29
|
-
EOS
|
30
|
-
|
31
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
32
|
-
allow(slide1).to receive(:match?).with(/(?-mix:^!$)|(?-mix:.md$)/).and_return(false)
|
33
|
-
allow(slide1).to receive(:match?).with(/(?-mix:^!$)|(?-mix:02.html.md)/).and_return(true)
|
34
|
-
|
35
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
36
|
-
allow(slide2).to receive(:match?).with(/(?-mix:^!$)|(?-mix:.md$)/).and_return(true)
|
37
|
-
allow(slide2).to receive(:match?).with(/(?-mix:^!$)|(?-mix:02.html.md)/).and_return(true)
|
38
|
-
|
39
|
-
slide3 = instance_double('Middleman::Presentation::ExistingSlide')
|
40
|
-
allow(slide3).to receive(:match?).with(/(?-mix:^!$)|(?-mix:.md$)/).and_return(true)
|
41
|
-
allow(slide3).to receive(:match?).with(/(?-mix:^!$)|(?-mix:02.html.md)/).and_return(false)
|
42
|
-
|
43
|
-
transformer = Transformers::IgnoreSlides.new ignore_file: ignore_file
|
44
|
-
result = transformer.transform([slide1, slide2, slide3])
|
45
|
-
|
46
|
-
expect(result).to include slide1
|
47
|
-
expect(result).to include slide2
|
48
|
-
expect(result).not_to include slide3
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'handles non existing ignore file' do
|
52
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
53
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
54
|
-
slide3 = instance_double('Middleman::Presentation::ExistingSlide')
|
55
|
-
|
56
|
-
transformer = Transformers::IgnoreSlides.new ignore_file: SecureRandom.hex
|
57
|
-
result = transformer.transform([slide1, slide2, slide3])
|
58
|
-
|
59
|
-
expect(result).to include slide1
|
60
|
-
expect(result).to include slide2
|
61
|
-
expect(result).to include slide3
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Transformers::RemoveDuplicateSlides do
|
5
|
-
context '#transform' do
|
6
|
-
it 'removes similar slides: same basename but different file name' do
|
7
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
8
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
9
|
-
slide3 = instance_double('Middleman::Presentation::ExistingSlide')
|
10
|
-
|
11
|
-
allow(slide1).to receive(:eql?).with(slide1).and_return(true)
|
12
|
-
allow(slide1).to receive(:eql?).with(slide2).and_return(false)
|
13
|
-
allow(slide1).to receive(:eql?).with(slide3).and_return(false)
|
14
|
-
allow(slide1).to receive(:similar?).with(slide1).and_return(false)
|
15
|
-
allow(slide1).to receive(:similar?).with(slide2).and_return(true)
|
16
|
-
allow(slide1).to receive(:similar?).with(slide3).and_return(false)
|
17
|
-
|
18
|
-
allow(slide2).to receive(:eql?).with(slide1).and_return(false)
|
19
|
-
allow(slide2).to receive(:eql?).with(slide2).and_return(true)
|
20
|
-
allow(slide2).to receive(:eql?).with(slide3).and_return(false)
|
21
|
-
allow(slide2).to receive(:similar?).with(slide1).and_return(true)
|
22
|
-
allow(slide2).to receive(:similar?).with(slide2).and_return(false)
|
23
|
-
allow(slide2).to receive(:similar?).with(slide3).and_return(false)
|
24
|
-
|
25
|
-
allow(slide3).to receive(:eql?).with(slide1).and_return(false)
|
26
|
-
allow(slide3).to receive(:eql?).with(slide2).and_return(false)
|
27
|
-
allow(slide3).to receive(:eql?).with(slide3).and_return(true)
|
28
|
-
allow(slide3).to receive(:similar?).with(slide1).and_return(false)
|
29
|
-
allow(slide3).to receive(:similar?).with(slide2).and_return(false)
|
30
|
-
allow(slide3).to receive(:similar?).with(slide3).and_return(false)
|
31
|
-
|
32
|
-
transformer = Transformers::RemoveDuplicateSlides.new
|
33
|
-
result = transformer.transform([slide1, slide2, slide3])
|
34
|
-
|
35
|
-
expect(result).not_to include slide1
|
36
|
-
expect(result).not_to include slide2
|
37
|
-
expect(result).to include slide3
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'raises an error on similar slides' do
|
41
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
42
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
43
|
-
|
44
|
-
allow(slide1).to receive(:eql?).with(slide1).and_return(false)
|
45
|
-
allow(slide1).to receive(:eql?).with(slide2).and_return(false)
|
46
|
-
allow(slide1).to receive(:file_name).and_return('01.html.erb')
|
47
|
-
allow(slide1).to receive(:similar?).with(slide1).and_return(true)
|
48
|
-
allow(slide1).to receive(:similar?).with(slide2).and_return(true)
|
49
|
-
|
50
|
-
allow(slide2).to receive(:eql?).with(slide1).and_return(false)
|
51
|
-
allow(slide2).to receive(:eql?).with(slide2).and_return(false)
|
52
|
-
allow(slide2).to receive(:file_name).and_return('01.html.md')
|
53
|
-
allow(slide2).to receive(:similar?).with(slide1).and_return(true)
|
54
|
-
allow(slide2).to receive(:similar?).with(slide2).and_return(true)
|
55
|
-
|
56
|
-
transformer = Transformers::RemoveDuplicateSlides.new raise_error: true
|
57
|
-
|
58
|
-
expect do
|
59
|
-
transformer.transform([slide1, slide2])
|
60
|
-
end.to raise_error ArgumentError
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'considers additional slides which will be not part of the output' do
|
64
|
-
slide1 = instance_double('Middleman::Presentation::ExistingSlide')
|
65
|
-
slide2 = instance_double('Middleman::Presentation::ExistingSlide')
|
66
|
-
slide3 = instance_double('Middleman::Presentation::ExistingSlide')
|
67
|
-
slide4 = instance_double('Middleman::Presentation::ExistingSlide')
|
68
|
-
|
69
|
-
allow(slide1).to receive(:file_name).and_return '01.html.erb'
|
70
|
-
allow(slide1).to receive(:eql?).with(slide1).and_return(true)
|
71
|
-
allow(slide1).to receive(:eql?).with(slide2).and_return(true)
|
72
|
-
allow(slide1).to receive(:eql?).with(slide3).and_return(false)
|
73
|
-
allow(slide1).to receive(:eql?).with(slide4).and_return(false)
|
74
|
-
allow(slide1).to receive(:similar?).with(slide1).and_return(false)
|
75
|
-
allow(slide1).to receive(:similar?).with(slide2).and_return(true)
|
76
|
-
allow(slide1).to receive(:similar?).with(slide3).and_return(false)
|
77
|
-
allow(slide1).to receive(:similar?).with(slide4).and_return(false)
|
78
|
-
|
79
|
-
allow(slide2).to receive(:file_name).and_return '01.html.md'
|
80
|
-
allow(slide2).to receive(:eql?).with(slide1).and_return(false)
|
81
|
-
allow(slide2).to receive(:eql?).with(slide2).and_return(true)
|
82
|
-
allow(slide2).to receive(:eql?).with(slide3).and_return(false)
|
83
|
-
allow(slide2).to receive(:eql?).with(slide4).and_return(false)
|
84
|
-
allow(slide2).to receive(:similar?).with(slide1).and_return(true)
|
85
|
-
allow(slide2).to receive(:similar?).with(slide2).and_return(false)
|
86
|
-
allow(slide2).to receive(:similar?).with(slide3).and_return(false)
|
87
|
-
allow(slide2).to receive(:similar?).with(slide4).and_return(false)
|
88
|
-
|
89
|
-
allow(slide2).to receive(:file_name).and_return '02.html.md'
|
90
|
-
allow(slide3).to receive(:eql?).with(slide1).and_return(false)
|
91
|
-
allow(slide3).to receive(:eql?).with(slide2).and_return(false)
|
92
|
-
allow(slide3).to receive(:eql?).with(slide3).and_return(true)
|
93
|
-
allow(slide3).to receive(:eql?).with(slide4).and_return(false)
|
94
|
-
allow(slide3).to receive(:similar?).with(slide1).and_return(false)
|
95
|
-
allow(slide3).to receive(:similar?).with(slide2).and_return(false)
|
96
|
-
allow(slide3).to receive(:similar?).with(slide3).and_return(false)
|
97
|
-
allow(slide3).to receive(:similar?).with(slide4).and_return(false)
|
98
|
-
|
99
|
-
allow(slide2).to receive(:file_name).and_return '03.html.md'
|
100
|
-
allow(slide4).to receive(:eql?).with(slide1).and_return(false)
|
101
|
-
allow(slide4).to receive(:eql?).with(slide2).and_return(false)
|
102
|
-
allow(slide4).to receive(:eql?).with(slide3).and_return(false)
|
103
|
-
allow(slide4).to receive(:eql?).with(slide4).and_return(true)
|
104
|
-
allow(slide4).to receive(:similar?).with(slide1).and_return(false)
|
105
|
-
allow(slide4).to receive(:similar?).with(slide2).and_return(false)
|
106
|
-
allow(slide4).to receive(:similar?).with(slide3).and_return(false)
|
107
|
-
allow(slide4).to receive(:similar?).with(slide4).and_return(false)
|
108
|
-
|
109
|
-
transformer = Transformers::RemoveDuplicateSlides.new additional_slides: [slide2, slide4]
|
110
|
-
result = transformer.transform([slide1, slide3])
|
111
|
-
|
112
|
-
# slide1 cannot be part of output
|
113
|
-
# because a similar slide already exists
|
114
|
-
expect(result).not_to include slide1
|
115
|
-
expect(result).not_to include slide2
|
116
|
-
expect(result).not_to include slide4
|
117
|
-
expect(result).to include slide3
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe Transformers::SortSlides do
|
5
|
-
context '#transform' do
|
6
|
-
it 'sorts slides' do
|
7
|
-
slides = []
|
8
|
-
slides << 1
|
9
|
-
slides << 3
|
10
|
-
slides << 2
|
11
|
-
|
12
|
-
slides = Transformers::SortSlides.new.transform(slides)
|
13
|
-
expect(slides.first).to eq 1
|
14
|
-
expect(slides.last).to eq 3
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/templates/.bowerrc.tt
DELETED
data/templates/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
This is a stub. Please place the license or a link to the license for your presentation here.
|
data/templates/Rakefile
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler'
|
4
|
-
Bundler.require :default, :development
|
5
|
-
|
6
|
-
desc 'Start presentation'
|
7
|
-
task default: :start
|
8
|
-
|
9
|
-
desc 'Bootstrap presentation'
|
10
|
-
task :bootstrap do
|
11
|
-
sh 'script/bootstrap'
|
12
|
-
end
|
13
|
-
|
14
|
-
desc 'Start presentation'
|
15
|
-
task :start do
|
16
|
-
sh 'script/start'
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'Build presentation'
|
20
|
-
task :build do
|
21
|
-
sh 'script/build'
|
22
|
-
end
|
23
|
-
|
24
|
-
namespace :export do
|
25
|
-
desc 'Export presentation as tar-archive'
|
26
|
-
task :tar do
|
27
|
-
sh 'script/export'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
desc 'Export presentation as tar-archive'
|
32
|
-
task export: 'export:tar'
|
33
|
-
|
34
|
-
namespace :edit do
|
35
|
-
|
36
|
-
desc 'Edit all user defined slides'
|
37
|
-
task slides: 'slides:user_defined'
|
38
|
-
|
39
|
-
namespace :slides do
|
40
|
-
desc 'Edit all user-defined slides'
|
41
|
-
task :user_defined do
|
42
|
-
slides = Rake::FileList.new('source/slides/*') do |l|
|
43
|
-
l.exclude 'source/slides/999*'
|
44
|
-
end
|
45
|
-
|
46
|
-
sh "#{Middleman::Presentation.config.editor_command} #{slides.join(' ')}"
|
47
|
-
end
|
48
|
-
|
49
|
-
desc 'Edit all slides'
|
50
|
-
task :all do
|
51
|
-
slides = Rake::FileList.new('source/slides/*')
|
52
|
-
|
53
|
-
sh "#{Middleman::Presentation.config.editor_command} #{slides.join(' ')}"
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
desc 'Edit all user defined slides'
|
59
|
-
task edit: 'edit:slides'
|