showcase-rails 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 19b68b6f97120e74cc61013cf64de0b095a08290e46f26183861c28c45574693
4
+ data.tar.gz: b6e9fdc2cc45b1ed6354b60fe67ff254ce03ad08441e1b43c1418e3d6b115404
5
+ SHA512:
6
+ metadata.gz: 14fcf547ea4c0f3fb4f5f8c99947f41bfc2dbcbb8042ba13137a7347367ec2adb5da9dd60e8f8db62305e6ad0f2d2a26ad00afa6ff0abc8aaf0adf8213df00c2
7
+ data.tar.gz: 720b83d11a256def78cf22f1b87de100b5170b98e25d08c8c3d2531633accf6e352b12bbcfcb35a096394906612f707aa2d89029654e4b3af181507708dd84f4
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2022 Kasper Timm Hansen
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Showcase
2
+
3
+ Showcase lets you build previews for partials, components, view helpers and Stimulus controllers.
4
+
5
+ Add a view template to `app/views/showcases` and it'll show up in Showcase's menu.
6
+
7
+ Here's how to showcase a standard button component:
8
+
9
+ ```erb
10
+ <%# app/views/showcases/components/button.html.erb %>
11
+ <% showcase.description "This button component handles what we click on" %>
12
+
13
+ <% showcase.sample "Basic" do %>
14
+ <%= render "component/button", content: "Button content", mode: :small %>
15
+ <% end %>
16
+
17
+ <% showcase.sample "Large" do %>
18
+ <%= render "component/button", content: "Button content", mode: :large %>
19
+ <% end %>
20
+
21
+ <% showcase.options do |o| %>
22
+ <% o.required :content, String, "The content to output as the button text" %>
23
+ <% o.optional :mode, default: :small, values: %i[ small medium large ], description: "We support three modes" %>
24
+ <% end %>
25
+ ```
26
+
27
+ ## Installation
28
+
29
+ Add this line to your application's Gemfile:
30
+
31
+ ```ruby
32
+ gem "showcase"
33
+ ```
34
+
35
+ And then execute:
36
+ ```bash
37
+ $ bundle
38
+ ```
39
+
40
+ Or install it yourself as:
41
+ ```bash
42
+ $ gem install showcase
43
+ ```
44
+
45
+ ## Contributing
46
+ Contribution directions go here.
47
+
48
+ ## License
49
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"