middleman-presentation-core 0.16.0.beta → 0.16.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -2
  3. data/doc/licenses/dependencies.db +0 -0
  4. data/features/build_presentation.feature +49 -8
  5. data/features/create_presentation-cli.feature +35 -75
  6. data/features/init_application-cli.feature +7 -1
  7. data/features/init_predefined_slides.feature +1 -1
  8. data/features/predefined_slides.feature +79 -0
  9. data/lib/middleman-presentation-core.rb +3 -0
  10. data/lib/middleman-presentation-core/application_config.rb +13 -2
  11. data/lib/middleman-presentation-core/build_readme_template.rb +15 -0
  12. data/lib/middleman-presentation-core/cli/build_presentation.rb +30 -0
  13. data/lib/middleman-presentation-core/cli/create_presentation.rb +38 -14
  14. data/lib/middleman-presentation-core/cli/export.rb +2 -0
  15. data/lib/middleman-presentation-core/cli/init.rb +2 -0
  16. data/lib/middleman-presentation-core/cli/init_application.rb +5 -1
  17. data/lib/middleman-presentation-core/cli/runner.rb +4 -0
  18. data/lib/middleman-presentation-core/cli/serve_presentation.rb +3 -0
  19. data/lib/middleman-presentation-core/cli/shared.rb +0 -3
  20. data/lib/middleman-presentation-core/frontend_component.rb +0 -2
  21. data/lib/middleman-presentation-core/middleman_environment.rb +1 -1
  22. data/lib/middleman-presentation-core/presentation_license_template.rb +15 -0
  23. data/lib/middleman-presentation-core/step_definitions.rb +14 -1
  24. data/lib/middleman-presentation-core/utils.rb +0 -1
  25. data/lib/middleman-presentation-core/version.rb +1 -1
  26. data/locales/de.yml +4 -0
  27. data/locales/en.yml +4 -0
  28. data/middleman-presentation-core.gemspec +2 -2
  29. data/spec/components_manager_spec.rb +0 -1
  30. data/spec/existing_slide_spec.rb +0 -1
  31. data/spec/new_slide_spec.rb +0 -1
  32. data/spec/presentation_helper_spec.rb +0 -1
  33. data/spec/slide_list_spec.rb +0 -1
  34. data/templates/Gemfile.tt +2 -2
  35. data/templates/Rakefile +0 -1
  36. data/templates/build_readme.md.tt +80 -0
  37. data/templates/gitignore.tt +4 -0
  38. data/templates/{LICENSE.presentation → presentation_license.md.tt} +0 -0
  39. data/templates/script/bootstrap +0 -1
  40. data/templates/script/build +1 -2
  41. data/templates/script/export +1 -2
  42. data/templates/script/start +2 -43
  43. data/utils/server/server.darwin.amd64 +0 -0
  44. data/utils/server/server.linux.amd64 +0 -0
  45. data/utils/server/server.windows.amd64.exe +0 -0
  46. metadata +13 -9
  47. data/lib/middleman-presentation-core/middleman_step_definitions.rb +0 -131
  48. data/templates/config.yaml.tt +0 -17
  49. data/templates/script/presentation +0 -3
  50. data/templates/script/slide +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e474a0c63cb81ac21f9207b2372a962b063685a
4
- data.tar.gz: d111a0f6c4f8f9d2346b4dc9246b7680d547f7cd
3
+ metadata.gz: 4bd64892af5acf1b3af13a0c284c7641221ec053
4
+ data.tar.gz: 14b5e5f102abb8d1eadbf434ca9f71b2a5670229
5
5
  SHA512:
6
- metadata.gz: 3e973d30e5ce00e6ed584011c45cd4f165c8b0e8db18c165d607dd77fecf3344d93b7d724b5a45e22d3645994da97dbb40115208c9cfd78e2a6505928d6e8d8f
7
- data.tar.gz: 9020f78fea662e51a53ed42e13fb2575ed87b974d0ebe8c4b5e0cbc5c4b92efb1e008255448a8ef585189823b8648bf84eb08e86fefce26704b5fba5c7df86e3
6
+ metadata.gz: e48f3a387b3fad17af8dee9b97c2a5bc97b688e4d34b3fbfec0e07f4151ada4ba1442c5e66e08509b6f69c602185b6e694255f94442b5d477f95120e49665358
7
+ data.tar.gz: 557e6496f20bda89ad39766726b86e894d6923407eba016e7eb575c7ddfe6604f398490f03510789baacba1f1a127c78d5c68b2339632ac39c7808b41e561aee
data/Rakefile CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env rake
2
2
 
