kielce 2.0.5 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bdf0053d979e829a7ceb5ed7e4717d99dda0bf9dc4cff8780f8aa53bb6af1bc
4
- data.tar.gz: 8b6479263c06dbcefd01d3e85daf756cd157117cff1c14d5851f2fb91a7f4ac1
3
+ metadata.gz: b71e938a27439dc182d4f293be066c26739729cd271abfc8695b364af6427c3f
4
+ data.tar.gz: b678ac8cb3e446561057c4ff735003aae2ef79a8bdb7bb5693acf369f510d286
5
5
  SHA512:
6
- metadata.gz: b7ab79d11727d58d1cfdb49330ce4373b94ff711ac882739045ec519004d055e8f8a65a066643f773c8361a33b9948c158de93f4dd40073b556194216ecbcc70
7
- data.tar.gz: 8b243be6a675ec55df4386ce659460c9df05ab679f21e82b887113b3383bc3bc513966f409cf182fcdf0ca61681534977a06ffb0c38a0a50eecf94973415c15f
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
@@ -95,7 +97,7 @@ module Kielce
95
97
  # another erb template. In order for such nested calls to work
96
98
  # properly, each call must have a unique variable in which to
97
99
  # store its output. This parameter is called "eoutvar". (If you
98
- # don't specifiy eoutvar and make a nested call, the output
100
+ # don't specify eoutvar and make a nested call, the output
99
101
  # can get messed up.)
100
102
  @@render_count += 1
101
103
 
@@ -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
  #
@@ -57,8 +57,9 @@ module KielcePlugins
57
57
  link = $d.course.notesTemplates.method_missing(method, param)
58
58
  else
59
59
  link = link_rule
60
- end
61
- "(<a target='_blank' href='#{link}'>#{text}</a>)"
60
+ end
61
+ # Suppress links if text begins with xx.
62
+ text =~ /^xx/ ? '': "(<a target='_blank' href='#{link}'>#{text}</a>)"
62
63
  end # end gsub
63
64
 
64
65
  end # end if value is string
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.5
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: