lono 6.1.2 → 6.1.3

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
  SHA256:
3
- metadata.gz: afe49322e5d7821b70af120cb40bcac86c069124cb9d376bb4589eba6cee3dc8
4
- data.tar.gz: 474b9a5234e7a5ea332f5b764281189be497f94f4cf2b667e160dfd858d731d2
3
+ metadata.gz: 0ef1d674e91dc1454c1da60e22877ce51d26d7c4a3c9a1a2cd8246150116b40c
4
+ data.tar.gz: 457fddede95499b97a424e67f9ee779b88555b12a6ea190b54c4e79b5d8c6880
5
5
  SHA512:
6
- metadata.gz: 2733f0680a4fee30a18f022733352953433840904b46c394eb18af312704b272462d82ad3d37e8570c5f778b12f848631cd6a9bca7b51a2b8b4ac80cbbbb268e
7
- data.tar.gz: 5437718228848a4f27d951ca04a0bf84618d14b5c8e542f425d1caea2d57c2197dde9a05ffd7f8d7214c0d4f523a5fa416d7b9a57816cc1e184acce204d561f2
6
+ metadata.gz: 06b21af8dcf2d0ff984a0c83a82c769029965fd03df98dfcbb2950c4bf82a8564c477cc0982e1a10e22868e305f9ebf1e9686efc42058a5d3d52c8ae1da3752d
7
+ data.tar.gz: e06da40b85427018b179bdd38ff958e027b9953821a915784e67df5b28f5282a92ecca795c94a6f25ae7102f0bf37b23bf58d6e677c651f154d87bce82e62106
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [6.1.3]
7
+ - #21 smarter tags helper. use @tags variable if tags called without arguments
8
+
6
9
  ## [6.1.2]
7
10
  - #20 improve param Conditional form with 3rd form
8
11
 
@@ -73,12 +73,7 @@ module Lono
73
73
  def determine_requested
74
74
  # param is usually set from the convention. when set from convention stack name takes higher precedence
75
75
  config_key = @config.singularize.to_sym # param or variable
76
- from_convention = !@options[config_key] && !@options[:config]
77
- if from_convention
78
- @options[:stack]
79
- else
80
- @options[config_key] || @options[:config] || @options[:stack]
81
- end
76
+ @options[config_key] || @options[:config] || @options[:stack]
82
77
  end
83
78
 
84
79
  def requested_file(path)
@@ -2,13 +2,28 @@ module Lono::Template::Dsl::Builder::Helpers
2
2
  module CoreHelper
3
3
  extend Memoist
4
4
 
5
- def tags(hash, casing: :camelize)
6
- puts "DEPRECATED: tags helper will be removed. Use tag_list instead."
7
- tag_list(hash, casing: casing)
5
+ def tags(list={})
6
+ casing = list.delete(:casing) || :camelize
7
+ if list.empty?
8
+ tag_list(@tags) # when list is empty, we'll use variables
9
+ else
10
+ tag_list(list, casing: casing)
11
+ end
8
12
  end
9
13
 
10
- def tag_list(hash, casing: :camelize)
11
- hash.map do |k,v|
14
+ def tag_list(list, casing: :camelize)
15
+ raise "tags list cannot be empty" if list == nil
16
+
17
+ if list.is_a?(Array)
18
+ hash = list.inject({}) do |h,i|
19
+ i.symbolize_keys!
20
+ h[i[:Key]] = i[:Value]
21
+ h
22
+ end
23
+ return tag_list(hash) # recursive call tag_list to normalized the argument with a Hash
24
+ end
25
+
26
+ list.map do |k,v|
12
27
  k = k.to_s
13
28
  k = case casing
14
29
  when :camelize
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "6.1.2"
2
+ VERSION = "6.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.2
4
+ version: 6.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-06 00:00:00.000000000 Z
11
+ date: 2019-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport