kirana 0.1.0.pre1 → 0.2.0
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/README.md +1 -1
- data/lib/kirana/class_map.rb +4 -4
- data/lib/kirana/merge.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 369d8f6e5da0f80f0f6528842b1d0ff6eda6ac4bfedbad50b96c0f098ad022bd
|
|
4
|
+
data.tar.gz: 72207afe89b73938a5b26702ad547f94e2d51eb875da5847b9f49b3fc8a2c54c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 28f302e28cdc974d58465167ca2709b4255d8a988235de984e0f5761c3b925766d779c65ca294fa4f56cac2663a8e363f7c01ebd484e3f11c7a4d625be104873
|
|
7
|
+
data.tar.gz: fce20caabdfd55e95444de5589d3f446ff42d068ce0a1323d95412520ddfdf3f147196a0cfc83ef47ba268a8787002eae3dba3eaf295fe58260bee18b9af1c00
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# kirana (Ruby)
|
|
2
2
|
|
|
3
3
|
Kirana for Rails templates (D-069): the `kirana` view helper, which reads the class map
|
|
4
|
-
`kirana build` and `kirana dev` write and merges named styles the way `sx` does.
|
|
4
|
+
`kirana-style build` and `kirana-style dev` write and merges named styles the way `sx` does.
|
|
5
5
|
|
|
6
6
|
```erb
|
|
7
7
|
<div class="<%= kirana :card, active && "card.active" %>">…</div>
|
data/lib/kirana/class_map.rb
CHANGED
|
@@ -4,7 +4,7 @@ require "json"
|
|
|
4
4
|
|
|
5
5
|
module Kirana
|
|
6
6
|
# A class map (D-069): the class string of every handle a server app's style modules export, by
|
|
7
|
-
# name, as `kirana build` and `kirana dev` write it. `classes` merges named handles the way `sx`
|
|
7
|
+
# name, as `kirana-style build` and `kirana-style dev` write it. `classes` merges named handles the way `sx`
|
|
8
8
|
# merges them, later ones winning.
|
|
9
9
|
class ClassMap
|
|
10
10
|
# A name the class map does not list.
|
|
@@ -18,9 +18,9 @@ module Kirana
|
|
|
18
18
|
@merge = Merge.new(map.fetch("prefix", "k"), families.fetch("four", 0), families.fetch("two", 0))
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
# Reads the class map `kirana build` or `kirana dev` wrote.
|
|
21
|
+
# Reads the class map `kirana-style build` or `kirana-style dev` wrote.
|
|
22
22
|
def self.from_file(path)
|
|
23
|
-
raise Errno::ENOENT, "kirana: no class map at #{path}; run `kirana dev` or `kirana build` first" unless File.file?(path)
|
|
23
|
+
raise Errno::ENOENT, "kirana: no class map at #{path}; run `kirana-style dev` or `kirana-style build` first" unless File.file?(path)
|
|
24
24
|
|
|
25
25
|
new(JSON.parse(File.read(path)))
|
|
26
26
|
end
|
|
@@ -48,7 +48,7 @@ module Kirana
|
|
|
48
48
|
@classes_path || "public/kirana/classes.json"
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# The class map at `classes_path`, read again when the file changes (`kirana dev` rewrites it).
|
|
51
|
+
# The class map at `classes_path`, read again when the file changes (`kirana-style dev` rewrites it).
|
|
52
52
|
def class_map
|
|
53
53
|
stamp = File.file?(classes_path) && File.mtime(classes_path)
|
|
54
54
|
@class_map = nil unless @stamp == stamp && @path == classes_path
|
data/lib/kirana/merge.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Kirana
|
|
4
|
-
# Kirana's class merge, as the private runtime does it (`@kirana/core/internal`, D-018), for
|
|
4
|
+
# Kirana's class merge, as the private runtime does it (`@kirana-style/core/internal`, D-018), for
|
|
5
5
|
# templates that hold class strings from a class map (D-069).
|
|
6
6
|
#
|
|
7
7
|
# Kirana class names are `{prefix}{key}_{value}`: merging keeps the last class per key, a
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kirana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Kirana authors
|
|
@@ -26,6 +26,7 @@ metadata:
|
|
|
26
26
|
rubygems_mfa_required: 'true'
|
|
27
27
|
source_code_uri: https://github.com/kirana-style/kirana/tree/main/packages/kirana/helpers/ruby
|
|
28
28
|
bug_tracker_uri: https://github.com/kirana-style/kirana/issues
|
|
29
|
+
changelog_uri: https://github.com/kirana-style/kirana/blob/main/CHANGELOG.md
|
|
29
30
|
rdoc_options: []
|
|
30
31
|
require_paths:
|
|
31
32
|
- lib
|
|
@@ -40,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
40
41
|
- !ruby/object:Gem::Version
|
|
41
42
|
version: '0'
|
|
42
43
|
requirements: []
|
|
43
|
-
rubygems_version: 4.0.
|
|
44
|
+
rubygems_version: 4.0.20
|
|
44
45
|
specification_version: 4
|
|
45
46
|
summary: 'Kirana for Rails templates: the class map reader and the kirana view helper.'
|
|
46
47
|
test_files: []
|