middleman-presentation-core 0.16.0.rc1 → 0.16.0.rc2
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 +4 -4
- data/features/create_presentation-cli.feature +2 -3
- data/features/create_slide-cli.feature +2 -2
- data/features/support/aruba.rb +7 -11
- data/features/support/ci.rb +2 -2
- data/features/support/env.rb +1 -6
- data/features/support/fixtures.rb +2 -20
- data/features/support/reporting.rb +1 -1
- data/lib/middleman-presentation-core/application_config.rb +2 -2
- data/lib/middleman-presentation-core/cli/create_presentation.rb +1 -1
- data/lib/middleman-presentation-core/start.rb +1 -0
- data/lib/middleman-presentation-core/version.rb +1 -1
- data/lib/middleman-presentation-core.rb +0 -1
- data/middleman-presentation-core.gemspec +4 -1
- data/spec/support/aruba.rb +34 -38
- data/spec/support/ci.rb +7 -11
- data/spec/support/reporting.rb +1 -1
- data/templates/.bowerrc.tt +2 -1
- data/utils/server/server.darwin.amd64 +0 -0
- data/utils/server/server.linux.amd64 +0 -0
- data/utils/server/server.windows.amd64.exe +0 -0
- metadata +17 -9
- data/lib/middleman-presentation-core/step_definitions.rb +0 -251
- data/lib/middleman-presentation-core/test_helpers.rb +0 -22
- data/spec/support/environment.rb +0 -18
- data/spec/support/filesystem.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14a3718f05a00778bb5d3ebe177e1dcda20866dd
|
4
|
+
data.tar.gz: 1f762a184912a42c9a6165b88c186261b060fd28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d18bbfa635167eebc1509b02cca4c28d86442ca139862a8b8fac826e0da6fe518bd4a465a7a62c045b501866a9b07c0fc60ddce832c09fa1b3e906cc7d724530
|
7
|
+
data.tar.gz: b4cbce628a5c964e98f7f02614bcbf2be28f0926acf4d3f337efda5a4eb51057500004019da076be87f9440385b278d1faf7ced418b05a38253004a87d4e6e98
|
@@ -34,7 +34,7 @@ Feature: Initialize presentation
|
|
34
34
|
And a directory named "vendor/assets/components" should exist
|
35
35
|
And the file ".middleman-presentation.yaml" should contain:
|
36
36
|
"""
|
37
|
-
|
37
|
+
generated_presentation_id:
|
38
38
|
"""
|
39
39
|
And the file ".middleman-presentation.local.yaml" should contain:
|
40
40
|
"""
|
@@ -62,7 +62,6 @@ Feature: Initialize presentation
|
|
62
62
|
//= require lightbox2/js/lightbox
|
63
63
|
"""
|
64
64
|
|
65
|
-
@announce
|
66
65
|
Scenario: Initialize in test directory
|
67
66
|
Given I successfully run `middleman-presentation create presentation test/presentation1 --title "My Presentation"`
|
68
67
|
When I cd to "test/presentation1"
|
@@ -125,7 +124,7 @@ Feature: Initialize presentation
|
|
125
124
|
And I cd to "presentation1"
|
126
125
|
And the file ".middleman-presentation.yaml" should contain:
|
127
126
|
"""
|
128
|
-
|
127
|
+
generated_presentation_id: uoa
|
129
128
|
"""
|
130
129
|
|
131
130
|
Scenario: Use language from configuration file
|
@@ -131,14 +131,14 @@ Feature: Add new slide
|
|
131
131
|
"""
|
132
132
|
|
133
133
|
Scenario: Using eruby in editor command
|
134
|
-
When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command "echo <%=
|
134
|
+
When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command "echo <%= generated_presentation_id %>"`
|
135
135
|
Then the output should contain:
|
136
136
|
"""
|
137
137
|
my-presentation
|
138
138
|
"""
|
139
139
|
|
140
140
|
Scenario: Using eruby in editor command and shell escape
|
141
|
-
When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command "echo <%= Shellwords.shellescape(
|
141
|
+
When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command "echo <%= Shellwords.shellescape(generated_presentation_id) %>"`
|
142
142
|
Then the output should contain:
|
143
143
|
"""
|
144
144
|
my-presentation
|
data/features/support/aruba.rb
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'aruba/cucumber'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def dirs
|
11
|
-
@dirs ||= %w(tmp cucumber)
|
12
|
-
end
|
13
|
-
end
|
4
|
+
# Feature Helpers
|
5
|
+
module FeatureHelper
|
6
|
+
# Helpers for aruba
|
7
|
+
module Aruba
|
8
|
+
def dirs
|
9
|
+
@dirs ||= %w(tmp cucumber)
|
14
10
|
end
|
15
11
|
end
|
16
12
|
end
|
17
13
|
|
18
|
-
World(
|
14
|
+
World(FeatureHelper::Aruba)
|
data/features/support/ci.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
# Test helpers
|
2
|
-
require 'middleman-presentation-
|
3
|
-
World(Middleman::Presentation::
|
2
|
+
require 'middleman-presentation-helpers/test_helpers'
|
3
|
+
World(Middleman::Presentation::Helpers::Test)
|
data/features/support/env.rb
CHANGED
@@ -8,12 +8,7 @@ SimpleCov.start
|
|
8
8
|
# middleman
|
9
9
|
require 'middleman-core'
|
10
10
|
require 'middleman-core/step_definitions'
|
11
|
-
require 'middleman-
|
12
|
-
require 'middleman-core/step_definitions/middleman_steps'
|
13
|
-
# require 'middleman-presentation-core/middleman_step_definitions'
|
14
|
-
|
15
|
-
# middleman-presentation
|
16
|
-
require 'middleman-presentation-core/step_definitions'
|
11
|
+
require 'middleman-presentation-helpers/step_definitions'
|
17
12
|
|
18
13
|
# Pull in all of the gems including those in the `test` group
|
19
14
|
require 'bundler'
|
@@ -1,21 +1,3 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
module FeatureHelper
|
5
|
-
# Helper for fixtures
|
6
|
-
module Fixtures
|
7
|
-
def fixtures_manager
|
8
|
-
@fixtures_manager ||= FeduxOrgStdlib::FixturesManagement::FixturesManager.new
|
9
|
-
|
10
|
-
@fixtures_manager.load_fixtures(File.expand_path('../../../fixtures', __FILE__))
|
11
|
-
|
12
|
-
@fixtures_manager
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
World(Middleman::Presentation::FeatureHelper::Fixtures)
|
20
|
-
|
21
|
-
FileUtils.rm_rf Middleman::Presentation::TestHelpers.temporary_fixture_path('.')
|
2
|
+
require 'middleman-presentation-helpers/test_helpers'
|
3
|
+
FileUtils.rm_rf Middleman::Presentation::Helpers::Test.temporary_fixture_path('.')
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require '
|
2
|
+
require 'fedux_org_stdlib/core_ext/kernel/reporting'
|
@@ -9,7 +9,7 @@ module Middleman
|
|
9
9
|
|
10
10
|
option :title, nil
|
11
11
|
option :subtitle, nil
|
12
|
-
option :
|
12
|
+
option :generated_presentation_id, nil
|
13
13
|
option :version, 'v0.0.1'
|
14
14
|
option :smart_quotes, %w(rdquo rsquo ldquo rdquo)
|
15
15
|
|
@@ -143,7 +143,7 @@ module Middleman
|
|
143
143
|
parallax_background_size
|
144
144
|
phone_number
|
145
145
|
preview_links
|
146
|
-
|
146
|
+
generated_presentation_id
|
147
147
|
speaker
|
148
148
|
subtitle
|
149
149
|
title
|
@@ -118,7 +118,7 @@ module Middleman
|
|
118
118
|
Middleman::Presentation.config.github_url = options[:github_url]
|
119
119
|
|
120
120
|
Middleman::Presentation.config.version = options[:version]
|
121
|
-
Middleman::Presentation.config.
|
121
|
+
Middleman::Presentation.config.generated_presentation_id = format '%s-%s', options[:title].characterize, SecureRandom.hex
|
122
122
|
|
123
123
|
Middleman::Presentation.config.width = options[:width]
|
124
124
|
Middleman::Presentation.config.height = options[:height]
|
@@ -122,7 +122,6 @@ require 'middleman-presentation-core/cli/init'
|
|
122
122
|
require 'middleman-presentation-core/cli/runner'
|
123
123
|
|
124
124
|
require 'middleman-presentation-core/utils'
|
125
|
-
require 'middleman-presentation-core/test_helpers'
|
126
125
|
|
127
126
|
require 'middleman-presentation-core/middleman_extension'
|
128
127
|
require 'middleman-presentation-core/register_extension'
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
|
2
|
+
lib = File.expand_path('../../middleman-presentation-core/lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
3
5
|
require 'middleman-presentation-core/version'
|
4
6
|
|
5
7
|
Gem::Specification.new do |spec|
|
@@ -21,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
21
23
|
|
22
24
|
spec.add_dependency 'middleman', '~> 3.3.5'
|
23
25
|
spec.add_dependency 'middleman-sprockets', '~> 3.3.8'
|
26
|
+
spec.add_dependency 'middleman-minify-html'
|
24
27
|
spec.add_dependency 'bundler'
|
25
28
|
spec.add_dependency 'tzinfo', '>= 0.3.0'
|
26
29
|
spec.add_dependency 'addressable', '~> 2.3.5'
|
data/spec/support/aruba.rb
CHANGED
@@ -2,50 +2,46 @@
|
|
2
2
|
require 'aruba/api'
|
3
3
|
require 'aruba/reporting'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
_mkdir(File.dirname(file_name))
|
37
|
-
FileUtils.touch file_name
|
38
|
-
end
|
39
|
-
|
40
|
-
file_name
|
41
|
-
end
|
5
|
+
# Spec Helpers
|
6
|
+
module SpecHelper
|
7
|
+
# Helpers for aruba
|
8
|
+
module Aruba
|
9
|
+
include ::Aruba::Api
|
10
|
+
|
11
|
+
def dirs
|
12
|
+
@dirs ||= %w(tmp rspec)
|
13
|
+
end
|
14
|
+
|
15
|
+
def absolute_path(*args)
|
16
|
+
in_current_dir { File.expand_path File.join(*args) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def _create_file(*args)
|
20
|
+
super
|
21
|
+
|
22
|
+
args.first
|
23
|
+
end
|
24
|
+
|
25
|
+
def create_dir(*args)
|
26
|
+
super
|
27
|
+
|
28
|
+
args.first
|
29
|
+
end
|
30
|
+
|
31
|
+
def touch_file(file_name)
|
32
|
+
in_current_dir do
|
33
|
+
file_name = File.expand_path(file_name)
|
34
|
+
_mkdir(File.dirname(file_name))
|
35
|
+
FileUtils.touch file_name
|
42
36
|
end
|
37
|
+
|
38
|
+
file_name
|
43
39
|
end
|
44
40
|
end
|
45
41
|
end
|
46
42
|
|
47
43
|
RSpec.configure do |c|
|
48
|
-
c.include
|
44
|
+
c.include SpecHelper::Aruba
|
49
45
|
c.before :each do
|
50
46
|
clean_current_dir
|
51
47
|
restore_env
|
data/spec/support/ci.rb
CHANGED
@@ -1,20 +1,16 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
# Test helpers
|
4
|
-
require 'middleman-presentation-
|
4
|
+
require 'middleman-presentation-helpers/test_helpers'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
module Ci
|
12
|
-
include Middleman::Presentation::TestHelpers
|
13
|
-
end
|
14
|
-
end
|
6
|
+
# Spec Helpers
|
7
|
+
module SpecHelper
|
8
|
+
# Helpers for ci
|
9
|
+
module Ci
|
10
|
+
include Middleman::Presentation::Helpers::Test
|
15
11
|
end
|
16
12
|
end
|
17
13
|
|
18
14
|
RSpec.configure do |c|
|
19
|
-
c.include
|
15
|
+
c.include SpecHelper::Ci
|
20
16
|
end
|
data/spec/support/reporting.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require '
|
2
|
+
require 'fedux_org_stdlib/core_ext/kernel/reporting'
|
data/templates/.bowerrc.tt
CHANGED
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-presentation-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.0.
|
4
|
+
version: 0.16.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 3.3.8
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: middleman-minify-html
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: bundler
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -391,9 +405,7 @@ files:
|
|
391
405
|
- lib/middleman-presentation-core/slide_list.rb
|
392
406
|
- lib/middleman-presentation-core/slide_name.rb
|
393
407
|
- lib/middleman-presentation-core/start.rb
|
394
|
-
- lib/middleman-presentation-core/step_definitions.rb
|
395
408
|
- lib/middleman-presentation-core/syntax_highlighter.rb
|
396
|
-
- lib/middleman-presentation-core/test_helpers.rb
|
397
409
|
- lib/middleman-presentation-core/transformers/file_keeper.rb
|
398
410
|
- lib/middleman-presentation-core/transformers/group_slides.rb
|
399
411
|
- lib/middleman-presentation-core/transformers/ignore_slides.rb
|
@@ -425,8 +437,6 @@ files:
|
|
425
437
|
- spec/spec_helper.rb
|
426
438
|
- spec/support/aruba.rb
|
427
439
|
- spec/support/ci.rb
|
428
|
-
- spec/support/environment.rb
|
429
|
-
- spec/support/filesystem.rb
|
430
440
|
- spec/support/locale.rb
|
431
441
|
- spec/support/reporting.rb
|
432
442
|
- spec/support/rspec.rb
|
@@ -504,7 +514,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
504
514
|
version: 1.3.1
|
505
515
|
requirements: []
|
506
516
|
rubyforge_project:
|
507
|
-
rubygems_version: 2.4.
|
517
|
+
rubygems_version: 2.4.5
|
508
518
|
signing_key:
|
509
519
|
specification_version: 4
|
510
520
|
summary: Presentation engine for Middleman
|
@@ -569,8 +579,6 @@ test_files:
|
|
569
579
|
- spec/spec_helper.rb
|
570
580
|
- spec/support/aruba.rb
|
571
581
|
- spec/support/ci.rb
|
572
|
-
- spec/support/environment.rb
|
573
|
-
- spec/support/filesystem.rb
|
574
582
|
- spec/support/locale.rb
|
575
583
|
- spec/support/reporting.rb
|
576
584
|
- spec/support/rspec.rb
|
@@ -1,251 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
Before do
|
3
|
-
@aruba_timeout_seconds = 120
|
4
|
-
ENV['MM_ENV'] = 'development'
|
5
|
-
ENV['MP_ENV'] = 'test'
|
6
|
-
|
7
|
-
step 'a mocked home directory'
|
8
|
-
step 'I configure bundler for fast testing'
|
9
|
-
step 'git is configured with username "User" and email-address "email@example.com"'
|
10
|
-
step 'I set the language for the shell to "en_GB.UTF-8"'
|
11
|
-
end
|
12
|
-
|
13
|
-
Given(/I configure bundler for fast testing/) do
|
14
|
-
config = []
|
15
|
-
config << "BUNDLE_PATH: #{ENV['BUNDLE_PATH']}" if ENV.key? 'BUNDLE_PATH'
|
16
|
-
|
17
|
-
config_file = File.join ENV['HOME'], '.bundle', 'config'
|
18
|
-
|
19
|
-
FileUtils.mkdir_p File.dirname(config_file)
|
20
|
-
File.write config_file, config.join("\n")
|
21
|
-
end
|
22
|
-
|
23
|
-
# Clean environment
|
24
|
-
Around do |_, block|
|
25
|
-
old_env = ENV.to_h
|
26
|
-
|
27
|
-
block.call
|
28
|
-
|
29
|
-
ENV.replace old_env
|
30
|
-
end
|
31
|
-
|
32
|
-
When(/^I start debugging/) do
|
33
|
-
# rubocop:disable Lint/Debugger
|
34
|
-
require 'pry'
|
35
|
-
binding.pry
|
36
|
-
# rubocop:enable Lint/Debugger
|
37
|
-
|
38
|
-
''
|
39
|
-
end
|
40
|
-
|
41
|
-
Given(/^I use presentation fixture "([^"]+)" with title "([^"]+)"(?: and date "([^"]+)")?$/) do |name, title, date|
|
42
|
-
directory = []
|
43
|
-
directory << name
|
44
|
-
directory << ('-' + title)
|
45
|
-
directory << ('-' + date) if date
|
46
|
-
|
47
|
-
directory = directory.join.characterize
|
48
|
-
|
49
|
-
command = []
|
50
|
-
command << "middleman-presentation create presentation #{temporary_fixture_path(directory)}"
|
51
|
-
command << "--title #{Shellwords.escape(title)}"
|
52
|
-
command << "--date #{Shellwords.escape(date)}" if date
|
53
|
-
|
54
|
-
system(command.join(' ')) unless temporary_fixture_exist?(directory)
|
55
|
-
|
56
|
-
FileUtils.cp_r temporary_fixture_path(directory), absolute_path(name)
|
57
|
-
step %(I cd to "#{name}")
|
58
|
-
end
|
59
|
-
|
60
|
-
Given(/^I set the language for the shell to "([^"]+)"$/) do |language|
|
61
|
-
set_env 'LANG', language
|
62
|
-
end
|
63
|
-
|
64
|
-
Given(/only the executables of gems "([^"]+)" can be found in PATH/) do |gems|
|
65
|
-
dirs = []
|
66
|
-
gem_names = gems.split(/,\s?/).map(&:strip)
|
67
|
-
|
68
|
-
dirs.concat(
|
69
|
-
gem_names.each_with_object([]) do |e, a|
|
70
|
-
gem = Gem::Specification.each.find { |s| s.name == e }
|
71
|
-
|
72
|
-
fail if gem.blank?
|
73
|
-
|
74
|
-
a << gem.bin_dir
|
75
|
-
end
|
76
|
-
)
|
77
|
-
|
78
|
-
if ci?
|
79
|
-
dirs << "/home/travis/.rvm/rubies/ruby-#{RUBY_VERSION}/bin"
|
80
|
-
dirs << "/home/travis/.rvm/rubies/ruby-#{Gem.ruby_api_version}/bin" unless Gem.ruby_api_version == RUBY_VERSION
|
81
|
-
end
|
82
|
-
|
83
|
-
dirs << '/usr/bin'
|
84
|
-
|
85
|
-
set_env 'PATH', dirs.join(':')
|
86
|
-
end
|
87
|
-
|
88
|
-
Given(/^I create a new presentation with title "([^"]+)"(?: for speaker "([^"]+)")?(?: on "([^"]+)")?$/) do |title, speaker, date|
|
89
|
-
options = {}
|
90
|
-
options[:title] = title
|
91
|
-
options[:speaker] = speaker if speaker
|
92
|
-
options[:date] = date if date
|
93
|
-
|
94
|
-
step %(I successfully run `middleman-presentation create presentation presentation1 #{options.to_options.join(' ')}`)
|
95
|
-
step 'I cd to "presentation1"'
|
96
|
-
end
|
97
|
-
|
98
|
-
Given(/^I prepend "([^"]+)" to environment variable "([^"]+)"$/) do |value, variable|
|
99
|
-
set_env variable, value + ENV[variable]
|
100
|
-
end
|
101
|
-
|
102
|
-
Given(/^a slide named "(.*?)" with:$/) do |name, string|
|
103
|
-
step %(a file named "source/slides/#{name}" with:), string
|
104
|
-
end
|
105
|
-
|
106
|
-
Given(/^a project template named "(.*?)" with:$/) do |name, string|
|
107
|
-
step %(a file named "templates/#{name}" with:), string
|
108
|
-
end
|
109
|
-
|
110
|
-
Given(/^a user template named "(.*?)" with:$/) do |name, string|
|
111
|
-
step %(a file named "~/.config/middleman-presentation/templates/#{name}" with:), string
|
112
|
-
end
|
113
|
-
|
114
|
-
Given(/^a user defined predefined slide named "(.*?)" with:$/) do |name, string|
|
115
|
-
step %(a file named "~/.config/middleman-presentation/predefined_slides.d/#{name}" with:), string
|
116
|
-
end
|
117
|
-
|
118
|
-
Given(/^a presentation theme named "(.*?)" does not exist$/) do |name|
|
119
|
-
step %(I remove the directory "middleman-presentation-theme-#{name}")
|
120
|
-
end
|
121
|
-
|
122
|
-
Given(/^a file named "(.*?)" does not exist$/) do |name|
|
123
|
-
FileUtils.rm_rf absolute_path(name)
|
124
|
-
end
|
125
|
-
|
126
|
-
Given(/^a directory named "(.*?)" does not exist$/) do |name|
|
127
|
-
step %(I remove the directory "#{name}")
|
128
|
-
end
|
129
|
-
|
130
|
-
Given(/^a plugin named "(.*?)" does not exist$/) do |name|
|
131
|
-
step %(I remove the directory "#{name}")
|
132
|
-
end
|
133
|
-
|
134
|
-
Then(%r{^a plugin named "(.*?)" should exist( with default files/directories created)?$}) do |name, default_files|
|
135
|
-
step %(a directory named "#{name}" should exist)
|
136
|
-
|
137
|
-
if default_files
|
138
|
-
%W(
|
139
|
-
#{name}/#{name}.gemspec
|
140
|
-
#{name}/lib/#{name}.rb
|
141
|
-
#{name}/lib/#{name}/version.rb
|
142
|
-
#{name}/Gemfile
|
143
|
-
#{name}/LICENSE.txt
|
144
|
-
#{name}/README.md
|
145
|
-
#{name}/Rakefile
|
146
|
-
#{name}/.gitignore
|
147
|
-
).each do |file|
|
148
|
-
step %(a file named "#{file}" should exist)
|
149
|
-
end
|
150
|
-
|
151
|
-
%W(
|
152
|
-
#{name}/lib
|
153
|
-
#{name}/lib/#{name}
|
154
|
-
).each do |file|
|
155
|
-
step %(a directory named "#{file}" should exist)
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
Given(/^git is configured with username "(.*?)" and email-address "(.*?)"$/) do |name, email|
|
161
|
-
step %(I successfully run `git config --global user.email "#{email}"`)
|
162
|
-
step %(I successfully run `git config --global user.name "#{name}"`)
|
163
|
-
end
|
164
|
-
|
165
|
-
Given(/^a user config file for middleman\-presentation with:$/) do |string|
|
166
|
-
step 'a file named "~/.config/middleman-presentation/application.yaml" with:', string
|
167
|
-
end
|
168
|
-
|
169
|
-
Given(/^a presentation config file for middleman\-presentation with:$/) do |string|
|
170
|
-
step 'a file named ".middleman-presentation.yaml" with:', string
|
171
|
-
end
|
172
|
-
|
173
|
-
Then(/^the user config file for middleman\-presentation should contain:$/) do |string|
|
174
|
-
step 'the file "~/.config/middleman-presentation/application.yaml" should contain:', string
|
175
|
-
end
|
176
|
-
|
177
|
-
Then(/^the presentation config file for middleman\-presentation should contain:$/) do |string|
|
178
|
-
step 'the file ".middleman-presentation.yaml" should contain:', string
|
179
|
-
end
|
180
|
-
|
181
|
-
Then(%r{^a presentation theme named "(.*?)" should exist( with default files/directories created)?$}) do |name, default_files|
|
182
|
-
name = "middleman-presentation-theme-#{name}"
|
183
|
-
|
184
|
-
step %(a directory named "#{name}" should exist)
|
185
|
-
|
186
|
-
if default_files
|
187
|
-
step %(a directory named "#{name}/stylesheets" should exist)
|
188
|
-
step %(a directory named "#{name}/javascripts" should exist)
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
|
-
Then(/^I go to "([^"]*)" and see the following error message:$/) do |url, message|
|
193
|
-
message = capture :stderr do
|
194
|
-
# rubocop:disable Lint/HandleExceptions:
|
195
|
-
begin
|
196
|
-
@browser.get(URI.escape(url))
|
197
|
-
rescue StandardError
|
198
|
-
end
|
199
|
-
# rubocop:enable Lint/HandleExceptions:
|
200
|
-
end
|
201
|
-
|
202
|
-
expect(message).to include message
|
203
|
-
end
|
204
|
-
|
205
|
-
Then(/^a directory named "(.*?)" is a git repository$/) do |name|
|
206
|
-
step %(a directory named "#{name}/.git" should exist)
|
207
|
-
end
|
208
|
-
|
209
|
-
Given(/^a slide named "(.*?)" does not exist$/) do |name|
|
210
|
-
FileUtils.rm_rf absolute_path('source', 'slides', name)
|
211
|
-
end
|
212
|
-
|
213
|
-
Then(/^a slide named "(.*?)" should exist$/) do |name|
|
214
|
-
step %(a file named "source/slides/#{name}" should exist)
|
215
|
-
end
|
216
|
-
|
217
|
-
Then(/^a slide named "(.*?)" should exist with:$/) do |name, string|
|
218
|
-
step %(the file "source/slides/#{name}" should contain:), string
|
219
|
-
end
|
220
|
-
|
221
|
-
When(/^I successfully run `([^`]+)` in clean environment$/) do |command|
|
222
|
-
Bundler.with_clean_env do
|
223
|
-
step %(I successfully run `#{command}`)
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
Given(/^I add a stylesheet asset named "(.*?)" to the presentation$/) do |asset|
|
228
|
-
import_string = "@import '#{asset}';"
|
229
|
-
|
230
|
-
step 'I append to "source/stylesheets/application.scss" with:', import_string
|
231
|
-
end
|
232
|
-
|
233
|
-
When(/^I successfully run `([^`]+)` in debug mode$/) do |cmd|
|
234
|
-
step "I run `#{cmd}` in debug mode"
|
235
|
-
end
|
236
|
-
|
237
|
-
When(/^I run `([^`]+)` in debug mode$/) do |cmd|
|
238
|
-
in_current_dir do
|
239
|
-
# rubocop:disable Lint/Debugger
|
240
|
-
require 'pry'
|
241
|
-
binding.pry
|
242
|
-
# rubocop:enable Lint/Debugger
|
243
|
-
system(cmd)
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
Then(/^the size of "(.*?)" should be much smaller than from "(.*?)"$/) do |file1, file2|
|
248
|
-
in_current_dir do
|
249
|
-
expect(File.size(file1)).to be < File.size(file2)
|
250
|
-
end
|
251
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
module Middleman
|
3
|
-
module Presentation
|
4
|
-
# Test helpers
|
5
|
-
module TestHelpers
|
6
|
-
# Helpers for tests
|
7
|
-
def ci?
|
8
|
-
ENV.key?('CI') || ENV.key?('TRAVIS')
|
9
|
-
end
|
10
|
-
|
11
|
-
def temporary_fixture_path(name)
|
12
|
-
File.expand_path("../../../tmp/fixtures/#{name}", __FILE__)
|
13
|
-
end
|
14
|
-
|
15
|
-
def temporary_fixture_exist?(name)
|
16
|
-
File.exist? File.expand_path("../../../tmp/fixtures/#{name}", __FILE__)
|
17
|
-
end
|
18
|
-
|
19
|
-
module_function :temporary_fixture_path
|
20
|
-
end
|
21
|
-
end
|
22
|
-
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
|