3
3
  require 'filegen'
4
- require 'fedux_org_stdlib/rake_tasks'
4
+ require 'fedux_org_stdlib/rake_tasks/project'
5
+ require 'fedux_org_stdlib/rake_tasks/webserver'
6
+ require 'fedux_org_stdlib/rake_tasks/gems'
5
7
  require 'active_support/all'
6
8
  require 'open3'
7
9
 
@@ -79,7 +81,6 @@ def extract_sha
79
81
  end
80
82
 
81
83
  namespace :package do
82
-
83
84
  desc 'build gem package'
84
85
  task :gem do
85
86
  sh 'RAILS_ENV=production bundle exec rake -f Rakefile.rails assets:clobber'
@@ -198,3 +199,5 @@ namespace :archlinux do
198
199
  end
199
200
  end
200
201
  end
202
+
203
+ task 'gem:build' => 'webserver:fetch'
Binary file
@@ -11,14 +11,19 @@ Feature: Build presentation
11
11
  When I successfully run `middleman-presentation build presentation`
12
12
  And I cd to "build"
13
13
  Then a file named "config.ru" should exist
14
- Then a file named "javascripts/application.js" should exist
15
- Then a file named "index.html" should exist
16
- Then a file named "stylesheets/application.css" should exist
17
- Then a file named "javascripts/application.js" should exist
18
- Then a file named "javascripts/reveal.js/plugin/highlight/highlight.js" should exist
19
- Then a file named "javascripts/reveal.js/plugin/zoom-js/zoom.js" should exist
20
- Then a file named "javascripts/reveal.js/plugin/notes/notes.js" should exist
21
- Then a file named "stylesheets/middleman-presentation-helpers/print/pdf.css" should exist
14
+ And a file named "server.darwin.amd64" should exist
15
+ And a file named "server.linux.amd64" should exist
16
+ And a file named "server.windows.amd64.exe" should exist
17
+ And a file named "javascripts/application.js" should exist
18
+ And a file named "index.html" should exist
19
+ And a file named "stylesheets/application.css" should exist
20
+ And a file named "LICENSE.md" should exist
21
+ And a file named "README.md" should exist
22
+ And a file named "javascripts/application.js" should exist
23
+ And a file named "javascripts/reveal.js/plugin/highlight/highlight.js" should exist
24
+ And a file named "javascripts/reveal.js/plugin/zoom-js/zoom.js" should exist
25
+ And a file named "javascripts/reveal.js/plugin/notes/notes.js" should exist
26
+ And a file named "stylesheets/middleman-presentation-helpers/print/pdf.css" should exist
22
27
 
23
28
  Scenario: Change loadable default assets
24
29
  Given a user config file for middleman-presentation with:
@@ -60,3 +65,39 @@ Feature: Build presentation
60
65
  """
61
66
  When I successfully run `middleman-presentation build presentation`
62
67
  Then the size of "build/stylesheets/test.css" should be much smaller than from "source/stylesheets/test.scss"
68
+
69
+ Scenario: No license file
70
+ Given a file named "LICENSE.md" does not exist
71
+ When I successfully run `middleman-presentation build presentation`
72
+ And I cd to "build"
73
+ Then a file named "LICENSE.md" should not exist
74
+ And the output should not contain:
75
+ """
76
+ create build/LICENSE
77
+ """
78
+
79
+ Scenario: Non default license file
80
+ Given an empty file named "LICENSE.presentation"
81
+ And a file named "LICENSE.md" does not exist
82
+ When I successfully run `middleman-presentation build presentation`
83
+ And I cd to "build"
84
+ Then a file named "LICENSE.presentation" should exist
85
+
86
+ Scenario: Use different readme template
87
+ Given a user template named "build_readme.md.tt" with:
88
+ """
89
+ # My readme
90
+ """
91
+ When I successfully run `middleman-presentation build presentation`
92
+ And I cd to "build"
93
+ Then the file "README.md" should contain:
94
+ """
95
+ # My readme
96
+ """
97
+
98
+ Scenario: Disable executables
99
+ When I successfully run `middleman-presentation build presentation --add-static-servers=false`
100
+ And I cd to "build"
101
+ Then a file named "server.darwin.amd64" should not exist
102
+ And a file named "server.linux.amd64" should not exist
103
+ And a file named "server.windows.amd64.exe" should not exist
@@ -25,6 +25,10 @@ Feature: Initialize presentation
25
25
  And a file named "source/stylesheets/application.scss" should exist
26
26
  And a file named "source/javascripts/application.js" should exist
27
27
  And a file named "script/start" should exist
28
+ And a file named "script/export" should exist
29
+ And a file named "script/build" should exist
30
+ And a file named "script/bootstrap" should exist
31
+ And a file named "LICENSE.md" should exist
28
32
  And a file named "Rakefile" should exist
29
33
  And a directory named "source/images" should exist
30
34
  And a directory named "vendor/assets/components" should exist
@@ -32,6 +36,10 @@ Feature: Initialize presentation
32
36
  """
