kielce 2.0.6 → 2.0.7

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: f8c3f77d063506dc5a2cc9cf05cf4e1533e4285be392626d011d772f3cc72899
4
- data.tar.gz: 23d1b29068daa91274bbabab558a7ec34c31a03c14c7927b9c8209ff84450689
3
+ metadata.gz: b71e938a27439dc182d4f293be066c26739729cd271abfc8695b364af6427c3f
4
+ data.tar.gz: b678ac8cb3e446561057c4ff735003aae2ef79a8bdb7bb5693acf369f510d286
5
5
  SHA512:
6
- metadata.gz: c8a4b799e7003ffa4981af5593e06c131f6c1cbe9ed777a8726e62dbde7dac09bfffcac775e7967a49a1f876aa017150ea409bc5a5de3fb4683de7875db28d48
7
- data.tar.gz: 1d4dbf33350ad953b1552cc3efba048f88992e58cfff88e27e6b5b08a97c3717b307cb42ef533bbf00ac9f554974f0e6c5753e1030a8bf5b4c0c0dfc7a403580
6
+ metadata.gz: e6378588e31c49b7d11c9904047e28c52b379bae8cd959416e604cc95431f6ccade37b3923996ba4d69df6aa6d5f57fd18805cac204f88f452380b4c4174988d
7
+ data.tar.gz: 71b813b66206d93cdb33eb407a5b043fe1ba2ace10c3c2042c57e8cc558650c80d96c8c5d33c31b5c7f57da8e283ad5d85d485bd7fd6c6ca7309bf60f41ccb04
@@ -8,13 +8,13 @@
8
8
 
9
9
  class ::String
10
10
  def link(text = nil)
11
- $k.link(self, text)
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. Specificaly, if the value of one item in the hash is itself a hash,
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
@@ -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 avaiable to the code being evaluated. In order to
57
- # prevent data files from manipuating this KielceLoader object this
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 datqa.
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
@@ -14,7 +14,7 @@ require "kielce/kielce"
14
14
  ##############################################################################################
15
15
 
16
16
  module Kielce
17
- VERSION = "2.0.4"
17
+ VERSION = "2.0.7"
18
18
 
19
19
  # Changelog
20
20
  #
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.6
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: 2022-07-06 00:00:00.000000000 Z
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: