scribble 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06603b30016b49347e52550b6752f2615fa04841
4
- data.tar.gz: 05e1e266eb511628463acf636a64c5c35001e094
3
+ metadata.gz: fd8eed0dd90c0f26ad395bd9930d0111285f674e
4
+ data.tar.gz: 020cfc814ed54521e885279a176ec33ecfc8b500
5
5
  SHA512:
6
- metadata.gz: 682a2b60adffa14b19f74324984a04012da5ebf93bcf369e14a7eb19c488dc40ab73f634af71566c484092db8e686eb581cdd0127de6c3aa75d028510ba2c91d
7
- data.tar.gz: 7b988a5dee13ac01f8de82ba87d53503d536857c5fcffb25bc149141763159d0dee497913a1bf54a81fcca14d216f2d92ff3def90d2f74b8a7985842987e03fc
6
+ metadata.gz: 6fdf7f54319dc431fb920a02cbf82227c43d9d63025f65237e857edb03dc7f76318570dd2c76623689748e56c630cddcd8c4fabd40beb1a202073b2d707c98ad
7
+ data.tar.gz: cf937ab53bb1d4fcd8d3ea3efa01ba257f448a0a648ef7fdf3bb0eace7965fc69b0f5009016a79d0e60b09f9572949c42c932412d291d4acabcbfe90eb5c56bd
data/README.md CHANGED
@@ -19,6 +19,10 @@ Scribble currently has solid architecture and features and it is already used in
19
19
  * Pluggable loader architecture for working with partials and layouts
20
20
  * Ability to convert between formats when inlining partials and layouts with mixed formats (for example: Markdown and HTML)
21
21
 
22
+ ## Compatibility
23
+
24
+ Scribble is only compatible with Ruby 2.0 and Ruby 2.1 because it uses keyword arguments.
25
+
22
26
  ## Installation
23
27
 
24
28
  Add this line to your application's Gemfile:
@@ -265,7 +269,7 @@ Nil does not support a literal notation but it can be returned by methods. It is
265
269
 
266
270
  ### Global methods
267
271
 
268
- Scribble supports the global `if`, `partial`, and `layout` methods. The if method was shown in several previous examples. The `partial` and `layout` methods are similar in that they load a partial through te loader and render it (converting between any format disparities). The difference is that layout takes a block of content to which the partial can yield using the `content` method.
272
+ Scribble supports the global `if`, `partial`, and `layout` methods. The if method was shown in several previous examples. The `partial` and `layout` methods are similar in that they load a partial through the loader and render it (converting between any format disparities). The difference is that layout takes a block of content to which the partial can yield using the `content` method.
269
273
 
270
274
  # Partial template (loaded by loader as 'foo')
271
275
 
@@ -379,7 +383,7 @@ The first line of the class implementation registers this method with the regist
379
383
  8. The first call to `split_nodes` returns `Some text` which is added to the beginning of the array, together with the argument to `if` cast to a boolean (`false`).
380
384
  9. The `send :elsif` returns and it renders the first list of nodes with a positive condition (`Some more text`)
381
385
 
382
- This might be hard to wrap your head around but once you do it is a clean and easy way to extend the language with new `if`-like constructs without touching the parser. For examples of this, check out [Sitebox.io forms](http://www.sitebox.io/articles/form-method) and [Sitebox.io columns](http://www.sitebox.io/articles/columns-method). Implementations of block methods that don't use split methods are much easier, lake a look at [the implementation](https://github.com/stefankroes/scribble/blob/master/lib/scribble/methods/times.rb) if the `times` method.
386
+ This might be hard to wrap your head around but once you do it is a clean and easy way to extend the language with new `if`-like constructs without touching the parser. For examples of this, check out [Sitebox.io forms](http://www.sitebox.io/articles/form-method) and [Sitebox.io columns](http://www.sitebox.io/articles/columns-method). Implementations of block methods that don't use split methods are much easier, lake a look at [the implementation](https://github.com/stefankroes/scribble/blob/master/lib/scribble/methods/times.rb) of the `times` method.
383
387
 
384
388
  ### Method implementation API
385
389
 
@@ -20,7 +20,9 @@ module Scribble
20
20
  raise NotImplementedError, 'Class that includes context must implement nodes method'
21
21
  end
22
22
 
23
- def render nodes: nodes, context: self
23
+ def render nodes: nil, context: self
24
+ nodes ||= self.nodes
25
+
24
26
  if !require_conversion?
25
27
  render_without_conversion nodes, context
26
28
 
@@ -1,3 +1,3 @@
1
1
  module Scribble
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scribble
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kroes