33
37
  project_id:
34
38
  """
39
+ And the file ".middleman-presentation.local.yaml" should contain:
40
+ """
41
+ network_port:
42
+ """
35
43
  Then a directory named "vendor/assets/components/middleman-presentation-theme-default" should exist
36
44
  And the file "source/stylesheets/application.scss" should contain:
37
45
  """
@@ -54,6 +62,7 @@ Feature: Initialize presentation
54
62
  //= require lightbox2/js/lightbox
55
63
  """
56
64
 
65
+ @announce
57
66
  Scenario: Initialize in test directory
58
67
  Given I successfully run `middleman-presentation create presentation test/presentation1 --title "My Presentation"`
59
68
  When I cd to "test/presentation1"
@@ -177,7 +186,7 @@ Feature: Initialize presentation
177
186
  Fragen
178
187
  """
179
188
 
180
- Scenario: Use englisch language in slides based if garbabe in environment variable
189
+ Scenario: Use english language in slides based if garbabe in environment variable
181
190
  Given I set the environment variables to:
182
191
  | variable | value |
183
192
  | LANG | asdf |
@@ -188,7 +197,7 @@ Feature: Initialize presentation
188
197
  Questions
189
198
  """
190
199
 
191
- Scenario: Use englisch language in slides if given garbabe on command line
200
+ Scenario: Use english language in slides if given garbabe on command line
192
201
  Given I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --language adsfasdfn`
193
202
  When I cd to "presentation1"
194
203
  And the file "source/slides/999980.html.erb" should contain:
@@ -236,79 +245,6 @@ Feature: Initialize presentation
236
245
  Failed
237
246
  """
238
247
 
239
- Scenario: No predefined slides
240
- When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --no-create-predefined-slides`
241
- Then a file named "source/slides/00.html.erb" should not exist
242
- And a file named "source/slides/999980.html.erb" should not exist
243
- And a file named "source/slides/999981.html.erb" should not exist
244
- And a file named "source/slides/999982.html.erb" should not exist
245
-
246
- Scenario: Custom start slide template
247
- Given a user template named "predefined_slides.d/00.html.erb.tt" with:
248
- """
249
- <section>
250
- <h1>Start</h1>
251
- </section>
252
- """
253
- And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
254
- When I cd to "presentation1"
255
- Then a slide named "00.html.erb" should exist with:
256
- """
257
- <section>
258
- <h1>Start</h1>
259
- </section>
260
- """
261
-
262
- Scenario: Custom questions template
263
- Given a user template named "predefined_slides.d/999980.html.erb.tt" with:
264
- """
265
- <section>
266
- <h1>Questions? Really</h1>
267
- </section>
268
- """
269
- And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
270
- When I cd to "presentation1"
271
- Then a slide named "999980.html.erb" should exist with:
272
- """
273
- <section>
274
- <h1>Questions? Really</h1>
275
- </section>
276
- """
277
-
278
- Scenario: Custom contact template
279
- Given a user template named "predefined_slides.d/999981.html.erb.tt" with:
280
- """
281
- <section>
282
- <h1>Contact</h1>
283
- Me and You
284
- </section>
285
- """
286
- And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
287
- When I cd to "presentation1"
288
- Then a slide named "999981.html.erb" should exist with:
289
- """
290
- <section>
291
- <h1>Contact</h1>
292
- Me and You
293
- </section>
294
- """
295
-
296
- Scenario: Custom end slide template
297
- Given a user template named "predefined_slides.d/999982.html.erb.tt" with:
298
- """
299
- <section>
300
- <h1>See you!</h1>
301
- </section>
302
- """
303
- And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
304
- When I cd to "presentation1"
305
- Then a slide named "999982.html.erb" should exist with:
306
- """
307
- <section>
308
- <h1>See you!</h1>
309
- </section>
310
- """
311
-
312
248
  Scenario: Install external asset
313
249
  Given a user config file for middleman-presentation with:
314
250
  """
@@ -347,3 +283,27 @@ Feature: Initialize presentation
347
283
  //= require middleman-presentation-helpers/footer/footer
348
284
  //= require lightbox2/js/lightbox
349
285
  """
286
+
287
+ Scenario: Use different license file
288
+ Given a user template named "presentation_license.md.tt" with:
289
+ """
290
+ # License ABC
291
+ """
292
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
293
+ And I cd to "presentation1"
294
+ Then the file "LICENSE.md" should contain:
295
+ """
296
+ # License ABC
297
+ """
298
+
299
+ Scenario: Use different license file with different format
300
+ Given a user template named "presentation_license.erb.tt" with:
301
+ """
302
+ <h1>License ABC</h1>
303
+ """
304
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
305
+ And I cd to "presentation1"
306
+ Then the file "LICENSE.erb" should contain:
307
+ """
308
+ <h1>License ABC</h1>
309
+ """
@@ -36,7 +36,13 @@ Feature: Initialize middleman-presentation
36
36
  """
37
37
  And the user config file for middleman-presentation should contain:
38
38
  """
39
- # theme: {:name=>"middleman-presentation-theme-default", :github=>"maxmeyer/middleman-presentation-theme-default", :importable_files=>[/stylesheets\/middleman-presentation-theme-default.scss$/], :loadable_files=>[/.*\.png$/]}
39
+ # theme:
40
+ # name: middleman-presentation-theme-default
41
+ # github: maxmeyer/middleman-presentation-theme-default
42
+ # importable_files:
43
+ # - !ruby/regexp /stylesheets\/middleman-presentation-theme-default.scss$/
44
+ # loadable_files:
45
+ # - !ruby/regexp /.*\.png$/
40
46
  """
41
47
 
42
48
  Scenario: Local for presentation
@@ -6,4 +6,4 @@ Feature: Initialize predefined slides
6
6
 
7
7
  Scenario: Default directory
8
8
  When I successfully run `middleman-presentation init predefined_slides`
9
- Then a file named "~/.config/middleman-presentation/templates/predefined_slides.d/00_00.html.erb.tt" should exist
9
+ Then a file named "~/.config/middleman-presentation/predefined_slides.d/00_00.html.erb.tt" should exist
@@ -0,0 +1,79 @@
1
+ Feature: Use predefined slides when creating a new presentation
2
+
3
+ As a presentator
4
+ I want to create a new presentation using predefined slides
5
+ In order to use it
6
+
7
+ Scenario: No predefined slides
8
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --no-create-predefined-slides`
9
+ Then a file named "source/slides/00.html.erb" should not exist
10
+ And a file named "source/slides/999980.html.erb" should not exist
11
+ And a file named "source/slides/999981.html.erb" should not exist
12
+ And a file named "source/slides/999982.html.erb" should not exist
13
+
14
+ Scenario: Custom start slide template
15
+ Given a user defined predefined slide named "00.html.erb.tt" with:
16
+ """
17
+ <section>
18
+ <h1>Start</h1>
19
+ </section>
20
+ """
21
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
22
+ When I cd to "presentation1"
23
+ Then a slide named "00.html.erb" should exist with:
24
+ """
25
+ <section>
26
+ <h1>Start</h1>
27
+ </section>
28
+ """
29
+
30
+ Scenario: Custom questions template
31
+ Given a user defined predefined slide named "999980.html.erb.tt" with:
32
+ """
33
+ <section>
34
+ <h1>Questions? Really</h1>
35
+ </section>
36
+ """
37
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
38
+ When I cd to "presentation1"
39
+ Then a slide named "999980.html.erb" should exist with:
40
+ """
41
+ <section>
42
+ <h1>Questions? Really</h1>
43
+ </section>
44
+ """
45
+
46
+ Scenario: Custom contact template
47
+ Given a user defined predefined slide named "999981.html.erb.tt" with:
48
+ """
49
+ <section>
50
+ <h1>Contact</h1>
51
+ Me and You
52
+ </section>
53
+ """
54
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
55
+ When I cd to "presentation1"
56
+ Then a slide named "999981.html.erb" should exist with:
57
+ """
58
+ <section>
59
+ <h1>Contact</h1>
60
+ Me and You
61
+ </section>
62
+ """
63
+
64
+ Scenario: Custom end slide template
65
+ Given a user defined predefined slide named "999982.html.erb.tt" with:
66
+ """
67
+ <section>
68
+ <h1>See you!</h1>
69
+ </section>
70
+ """
71
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
72
+ When I cd to "presentation1"
73
+ Then a slide named "999982.html.erb" should exist with:
74
+ """
75
+ <section>
76
+ <h1>See you!</h1>
77
+ </section>
78
+ """
79
+
@@ -12,6 +12,7 @@ require 'fileutils'
12
12
  require 'uri'
