middleman-presentation 0.15.6 → 0.15.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/features/grouping_slides.feature +0 -5
- data/features/slide-cli.feature +12 -0
- data/lib/middleman-presentation/cli/create_presentation.rb +1 -1
- data/lib/middleman-presentation/new_slide.rb +4 -6
- data/lib/middleman-presentation/version.rb +1 -1
- data/spec/new_slide_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58c10edea93c0d927782843a1d76e3f5142d19e9
|
4
|
+
data.tar.gz: 1baaeed9de730c623a6f7fa494233258a96ee1e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb0426eba03d4cadf0d866f8dd7de7180b2bee44e4bc7d839e288002d701b4ceb8e7da39e561a20474ea72f1d75c74e1558e0768e3807e0d0a9c42ee4f604f2
|
7
|
+
data.tar.gz: 7e5c658770ef6ae0c1b9bf019c9f77241a08cf177a58d2110d1bfffb838726a3ca699f05c82a130dd81979f0015518ec367ef0c38d91569c0bdb5efd459d9987
|
data/Gemfile.lock
CHANGED
@@ -10,11 +10,6 @@ Feature: Grouping slides
|
|
10
10
|
And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
|
11
11
|
And I cd to "presentation1"
|
12
12
|
|
13
|
-
Scenario: Create slides in subfolder
|
14
|
-
When I successfully run `middleman slide 01namespace:01`
|
15
|
-
Then the following files should exist:
|
16
|
-
| source/slides/01namespace/01.html.md |
|
17
|
-
|
18
13
|
Scenario: Read slides from filesystem
|
19
14
|
Given a slide named "01namespace/01.html.erb" with:
|
20
15
|
"""
|
data/features/slide-cli.feature
CHANGED
@@ -298,3 +298,15 @@ Feature: Add new slide
|
|
298
298
|
"""
|
299
299
|
exist slides/01.html.md
|
300
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
|
+
@wip
|
308
|
+
Scenario: Create Group with same name as slide
|
309
|
+
When I successfully run `middleman slide 01:01`
|
310
|
+
Then the following files should exist:
|
311
|
+
| source/slides/01/01.html.md |
|
312
|
+
|
@@ -148,7 +148,7 @@ module Middleman
|
|
148
148
|
if ENV['MM_ENV'] == 'development'
|
149
149
|
append_to_file File.join(root_directory, 'Gemfile'), <<-EOS.strip_heredoc
|
150
150
|
|
151
|
-
gem 'middleman-presentation', path: '#{File.expand_path('../../../../', __FILE__)}
|
151
|
+
gem 'middleman-presentation', path: '#{File.expand_path('../../../../', __FILE__)}'
|
152
152
|
|
153
153
|
EOS
|
154
154
|
else
|
@@ -12,7 +12,7 @@ module Middleman
|
|
12
12
|
public
|
13
13
|
|
14
14
|
def initialize(input, base_path:)
|
15
|
-
@input = input
|
15
|
+
@input = input.split(/:/)
|
16
16
|
@name = extract_name
|
17
17
|
@slide_directory_path = Pathname.new(base_path)
|
18
18
|
@base_path = @slide_directory_path.dirname
|
@@ -131,16 +131,14 @@ module Middleman
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def extract_name
|
134
|
-
input.
|
134
|
+
input.last
|
135
135
|
end
|
136
136
|
|
137
137
|
# Extract group from name
|
138
138
|
def extract_group
|
139
|
-
|
139
|
+
return nil if input.size < 2 # no group given
|
140
140
|
|
141
|
-
|
142
|
-
|
143
|
-
group.to_s
|
141
|
+
input.first.to_s
|
144
142
|
end
|
145
143
|
end
|
146
144
|
end
|
data/spec/new_slide_spec.rb
CHANGED
@@ -121,6 +121,12 @@ RSpec.describe NewSlide do
|
|
121
121
|
expect(slide).to be_group 'group'
|
122
122
|
end
|
123
123
|
|
124
|
+
it 'succeeds if slide has same name for group and slide' do
|
125
|
+
slide = NewSlide.new('02:02', base_path: File.join(working_directory, 'source', 'slides'))
|
126
|
+
|
127
|
+
expect(slide).to be_group '02'
|
128
|
+
end
|
129
|
+
|
124
130
|
it 'fails if slide has not group' do
|
125
131
|
slide = NewSlide.new('02.md', base_path: File.join(working_directory, 'source'))
|
126
132
|
|