vizbuilder 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -10
  3. data/VERSION +1 -1
  4. data/lib/vizbuilder.rb +2 -3
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a6fd8336205d85a311da19ea02fc0614720a45b478897579758c2c2cdd68d4a
4
- data.tar.gz: 78d1ea2059f443e7b1908a702512b7dfea696892fccb10551818af96449fcec5
3
+ metadata.gz: 4dc925f85d53e2dc765eca9ffae446e0197d471a5680a8b77c3f60aa9d48f6bb
4
+ data.tar.gz: 7167536f3e903ac3c446f9be2773582065c22e126004f2330623bac87b2b6ce5
5
5
  SHA512:
6
- metadata.gz: 8eda190c5e9c0b621a9f9ef58cc62dd1b4f86b76c67ae43a520055f63b9f5ac41cec20d201d9497c7bfe6e083c31e3b97f35084fbad76a6ce94c649b65e3a77a
7
- data.tar.gz: 1fe0cf613dab7950741206d409439e0b518cf6f02621092dc9f9697f4d258792d9d8d09af8cac9eb09bb61dc8b1fc60842b71031c2bb0339a158c865ec347fd9
6
+ metadata.gz: 84a2a641318f6060ec8432e0aba51e4ca090b42651ca46fe74bbc57ec24338fc72495dcb88936be091e7f86c5dfa5e458cbdd1a2e2ed02a7f89ea1e7da9afc66
7
+ data.tar.gz: 01c7df8fd30bce6dfa1d6cf67580f6698a889c7272ea00bff8775f4159ec0e9cce16c61e509712b96f15ea9841cfe3bfc08a99fdab0e615783ab74c9228d81aa
data/README.md CHANGED
@@ -110,11 +110,11 @@ There are a few config settings used by Viz Builder:
110
110
 
111
111
  #### http_prefix
112
112
 
113
- Used during building for setting canonical urls and links between pages of the site. Used by the `canonical_url` helper detailed below.
113
+ Used in all modes for setting canonical urls and links between pages of the site. Used by the `canonical_url` helper detailed below. Defaults to `'/'`.
114
114
 
115
115
  #### asset_http_prefix
116
116
 
117
- Used during building for setting asset urls. Used by the `asset_path` helper detailed below.
117
+ Used in all modes for setting asset urls. Used by the `asset_path` helper detailed below. Defaults to `http_prefix` or `'/'`.
118
118
 
119
119
  #### layout
120
120
 
@@ -265,21 +265,32 @@ Returns the full domain name and path to the root of the site. Any provided argu
265
265
  <!-- outputs {http_prefix}/page1 --->
266
266
  ```
267
267
 
268
- #### build?
269
-
270
- True if Viz Builder is building out all the pages and not running as a rack app (aka web server).
268
+ #### production?
271
269
 
272
- #### server?
270
+ True if Viz Builder is running in production mode. Necessary for setting different http prefix settings for production vs development.
273
271
 
274
- True if Viz Builder is running as a rack app (aka web server).
272
+ ```ruby
273
+ app = VizBuilder.new do
274
+ ...
275
+ if production?
276
+ set :http_prefix, 'http://www.example.com'
277
+ set :asset_http_prefix, 'http://cdn.example.com'
278
+ end
279
+ ...
280
+ end
281
+ ```
275
282
 
276
283
  #### development?
277
284
 
278
- True if Viz Builder is running in development mode. Usually synonymous with `server?`.
285
+ True if Viz Builder is running in development mode. Opposite of `production?`.
279
286
 
280
- #### production?
287
+ #### build?
288
+
289
+ True if Viz Builder is building out all the pages and not running as a rack app (aka web server). Usually synonymous with `production?`.
290
+
291
+ #### server?
281
292
 
282
- True if Viz Builder is running in production mode. Usually synonymous with `build?`.
293
+ True if Viz Builder is running as a rack app (aka web server). Usually synonymous with `development?`.
283
294
 
284
295
  ## Assets
285
296
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
data/lib/vizbuilder.rb CHANGED
@@ -34,14 +34,13 @@ class VizBuilder
34
34
  # Generate all pages in the sitemap and save to `build/`
35
35
  def build!(silent: false)
36
36
  configure!(mode: :build, target: :production)
37
- ctx = TemplateContext.new(@config)
38
37
  index_prebuilt!
39
38
  # First we build prebuilt pages that need digests calculated by build_page
40
39
  digested = sitemap.select { |_path, page| page[:digest] == true }
41
- digested.each { |path, _page| build_page(path, ctx, silent: silent) }
40
+ digested.each { |path, _page| build_page(path, TemplateContext.new(@config), silent: silent) }
42
41
  # Then we build all other pages
43
42
  undigested = sitemap.reject { |_path, page| page[:digest] == true }
44
- undigested.each { |path, _page| build_page(path, ctx, silent: silent) }
43
+ undigested.each { |path, _page| build_page(path, TemplateContext.new(@config), silent: silent) }
45
44
  end
46
45
 
47
46
  # Run this builder as a server
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vizbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-05 00:00:00.000000000 Z
11
+ date: 2019-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport