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
@@ -1,27 +0,0 @@
|
|
1
|
-
Feature: Configuration
|
2
|
-
|
3
|
-
As a presentator
|
4
|
-
I want to a list of configuration options
|
5
|
-
In order to use it
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given a mocked home directory
|
9
|
-
And git is configured with username "User" and email-address "email@example.com"
|
10
|
-
And a user config file for middleman-presentation with:
|
11
|
-
"""
|
12
|
-
slides_ignore_file: '.ignore'
|
13
|
-
"""
|
14
|
-
|
15
|
-
Scenario: Show config
|
16
|
-
When I successfully run `middleman-presentation show config`
|
17
|
-
Then the output should contain:
|
18
|
-
"""
|
19
|
-
.ignore
|
20
|
-
"""
|
21
|
-
|
22
|
-
Scenario: Show config with default values
|
23
|
-
When I successfully run `middleman-presentation show config --defaults`
|
24
|
-
Then the output should contain:
|
25
|
-
"""
|
26
|
-
.slidesignore
|
27
|
-
"""
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Feature: Show available default css classes
|
2
|
-
|
3
|
-
As a presentator
|
4
|
-
I want to get a list of css classess which are used in default templates
|
5
|
-
In order to know what needs to be defined
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given a mocked home directory
|
9
|
-
And git is configured with username "User" and email-address "email@example.com"
|
10
|
-
|
11
|
-
Scenario: Available css classes
|
12
|
-
Given I successfully run `middleman-presentation show style`
|
13
|
-
Then the output should contain:
|
14
|
-
"""
|
15
|
-
Available css classes in templates used by middleman-presentation:
|
16
|
-
"""
|
17
|
-
And the output should contain:
|
18
|
-
"""
|
19
|
-
mp-external-url: "999981.html.erb.tt"
|
20
|
-
"""
|
21
|
-
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Feature: Show information
|
2
|
-
|
3
|
-
As a user
|
4
|
-
I want to get information about the system
|
5
|
-
In order to provide them for support
|
6
|
-
|
7
|
-
Scenario: Show support information
|
8
|
-
When I successfully run `middleman-presentation show support_information`
|
9
|
-
Then the output should contain:
|
10
|
-
"""
|
11
|
-
kernelversion
|
12
|
-
"""
|
data/features/slide-cli.feature
DELETED
@@ -1,311 +0,0 @@
|
|
1
|
-
Feature: Add new slide
|
2
|
-
|
3
|
-
As a presentator
|
4
|
-
I want to add a new slide
|
5
|
-
In order do build it
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given a mocked home directory
|
9
|
-
And git is configured with username "User" and email-address "email@example.com"
|
10
|
-
And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
|
11
|
-
And I cd to "presentation1"
|
12
|
-
|
13
|
-
Scenario: Custom Slide
|
14
|
-
When I successfully run `middleman slide 01`
|
15
|
-
Then the following files should exist:
|
16
|
-
| source/slides/01.html.md |
|
17
|
-
|
18
|
-
Scenario: Embedded Ruby Slide
|
19
|
-
When I successfully run `middleman slide 01.erb`
|
20
|
-
Then the following files should exist:
|
21
|
-
| source/slides/01.html.erb |
|
22
|
-
|
23
|
-
Scenario: Markdown Slide
|
24
|
-
When I successfully run `middleman slide 01.md`
|
25
|
-
Then the following files should exist:
|
26
|
-
| source/slides/01.html.md |
|
27
|
-
|
28
|
-
Scenario: Liquid Slide
|
29
|
-
When I successfully run `middleman slide 01.l`
|
30
|
-
Then the following files should exist:
|
31
|
-
| source/slides/01.html.liquid |
|
32
|
-
|
33
|
-
Scenario: Liquid Slide (long file extension)
|
34
|
-
When I successfully run `middleman slide 01.liquid`
|
35
|
-
Then the following files should exist:
|
36
|
-
| source/slides/01.html.liquid |
|
37
|
-
|
38
|
-
Scenario: Markdown Slide (long file extension)
|
39
|
-
When I successfully run `middleman slide 01.markdown`
|
40
|
-
Then the following files should exist:
|
41
|
-
| source/slides/01.html.md |
|
42
|
-
|
43
|
-
Scenario: Open slide with ENV['EDITOR'] after creation
|
44
|
-
When I successfully run `middleman slide 01.markdown --edit --editor-command echo`
|
45
|
-
Then the following files should exist:
|
46
|
-
| source/slides/01.html.md |
|
47
|
-
And the output should contain:
|
48
|
-
"""
|
49
|
-
01.html.md
|
50
|
-
"""
|
51
|
-
|
52
|
-
Scenario: Create multiple slides
|
53
|
-
When I successfully run `middleman slide 01 02`
|
54
|
-
Then the following files should exist:
|
55
|
-
| source/slides/01.html.md |
|
56
|
-
| source/slides/02.html.md |
|
57
|
-
|
58
|
-
Scenario: Edit existing slide with ENV['EDITOR']
|
59
|
-
And a slide named "02.html.md" with:
|
60
|
-
"""
|
61
|
-
<section>
|
62
|
-
<h1>Headline</h1>
|
63
|
-
</section>
|
64
|
-
"""
|
65
|
-
When I successfully run `middleman slide 02 --edit --editor-command echo`
|
66
|
-
And the output should contain:
|
67
|
-
"""
|
68
|
-
02.html.md
|
69
|
-
"""
|
70
|
-
|
71
|
-
Scenario: Edit non-existing slide with ENV['EDITOR']
|
72
|
-
When I successfully run `middleman slide 02 --edit --editor-command echo`
|
73
|
-
And the output should contain:
|
74
|
-
"""
|
75
|
-
create
|
76
|
-
"""
|
77
|
-
And the output should contain:
|
78
|
-
"""
|
79
|
-
02.html.md
|
80
|
-
"""
|
81
|
-
|
82
|
-
Scenario: Edit mixing existing and non-existing slides with ENV['EDITOR']
|
83
|
-
And a slide named "02.html.md" with:
|
84
|
-
"""
|
85
|
-
<section>
|
86
|
-
<h1>Headline</h1>
|
87
|
-
</section>
|
88
|
-
"""
|
89
|
-
When I successfully run `middleman slide 02 03 --edit --editor-command echo`
|
90
|
-
And the output should contain:
|
91
|
-
"""
|
92
|
-
02.html.md
|
93
|
-
"""
|
94
|
-
And the output should contain:
|
95
|
-
"""
|
96
|
-
03.html.md
|
97
|
-
"""
|
98
|
-
|
99
|
-
Scenario: Edit existing multiple slides with ENV['EDITOR']
|
100
|
-
And a slide named "02.html.md" with:
|
101
|
-
"""
|
102
|
-
<section>
|
103
|
-
<h1>Headline</h1>
|
104
|
-
</section>
|
105
|
-
"""
|
106
|
-
And a slide named "03.html.md" with:
|
107
|
-
"""
|
108
|
-
<section>
|
109
|
-
<h1>Headline</h1>
|
110
|
-
</section>
|
111
|
-
"""
|
112
|
-
When I successfully run `middleman slide 02 03 --edit --editor-command echo`
|
113
|
-
And the output should contain:
|
114
|
-
"""
|
115
|
-
02.html.md
|
116
|
-
"""
|
117
|
-
And the output should contain:
|
118
|
-
"""
|
119
|
-
03.html.md
|
120
|
-
"""
|
121
|
-
|
122
|
-
Scenario: Fails on duplicate slide names
|
123
|
-
When I run `middleman slide 02.erb 02.md 03.erb 03.md 03.liquid`
|
124
|
-
And the output should contain:
|
125
|
-
"""
|
126
|
-
Your input will result in duplicate slide file names: "02.html.md", "02.html.erb", "03.html.md", "03.html.liquid", "03.html.erb", "03.html.liquid", "03.html.erb", "03.html.md"
|
127
|
-
"""
|
128
|
-
|
129
|
-
Scenario: Missing slide name
|
130
|
-
When I run `middleman slide`
|
131
|
-
Then the output should contain:
|
132
|
-
"""
|
133
|
-
You need to define argument "name"
|
134
|
-
"""
|
135
|
-
|
136
|
-
Scenario: Using eruby in editor command
|
137
|
-
When I successfully run `middleman slide 02 03 --edit --editor-command "echo <%= project_id %>"`
|
138
|
-
Then the output should contain:
|
139
|
-
"""
|
140
|
-
my-presentation
|
141
|
-
"""
|
142
|
-
|
143
|
-
Scenario: Using eruby in editor command and shell escape
|
144
|
-
When I successfully run `middleman slide 02 03 --edit --editor-command "echo <%= Shellwords.shellescape(project_id) %>"`
|
145
|
-
Then the output should contain:
|
146
|
-
"""
|
147
|
-
my-presentation
|
148
|
-
"""
|
149
|
-
|
150
|
-
Scenario: Use * expansion in shell to open slides
|
151
|
-
And a slide named "02.html.md" with:
|
152
|
-
"""
|
153
|
-
<section>
|
154
|
-
<h1>Headline</h1>
|
155
|
-
</section>
|
156
|
-
"""
|
157
|
-
When I successfully run `middleman slide source/slides/* --edit --editor-command echo`
|
158
|
-
And the output should contain:
|
159
|
-
"""
|
160
|
-
02.html.md
|
161
|
-
"""
|
162
|
-
|
163
|
-
Scenario: Project Erb Slide template
|
164
|
-
And a project template named "erb.tt" with:
|
165
|
-
"""
|
166
|
-
<section>
|
167
|
-
<h1>New Template</h1>
|
168
|
-
<h2><%= title %></h2>
|
169
|
-
</section>
|
170
|
-
"""
|
171
|
-
When I successfully run `middleman slide 01.erb --title "My Title"`
|
172
|
-
Then a slide named "01.html.erb" exist with:
|
173
|
-
"""
|
174
|
-
<section>
|
175
|
-
<h1>New Template</h1>
|
176
|
-
<h2>My Title</h2>
|
177
|
-
</section>
|
178
|
-
"""
|
179
|
-
|
180
|
-
Scenario: Project Markdown Slide template
|
181
|
-
And a project template named "markdown.tt" with:
|
182
|
-
"""
|
183
|
-
<section>
|
184
|
-
# New Template
|
185
|
-
## <%= title %>
|
186
|
-
</section>
|
187
|
-
"""
|
188
|
-
When I successfully run `middleman slide 01.md --title "My Title"`
|
189
|
-
Then a slide named "01.html.md" exist with:
|
190
|
-
"""
|
191
|
-
<section>
|
192
|
-
# New Template
|
193
|
-
## My Title
|
194
|
-
</section>
|
195
|
-
"""
|
196
|
-
|
197
|
-
Scenario: Project Liquid Slide template
|
198
|
-
And a project template named "liquid.tt" with:
|
199
|
-
"""
|
200
|
-
<section>
|
201
|
-
<h1>{{ page_title }}</h1>
|
202
|
-
<h2><%= title %><h2>
|
203
|
-
</section>
|
204
|
-
"""
|
205
|
-
When I successfully run `middleman slide 01.liquid --title "My Title"`
|
206
|
-
Then a slide named "01.html.liquid" exist with:
|
207
|
-
"""
|
208
|
-
<section>
|
209
|
-
<h1>{{ page_title }}</h1>
|
210
|
-
<h2>My Title<h2>
|
211
|
-
</section>
|
212
|
-
"""
|
213
|
-
|
214
|
-
Scenario: User template
|
215
|
-
Given a user template named "liquid.tt" with:
|
216
|
-
"""
|
217
|
-
<section>
|
218
|
-
<h1>{{ page_title }}</h1>
|
219
|
-
<h2><%= title %><h2>
|
220
|
-
</section>
|
221
|
-
"""
|
222
|
-
When I successfully run `middleman slide 01.liquid --title "My Title"`
|
223
|
-
Then a slide named "01.html.liquid" exist with:
|
224
|
-
"""
|
225
|
-
<section>
|
226
|
-
<h1>{{ page_title }}</h1>
|
227
|
-
<h2>My Title<h2>
|
228
|
-
</section>
|
229
|
-
"""
|
230
|
-
|
231
|
-
Scenario: Custom default template
|
232
|
-
When I successfully run `middleman slide 01 --title "My Title"`
|
233
|
-
Then a slide named "01.html.md" exist with:
|
234
|
-
"""
|
235
|
-
<section>
|
236
|
-
# My Title
|
237
|
-
</section>
|
238
|
-
"""
|
239
|
-
|
240
|
-
Scenario: Custom user markdown template
|
241
|
-
Given a user template named "custom.md.tt" with:
|
242
|
-
"""
|
243
|
-
<section>
|
244
|
-
# <%= title %>
|
245
|
-
</section>
|
246
|
-
"""
|
247
|
-
When I successfully run `middleman slide 01 --title "My Title"`
|
248
|
-
Then a slide named "01.html.md" exist with:
|
249
|
-
"""
|
250
|
-
<section>
|
251
|
-
# My Title
|
252
|
-
</section>
|
253
|
-
"""
|
254
|
-
|
255
|
-
Scenario: Custom user erb template
|
256
|
-
Given a user template named "custom.erb.tt" with:
|
257
|
-
"""
|
258
|
-
<section>
|
259
|
-
<h1><%= title %></h1>
|
260
|
-
</section>
|
261
|
-
"""
|
262
|
-
When I successfully run `middleman slide 01 --title "My Title"`
|
263
|
-
Then a slide named "01.html.erb" exist with:
|
264
|
-
"""
|
265
|
-
<section>
|
266
|
-
<h1>My Title</h1>
|
267
|
-
</section>
|
268
|
-
"""
|
269
|
-
|
270
|
-
Scenario: Output information that a slide was created
|
271
|
-
When I successfully run `middleman slide 01`
|
272
|
-
Then the output should contain:
|
273
|
-
"""
|
274
|
-
create slides/01.html.md
|
275
|
-
"""
|
276
|
-
|
277
|
-
Scenario: Output information that multiple slides were created
|
278
|
-
When I successfully run `middleman slide 01 02 03`
|
279
|
-
Then the output should contain:
|
280
|
-
"""
|
281
|
-
create slides/01.html.md
|
282
|
-
create slides/02.html.md
|
283
|
-
create slides/03.html.md
|
284
|
-
"""
|
285
|
-
|
286
|
-
Scenario: Output information that a slide already exists
|
287
|
-
When I successfully run `middleman slide 01`
|
288
|
-
When I successfully run `middleman slide 01`
|
289
|
-
Then the output should contain:
|
290
|
-
"""
|
291
|
-
exist slides/01.html.md
|
292
|
-
"""
|
293
|
-
|
294
|
-
Scenario: Output information that multiple slides already exist
|
295
|
-
When I successfully run `middleman slide 01 02 03`
|
296
|
-
When I successfully run `middleman slide 01 02 03`
|
297
|
-
Then the output should contain:
|
298
|
-
"""
|
299
|
-
exist slides/01.html.md
|
300
|
-
"""
|
301
|
-
|
302
|
-
Scenario: Create Group of slides in subfolder
|
303
|
-
When I successfully run `middleman slide 01namespace:01`
|
304
|
-
Then the following files should exist:
|
305
|
-
| source/slides/01namespace/01.html.md |
|
306
|
-
|
307
|
-
Scenario: Create Group with same name as slide
|
308
|
-
When I successfully run `middleman slide 01:01`
|
309
|
-
Then the following files should exist:
|
310
|
-
| source/slides/01/01.html.md |
|
311
|
-
|
@@ -1,135 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
Given(/^I initialized middleman for a new presentation$/) do
|
3
|
-
step 'I successfully run `middleman create --skip-bundle --template empty`'
|
4
|
-
|
5
|
-
append_to_file('config.rb', "\nactivate :presentation\n")
|
6
|
-
append_to_file('Gemfile', "\ngem 'middleman-presentation', path: '#{File.expand_path('../../', __FILE__)}'\n")
|
7
|
-
step 'I successfully run `bundle install`'
|
8
|
-
end
|
9
|
-
|
10
|
-
Given(/^I install bundle$/) do
|
11
|
-
step 'I successfully run `bundle update`'
|
12
|
-
end
|
13
|
-
|
14
|
-
Given(/^an image "([^"]+)" at "([^"]+)"$/) do |source, destination|
|
15
|
-
source = source.gsub(/\.\./, '')
|
16
|
-
write_file File.join('source', destination), File.read(File.expand_path("../../fixtures/images/#{source}", __FILE__))
|
17
|
-
end
|
18
|
-
|
19
|
-
Given(/only the executables of gems "([^"]+)" can be found in PATH/) do |gems|
|
20
|
-
dirs = []
|
21
|
-
|
22
|
-
dirs.concat gems.split(/,\s?/).map(&:strip).each_with_object([]) { |e, a| a << Gem::Specification.find_by_name(e).bin_dir }
|
23
|
-
|
24
|
-
if ci?
|
25
|
-
dirs << "/home/travis/.rvm/rubies/ruby-#{RUBY_VERSION}/bin"
|
26
|
-
dirs << "/home/travis/.rvm/rubies/ruby-#{Gem.ruby_api_version}/bin" unless Gem.ruby_api_version == RUBY_VERSION
|
27
|
-
end
|
28
|
-
|
29
|
-
dirs << '/usr/bin'
|
30
|
-
|
31
|
-
set_env 'PATH', dirs.join(':')
|
32
|
-
end
|
33
|
-
|
34
|
-
Given(/^I created a new presentation with title "([^"]+)" for speaker "([^"]+)"$/) do |title, speaker|
|
35
|
-
step %Q(I successfully run `bundle exec middleman-presentation create presentation --title "#{title}" --speaker "#{speaker}"`)
|
36
|
-
step 'I successfully run `bundle install`'
|
37
|
-
end
|
38
|
-
|
39
|
-
Given(/^a slide named "(.*?)" with:$/) do |name, string|
|
40
|
-
step %Q(a file named "source/slides/#{name}" with:), string
|
41
|
-
end
|
42
|
-
|
43
|
-
Given(/^a project template named "(.*?)" with:$/) do |name, string|
|
44
|
-
step %Q(a file named "templates/#{name}" with:), string
|
45
|
-
end
|
46
|
-
|
47
|
-
Given(/^a user template named "(.*?)" with:$/) do |name, string|
|
48
|
-
step %Q(a file named "~/.config/middleman/presentation/templates/#{name}" with:), string
|
49
|
-
end
|
50
|
-
|
51
|
-
Given(/^a presentation theme named "(.*?)" does not exist$/) do |name|
|
52
|
-
step %Q(I remove the directory "middleman-presentation-theme-#{name}")
|
53
|
-
end
|
54
|
-
|
55
|
-
Given(/^git is configured with username "(.*?)" and email-address "(.*?)"$/) do |name, email|
|
56
|
-
step %Q(I successfully run `git config --global user.email "#{email}"`)
|
57
|
-
step %Q(I successfully run `git config --global user.name "#{name}"`)
|
58
|
-
end
|
59
|
-
|
60
|
-
Given(/^a user config file for middleman\-presentation with:$/) do |string|
|
61
|
-
step 'a file named "~/.config/middleman/presentation/presentations.yaml" with:', string
|
62
|
-
end
|
63
|
-
|
64
|
-
# Given(/^I configured bower correctly$/) do
|
65
|
-
# http_proxy = %w(http_proxy HTTP_PROXY).find { |v| !ENV[v].blank? }
|
66
|
-
# if http_proxy
|
67
|
-
# http_proxy = Adressable::URI.heuristic_parse(ENV[variable])
|
68
|
-
# http_proxy = "http://#{http_proxy.host}:#{http_proxy.port}"
|
69
|
-
# end
|
70
|
-
#
|
71
|
-
# https_proxy = %w(https_proxy HTTPS_PROXY).find { |v| !ENV[v].blank? }
|
72
|
-
# if https_proxy
|
73
|
-
# https_proxy = Adressable::URI.heuristic_parse(ENV[variable])
|
74
|
-
# https_proxy = "http://#{http_proxy.host}:#{http_proxy.port}"
|
75
|
-
# end
|
76
|
-
#
|
77
|
-
# template = Erubis::Eruby.new <<-EOS.strip_heredoc
|
78
|
-
# {
|
79
|
-
# <% if http_proxy -%>
|
80
|
-
# "proxy": "#{http_proxy}",
|
81
|
-
# <% end -%>
|
82
|
-
# <% if https_proxy -%>
|
83
|
-
# "https-proxy": "#{https_proxy}"
|
84
|
-
# <% end -%>
|
85
|
-
# }
|
86
|
-
# EOS
|
87
|
-
#
|
88
|
-
# if http_proxy || https_proxy
|
89
|
-
#
|
90
|
-
# data = template.result(
|
91
|
-
# http_proxy: http_proxy,
|
92
|
-
# https_proxy: https_proxy,
|
93
|
-
# )
|
94
|
-
#
|
95
|
-
# step %Q(a file named ".bowerrc" with:), data
|
96
|
-
# end
|
97
|
-
# end
|
98
|
-
|
99
|
-
Then(/^a presentation theme named "(.*?)" should exist( with default files\/directories created)?$/) do |name, default_files|
|
100
|
-
name = "middleman-presentation-theme-#{name}"
|
101
|
-
|
102
|
-
step %Q(a directory named "#{name}" should exist)
|
103
|
-
|
104
|
-
if default_files
|
105
|
-
step %Q(a directory named "#{name}/stylesheets" should exist)
|
106
|
-
step %Q(a directory named "#{name}/javascripts" should exist)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
Then(/^I go to "([^"]*)" and see the following error message:$/) do |url, message|
|
111
|
-
message = capture :stderr do
|
112
|
-
# rubocop:disable Lint/HandleExceptions:
|
113
|
-
begin
|
114
|
-
@browser.get(URI.escape(url))
|
115
|
-
rescue StandardError
|
116
|
-
end
|
117
|
-
# rubocop:enable Lint/HandleExceptions:
|
118
|
-
end
|
119
|
-
|
120
|
-
expect(message).to include message
|
121
|
-
end
|
122
|
-
|
123
|
-
Then(/^a directory named "(.*?)" is a git repository$/) do |name|
|
124
|
-
step %Q(a directory named "#{name}/.git" should exist)
|
125
|
-
end
|
126
|
-
|
127
|
-
Then(/^a slide named "(.*?)" exist with:$/) do |name, string|
|
128
|
-
step %Q(the file "source/slides/#{name}" should contain:), string
|
129
|
-
end
|
130
|
-
|
131
|
-
Before do
|
132
|
-
@aruba_timeout_seconds = 120
|
133
|
-
ENV['MM_ENV'] = 'development'
|
134
|
-
ENV.delete 'MM_ROOT'
|
135
|
-
end
|