markdown_exec 1.6 → 1.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.
data/lib/hash.rb ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # encoding=utf-8
5
+
6
+ # hash with keys sorted by name
7
+ # add Hash.sym_keys
8
+ #
9
+ class Hash
10
+ unless defined?(sort_by_key)
11
+ def sort_by_key
12
+ keys.sort.to_h { |key| [key, self[key]] }
13
+ end
14
+ end
15
+
16
+ unless defined?(sym_keys)
17
+ def sym_keys
18
+ transform_keys(&:to_sym)
19
+ end
20
+ end
21
+ end