collapsible_section 0.1.1 → 0.1.3
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/CHANGELOG.md +6 -0
- data/README.md +4 -2
- data/lib/collapsible_section/helper.rb +5 -3
- data/lib/collapsible_section/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efa4b077e87507d2cde4bd1568c252955c81e0156f00f8e6ef99f3404d5b3aa6
|
4
|
+
data.tar.gz: 6b9b3d72caeb633e42dc5f40aa5ee2e374ce3dab34b08513efc57a350f1edff2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc91fca90bbbb250fb719c4f24b507408006c45a975afba62996902832fd2ea266a367bf2d8610f73ebf67d95978e119144691cfe9bd09322db8aad4cbb05502
|
7
|
+
data.tar.gz: 93d3ad60bb6f5b185f97752e8d8b8d11274c6e937b69cee37f58e917c89539f743f0fc8a8ff3bed94d74649748c42d2e025a97373ab6658deb9440201ba9e797
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A Rails gem that provides a simple helper method to generate HTML5 `<details>` c
|
|
7
7
|
Add to Gemfile:
|
8
8
|
|
9
9
|
```Gemfile
|
10
|
-
gem 'collapsible_section', '~> 0.1.
|
10
|
+
gem 'collapsible_section', '~> 0.1.2'
|
11
11
|
```
|
12
12
|
|
13
13
|
After building and installing the gem, replace your selected code with:
|
@@ -43,8 +43,10 @@ gem install collapsible_section
|
|
43
43
|
|
44
44
|
## Development
|
45
45
|
|
46
|
+
```bash
|
46
47
|
gem build collapsible_section.gemspec
|
47
|
-
gem push collapsible_section-0.1.
|
48
|
+
gem push collapsible_section-0.1.2.gem
|
49
|
+
```
|
48
50
|
|
49
51
|
## Contributing
|
50
52
|
|
@@ -5,9 +5,11 @@ module CollapsibleSection
|
|
5
5
|
def collapsible_section(title, open: true, &block)
|
6
6
|
content_tag(:details, class: "section-collapsable", open: open) do
|
7
7
|
summary_content = content_tag(:h3, title, class: "section-title")
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
summary_tag = content_tag(:summary, summary_content, class: "section-header")
|
9
|
+
block_content = block_given? ? capture(&block) : ""
|
10
|
+
|
11
|
+
(summary_tag + block_content).html_safe
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|