kielce 2.0.6 → 2.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 +4 -4
- data/lib/kielce/helpers.rb +2 -2
- data/lib/kielce/kielce.rb +6 -4
- data/lib/kielce/kielce_loader.rb +3 -3
- data/lib/kielce.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71e938a27439dc182d4f293be066c26739729cd271abfc8695b364af6427c3f
|
4
|
+
data.tar.gz: b678ac8cb3e446561057c4ff735003aae2ef79a8bdb7bb5693acf369f510d286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6378588e31c49b7d11c9904047e28c52b379bae8cd959416e604cc95431f6ccade37b3923996ba4d69df6aa6d5f57fd18805cac204f88f452380b4c4174988d
|
7
|
+
data.tar.gz: 71b813b66206d93cdb33eb407a5b043fe1ba2ace10c3c2042c57e8cc558650c80d96c8c5d33c31b5c7f57da8e283ad5d85d485bd7fd6c6ca7309bf60f41ccb04
|
data/lib/kielce/helpers.rb
CHANGED
@@ -8,13 +8,13 @@
|
|
8
8
|
|
9
9
|
class ::String
|
10
10
|
def link(text = nil)
|
11
|
-
|
11
|
+
Kielce::Kielce.link(self, text)
|
12
12
|
#%Q(<a href="#{self}">#{text}</a>)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
class ::Hash
|
17
|
-
# Merges two hashes recursively.
|
17
|
+
# Merges two hashes recursively. Specifically, if the value of one item in the hash is itself a hash,
|
18
18
|
# merge that nested hash.
|
19
19
|
#
|
20
20
|
# Hash#merge by default returns a new Hash containing the key/value pairs of both hashes.
|
data/lib/kielce/kielce.rb
CHANGED
@@ -35,10 +35,7 @@ module Kielce
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# Generate an +href+ tag.
|
38
|
-
|
39
|
-
# This could be a class method. We make it
|
40
|
-
# an instance method so it can be used using the "$k.link" syntax.
|
41
|
-
def link(url, text_param = nil, code: nil, classes: nil, target: nil)
|
38
|
+
def self.link(url, text_param = nil, code: nil, classes: nil, target: nil)
|
42
39
|
class_list = classes.nil? ? "" : " class='#{classes}'"
|
43
40
|
|
44
41
|
# Make the text the same as the URL if no text given
|
@@ -58,6 +55,11 @@ module Kielce
|
|
58
55
|
"<a #{target_str}href='#{url}'#{class_list}>#{text}</a>"
|
59
56
|
end
|
60
57
|
|
58
|
+
# We add instance method so it can be used using the "$k.link" syntax.
|
59
|
+
def link(*args, **kwargs)
|
60
|
+
Kielce.link(*args, **kwargs)
|
61
|
+
end
|
62
|
+
|
61
63
|
# Load +file+ and run ERB. The binding parameter determines
|
62
64
|
# the context the .erb code runs in. The context determines
|
63
65
|
# the variables and methods available. By default, kielce
|
data/lib/kielce/kielce_loader.rb
CHANGED
@@ -53,8 +53,8 @@ module Kielce
|
|
53
53
|
# (2) The second parameter to eval, the "binding", is an object
|
54
54
|
# describing the context the code being evaluated will run in.
|
55
55
|
# Among other things, this context determines the local variables
|
56
|
-
# and methods
|
57
|
-
# prevent data files from
|
56
|
+
# and methods available to the code being evaluated. In order to
|
57
|
+
# prevent data files from manipulating this KielceLoader object this
|
58
58
|
# method's local variables, we create an empty object and use its
|
59
59
|
# binding. Note, however, that the code can still read and set global
|
60
60
|
# variables. Users can also provide a different, custom, context object.
|
@@ -106,7 +106,7 @@ module Kielce
|
|
106
106
|
|
107
107
|
#
|
108
108
|
# Search +dir+ and all parent directories for kielce data files, load them, and
|
109
|
-
# return the raw Hash containing the collective
|
109
|
+
# return the raw Hash containing the collective data.
|
110
110
|
#
|
111
111
|
# @param dir the directory to search (as a +Pathname+ object)
|
112
112
|
# @param current the current data object
|
data/lib/kielce.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kielce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Kurmas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'An ERB-based templating engine for generating course documents. '
|
14
14
|
email:
|