revealing 1.0.5 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1cfdf9b16a29d0442f9797da23283cf21e042d3bae193a43b971e63db6f1d48
4
- data.tar.gz: 41dcd0c131559f49e4816434fb21009affb951b0d0c5fff8b3aae37e80e9d7bb
3
+ metadata.gz: a37bb931585056c7b87a37d847e4b144502d891142f6990929a91c094d33eda7
4
+ data.tar.gz: c91b10d0efa0f63a2d43ee788cdc3c4332ee9b81ad44e6d9ec758f9ea4f4af91
5
5
  SHA512:
6
- metadata.gz: 02f68688cc9544651d6fc0a6216c04fda5a2a38f4ae9b65696dadb6bbfceff618b22513279279a50ac33c15f77505533a7cd32fc8cd1004dc97cd9869d121888
7
- data.tar.gz: abac2135a5d8edfafa2dfd9c510bb57db148bb2197f128684d1c6bfd7b277f36dd451594e539cccd56fc43f1c1568abacf719c4e941705ed6fe61c927a776bb4
6
+ metadata.gz: b87b7e7786c552580c4557f7a103779316b1efb87e4469a491d3f1eee8c48d7ee46558072253c1a1fa5a6198f49d2761284d045f624e2cd0caa06c10ad076c5b
7
+ data.tar.gz: 8865d6dc64fa54bc6a9824c73be20bbb21d33bd6abc71d291664d6a600ce881de0311d3f4a368e1dd4d259102f6c1ef446abf686a222da86fbce17491d5298fc
data/.rubocop.yml ADDED
@@ -0,0 +1,22 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+ Include:
4
+ - '**/Gemfile'
5
+ - '**/Rakefile'
6
+ - '**/*.rake'
7
+ Exclude:
8
+ - vendor/**/*
9
+ - db/migrations/**/*
10
+
11
+ DisplayCopNames:
12
+ Enabled: true
13
+
14
+ DisplayStyleGuide:
15
+ Enabled: true
16
+
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - spec/**/*
20
+
21
+ Metrics/LineLength:
22
+ Max: 180
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.6.2
data/.travis.yml CHANGED
@@ -1,7 +1,17 @@
1
1
  ---
2
- sudo: false
2
+ dist: xenial
3
3
  language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.1
7
- before_install: gem install bundler
4
+ cache:
5
+ - bundler
6
+ directories:
7
+ - /home/travis/.rvm/
8
+ before_install:
9
+ - gem update --system
10
+ - gem install bundler
11
+ addons:
12
+ apt:
13
+ update: true
14
+ packages:
15
+ - pandoc
16
+ - gpp
17
+ - graphicsmagick
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  gemspec
data/Guardfile ADDED
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ guard :bundler do
4
+ require 'guard/bundler'
5
+ require 'guard/bundler/verify'
6
+ helper = Guard::Bundler::Verify.new
7
+ files = ['Gemfile']
8
+ files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
9
+ files.each { |file| watch(helper.real_path(file)) }
10
+ end
11
+
12
+ guard :rspec, cmd: 'bundle exec rspec' do
13
+ watch('spec/spec_helper.rb') { %w(spec/unit spec/system) }
14
+ end
15
+
16
+ group 'unit' do
17
+ guard :rspec, cmd: 'bundle exec rspec' do
18
+ watch(%r{^spec/unit/.+_spec\.rb$})
19
+ watch(%r{^lib/.+/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
20
+ end
21
+ end
22
+
23
+ group 'system' do
24
+ guard :rspec, cmd: 'bundle exec rspec' do
25
+ watch(%r{^spec/system/.+_spec\.rb$})
26
+ watch(%r{^lib/.+/(.+)\.rb$}) { |m| "spec/system/#{m[1]}_spec.rb" }
27
+ end
28
+ end
data/README.markdown CHANGED
@@ -4,9 +4,14 @@
4
4
 
5
5
  This gem provides a set of [`Rake`](https://github.com/ruby/rake) tasks to create [`reveal.js`](https://revealjs.com) presentations from markdown files. It uses [`pandoc`](https://pandoc.org/) to create the final presentation. The output is a self-contained set of static HTML files that can be viewed locally uploaded to a web server.
6
6
 
7
+ Unique features:
8
+
9
+ 1. `revealing` assumes that your presentation is built using `Rake`. Additional, custom steps (like deployment) can easily be added to the Rakefile that was generated for you.
10
+ 1. Efficiency - by carefully modeling the dependencies between source files (your markdown), intermediate build products (processed include statements), and the final output (HTML and resized images), build steps are only run when necessary (e.g. when a corresponding source file was changed).
11
+
7
12
  # Examples
8
13
 
9
- * [Zero to CF in Kube-Cluster in 30 Seconds with Concourse, Helm, Fissile and Eirini](http://zero2cfin30s.eirini.cf/) (source: [suhlig/zero-to-cf-in-30-seconds](https://github.com/suhlig/zero-to-cf-in-30-seconds))
14
+ * [Zero to CF in Kube-Cluster in 30 Seconds with Concourse, Helm, Fissile and Eirini](http://zero2cfin30s.eirini.cf/) (source: [suhlig/zero-to-cf-in-30-seconds](https://github.com/suhlig/zero-to-cf-in-30-seconds)) is built using `revealing` and published on IBM Cloud using a GitHub action after each `git push`.
10
15
 
11
16
  # Development
12
17
 
@@ -32,11 +37,13 @@ This gem provides a set of [`Rake`](https://github.com/ruby/rake) tasks to creat
32
37
 
33
38
  # TODO
34
39
 
35
- 1. `revealing doctor` to analyze tools
36
- 1. Rubocop
37
- 1. Read desired dependencies (URLs or version numbers) from ENV vars or a YAML file (with sensible defaults coming from this project)
38
- 1. Re-add ditaa processing
39
40
  1. Add mathjax (copy to target if present, otherwise use CDN)
41
+ 1. Read desired dependencies (URLs or version numbers) from ENV vars or a YAML file (with sensible defaults coming from this project)
42
+ 1. Re-add ditaa processing, or replace with [mermaid-filter](https://github.com/raghur/mermaid-filter)
43
+
44
+ Milestone: 1.1
45
+
46
+ 1. Charts using [vega-lite](https://vega.github.io/vega-lite/usage/embed.html)
40
47
  1. Add guard-livereload to the generated project
41
48
  1. Expose customization of
42
49
  * highlight-style
data/Rakefile CHANGED
@@ -2,7 +2,21 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
+ require 'rubocop/rake_task'
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new
7
9
 
8
- task default: 'spec'
10
+ namespace :spec do
11
+ desc 'Run CI tests'
12
+ task ci: %i[rubocop unit system]
13
+
14
+ %w[unit system].each do |type|
15
+ desc "Run #{type} tests"
16
+ RSpec::Core::RakeTask.new(type) do |t|
17
+ t.pattern = "spec/#{type}/**/*_spec.rb"
18
+ end
19
+ end
20
+ end
21
+
22
+ task default: 'spec:ci'
data/lib/revealing/cli.rb CHANGED
@@ -1,12 +1,31 @@
1
1
  require 'thor'
2
2
  require 'pathname'
3
+ require_relative 'prerequisite'
3
4
 
4
5
  module Revealing
6
+ PREREQUISITES = [
7
+ Prerequisite.new('curl'),
8
+ Prerequisite.new('gm', 'graphicsmagick'),
9
+ Prerequisite.new('gpp'),
10
+ Prerequisite.new('pandoc'),
11
+ ]
12
+
5
13
  class CLI < Thor
6
14
  def self.exit_on_failure?
7
15
  true
8
16
  end
9
17
 
18
+ desc 'doctor', 'Checks whether your system is fit for revealing.'
19
+ def doctor
20
+ PREREQUISITES.each do |tool|
21
+ if tool.available?
22
+ puts "OK: #{tool} is available."
23
+ else
24
+ warn "Error: #{tool.command} is not available. Install it using `#{tool.install_hint}`."
25
+ end
26
+ end
27
+ end
28
+
10
29
  desc 'init [DIRECTORY]', 'initialize a new revealing project in DIRECTORY. Defaults to the current working directory.'
11
30
  def init(directory = '.')
12
31
  project_directory = Pathname(directory)
@@ -0,0 +1,63 @@
1
+ require 'rubygems/platform'
2
+
3
+ module Revealing
4
+ class Prerequisite
5
+ attr_reader :command
6
+ alias :to_s :command
7
+
8
+ def initialize(command, details = nil)
9
+ @command = command
10
+
11
+ case details
12
+ when NilClass
13
+ @package_info = same_as_command(command)
14
+ when String
15
+ @package_info = different_but_same_on_all_platforms(details)
16
+ when Hash
17
+ @package_info = different_for_each_platform(details)
18
+ when Proc
19
+ @package_info = callable(details)
20
+ else
21
+ raise "Don't know how to interpret '#{package_info.inspect}' as package info."
22
+ end
23
+ end
24
+
25
+ def available?
26
+ system("sh -c 'command -v #{command} > /dev/null'")
27
+ end
28
+
29
+ def install_hint
30
+ @package_info[Gem::Platform.local.os.to_sym]
31
+ end
32
+
33
+ private
34
+
35
+ def same_as_command(command)
36
+ {
37
+ darwin: "brew install #{command}",
38
+ linux: "apt install #{command}",
39
+ }
40
+ end
41
+
42
+ def different_but_same_on_all_platforms(details)
43
+ {
44
+ darwin: "brew install #{details}",
45
+ linux: "apt install #{details}",
46
+ }
47
+ end
48
+
49
+ def different_for_each_platform(details)
50
+ {
51
+ darwin: "brew install #{details[:darwin]}",
52
+ linux: "apt install #{details[:linux]}",
53
+ }
54
+ end
55
+
56
+ def callable(details)
57
+ {
58
+ darwin: details.call(:darwin),
59
+ linux: details.call(:linux),
60
+ }
61
+ end
62
+ end
63
+ end
@@ -1,18 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ def print_duplicates(list)
4
+ warn 'Error: The following assets have the same base name and would override another in the output:'
5
+ warn ''
6
+ warn list.join("\n")
7
+ warn ''
8
+ warn 'Consider renaming them to be unique.'
9
+ end
10
+
1
11
  def refute_duplicate_basename(assets)
2
- assets = assets.map{ |f| Pathname(f) }
3
- basenames = assets.map{ |f| f.basename }
4
-
5
- if basenames.length != basenames.uniq.length
6
- # https://stackoverflow.com/a/8922931/3212907
7
- duplicate_basenames = basenames.select{ |e| basenames.count(e) > 1 }.uniq
8
- list = assets.select{ |a| duplicate_basenames.include?(a.basename) }
9
- warn "Error: The following assets have the same base name and would override another in the output:"
10
- warn ''
11
- warn list.join("\n")
12
- warn ''
13
- warn "Consider renaming them to be unique."
14
- fail
15
- end
12
+ assets = assets.map { |f| Pathname(f) }
13
+ basenames = assets.map(&:basename)
14
+
15
+ return if basenames.length == basenames.uniq.length
16
+
17
+ # https://stackoverflow.com/a/8922931/3212907
18
+ duplicate_basenames = basenames.select { |e| basenames.count(e) > 1 }.uniq
19
+ list = assets.select { |a| duplicate_basenames.include?(a.basename) }
20
+ print_duplicates(list)
21
+ raise
16
22
  end
17
23
 
18
24
  refute_duplicate_basename(RESIZABLE_ASSETS)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  desc "Sources are pre-processed into the single #{GPP_FILE}"
2
4
  file GPP_FILE => [GPP_DIR, DIRTY_FILE] + SOURCE_FILES do |target|
3
5
  sh %(gpp -I src -x -o #{target} #{SOURCE_DIR}/index.markdown)
@@ -1,4 +1,6 @@
1
- REVEAL_JS_VERSION = '3.7.0'.freeze
1
+ # frozen_string_literal: true
2
+
3
+ REVEAL_JS_VERSION = '3.7.0'
2
4
 
3
5
  desc 'reveal.js is present'
4
6
  directory REVEAL_JS_TARGET_DIR => TARGET_DIR do |target|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Revealing
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.7'
5
5
  end
data/revealing.gemspec CHANGED
@@ -30,8 +30,12 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency 'thor'
31
31
 
32
32
  spec.add_development_dependency 'aruba'
33
+ spec.add_development_dependency 'guard'
34
+ spec.add_development_dependency 'guard-bundler'
35
+ spec.add_development_dependency 'guard-rspec'
33
36
  spec.add_development_dependency 'pry'
34
37
  spec.add_development_dependency 'pry-byebug'
35
38
  spec.add_development_dependency 'rspec'
39
+ spec.add_development_dependency 'rubocop'
36
40
  end
37
41
  # rubocop:enable Metrics/BlockLength
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gem 'rake'
@@ -15,6 +15,7 @@ Do this once:
15
15
  1. Get Ruby if not already present
16
16
  1. `gem install bundler`
17
17
  1. `bundle install`
18
+ 1. Check that you have the required tools as reported by `revealing doctor`
18
19
 
19
20
  # Generate the Presentation
20
21
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'revealing/tasks'
2
4
 
3
5
  task default: TARGET_FILE
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revealing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steffen Uhlig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-16 00:00:00.000000000 Z
11
+ date: 2019-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,6 +80,48 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-bundler
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
83
125
  - !ruby/object:Gem::Dependency
84
126
  name: pry
85
127
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +164,20 @@ dependencies:
122
164
  - - ">="
123
165
  - !ruby/object:Gem::Version
124
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
125
181
  description: |-
126
182
  Provides a workflow for creating reveal.js
127
183
  presentations. It uses pandoc to create the
@@ -135,12 +191,16 @@ extra_rdoc_files: []
135
191
  files:
136
192
  - ".gitignore"
137
193
  - ".rspec"
194
+ - ".rubocop.yml"
195
+ - ".ruby-version"
138
196
  - ".travis.yml"
139
197
  - Gemfile
198
+ - Guardfile
140
199
  - README.markdown
141
200
  - Rakefile
142
201
  - exe/revealing
143
202
  - lib/revealing/cli.rb
203
+ - lib/revealing/prerequisite.rb
144
204
  - lib/revealing/tasks.rb
145
205
  - lib/revealing/tasks/assets.rake
146
206
  - lib/revealing/tasks/gpp.rake