bobkit 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 2f358f071a5348831daf9b185e8895e6ecd6a597
4
- data.tar.gz: 8f0914885698d80b05c00c8236a81734dff8c491
3
+ metadata.gz: e0dd26336edd85a8386b472c019cd30dd6be912d
4
+ data.tar.gz: 7dcb0e8859b6a3dc070b6cc7f0f8610c109ea5e4
5
5
  SHA512:
6
- metadata.gz: 12ece60a9aab29ccebdede4f15f37f87117c05566721e90691d82cc4b71561adcff19cc141726480e62b31589f69f35566a367b057fbf4d729e8e9dcda5c2353
7
- data.tar.gz: 675fe045e465ead4b57fd9d1c6193fda8280b5145c45d1aa0f5975e965bf85d3d34c4d6be588334f7e5036771c1470c88d1521ad77d128ebbbea019125e148d9
6
+ metadata.gz: 7ad406af81d98fa5e695bc2874f45d16ff2b6fb1e8a4b51937c289bb02917f624bdf44602d66b0fbb1fbcba6790d6cbf28dd6691f7bdd5ddb9c5c65394aa6933
7
+ data.tar.gz: ec1cc7f00cd1b5cdd1aab7990c088fe947ab58b5727f3e46b8216decb025e4a6ba3edf2ec5cfd98b905eb2079f5af4e0f62d52eccaa036a79e66285030d5207e
data/README.md CHANGED
@@ -216,6 +216,7 @@ provided, we will watch all the input folders.
216
216
  Todo
217
217
  --------------------------------------------------
218
218
 
219
+ - [ ] Consider adding `input_root` which will prefix all others
219
220
  - [ ] YAML loader (data_folder?)
220
221
  - [ ] CSV Loader (data_folder?)
221
222
  - [ ] Maybe: Render from/to Markdown
data/lib/bobkit/scope.rb CHANGED
@@ -2,8 +2,8 @@ module Bobkit
2
2
  class Scope
3
3
  include SlimBridge
4
4
 
5
- def initialize(scope)
6
- @scope = scope
5
+ def initialize(scope=nil)
6
+ @scope = scope || {}
7
7
  end
8
8
 
9
9
  def method_missing(method_name, *arguments, &block)
@@ -3,6 +3,7 @@ module Bobkit
3
3
  include FileHelpers
4
4
  include SlimOptions
5
5
  include LocationOptions
6
+ include ScopeOptions
6
7
 
7
8
  def render(options={}, extra_options={})
8
9
  options = { partial: options }.merge(extra_options) if options.is_a? String
@@ -11,7 +12,9 @@ module Bobkit
11
12
  output = options.delete :output
12
13
 
13
14
  context = options.empty? ? scope : options
14
- context = Scope.new context if context.is_a? Hash
15
+ if context.is_a? Hash or !context
16
+ context = Scope.new context
17
+ end
15
18
 
16
19
  content = Slim::Template.new("#{templates_folder}/#{partial}.slim", slim_options).render(context)
17
20
  content = Slim::Template.new("#{layouts_folder}/#{layout}.slim", slim_options).render(context) { content } if layout
@@ -1,3 +1,3 @@
1
1
  module Bobkit
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bobkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slim