13
13
  require 'addressable/uri'
14
14
  require 'securerandom'
15
+ require 'launchy'
15
16
  require 'fedux_org_stdlib/app_config'
16
17
  require 'fedux_org_stdlib/logging/logger'
17
18
  require 'fedux_org_stdlib/file_template'
@@ -80,6 +81,8 @@ require 'middleman-presentation-core/slide_name'
80
81
  require 'middleman-presentation-core/slide_list'
81
82
  require 'middleman-presentation-core/ignore_file'
82
83
  require 'middleman-presentation-core/slide_group'
84
+ require 'middleman-presentation-core/build_readme_template'
85
+ require 'middleman-presentation-core/presentation_license_template'
83
86
  require 'middleman-presentation-core/group_template'
84
87
  require 'middleman-presentation-core/erb_template'
85
88
  require 'middleman-presentation-core/markdown_template'
@@ -3,8 +3,9 @@ module Middleman
3
3
  module Presentation
4
4
  # Configuration for presentation extension
5
5
  class ApplicationConfig < FeduxOrgStdlib::AppConfig
6
- option :network_port, 4567
6
+ option :network_port, (1024..65_535).to_a.sample
7
7
  option :network_interface, '127.0.0.1'
8
+ option :open_in_browser, false
8
9
 
9
10
  option :title, nil
10
11
  option :subtitle, nil
@@ -96,6 +97,12 @@ module Middleman
96
97
 
97
98
  option :force_create_presentation, false
98
99
  option :debug_mode, false
100
+
101
+ option :local_options, %w(
102
+ network_port
103
+ network_interface
104
+ )
105
+
99
106
  option :exportable_options, %w(
100
107
  activate_center
101
108
  activate_controls
@@ -166,7 +173,7 @@ module Middleman
166
173
  option :fonts_directory, 'fonts'
167
174
  option :build_directory, 'build'
168
175
 
169
- option :minify_assets, false
176
+ option :minify_assets, true
170
177
 
171
178
  option :runtime_environment, ENV['MP_ENV'].to_s.to_sym
172
179
  option :use_regex, false
@@ -176,6 +183,8 @@ module Middleman
176
183
  option :metadata_headline, [:date, :speaker, :company, :version, :license]
177
184
  option :metadata_footer, [:copyright, :author, :license]
178
185
 
186
+ option :add_static_servers, true
187
+
179
188
  def preferred_configuration_file
180
189
  ::File.expand_path(::File.join('~', '.config', _application_name, _config_file))
181
190
  end
@@ -194,6 +203,8 @@ module Middleman
194
203
  [
195
204
  ::File.expand_path(::File.join(ConfigurationFile.new(raise_error: false).directory.to_s, format('.%s%s', _application_name, _config_file_suffix))),
196
205
  ::File.expand_path(::File.join(ConfigurationFile.new(raise_error: false).directory.to_s, format('%s%s', _application_name, _config_file_suffix))),
206
+ ::File.expand_path(::File.join(ConfigurationFile.new(raise_error: false).directory.to_s, format('.%s.local%s', _application_name, _config_file_suffix))),
207
+ ::File.expand_path(::File.join(ConfigurationFile.new(raise_error: false).directory.to_s, format('%s.local%s', _application_name, _config_file_suffix))),
197
208
  ::File.expand_path(::File.join('~', '.config', _application_name, _config_file)),
198
209
  ::File.expand_path(::File.join('~', format('.%s', _application_name), _config_file)),
199
210
  ::File.expand_path(::File.join('~', format('.%s%s', _application_name, _config_file_suffix))),
@@ -0,0 +1,15 @@
1
+ # encoding: utf-8
2
+ module Middleman
3
+ module Presentation
4
+ # Markdown template to create new slides
5
+ class BuildReadmeTemplate < FeduxOrgStdlib::FileTemplate
6
+ def application_name
7
+ 'middleman-presentation'
8
+ end
9
+
10
+ def fallback_template_directory
11
+ File.expand_path('../../../templates/', __FILE__)
12
+ end
13
+ end
14
+ end
15
+ end