component_library 1.0.0 → 1.0.1
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/app/assets/stylesheets/_component_library/library.scss +4 -0
- data/app/controllers/library_controller.rb +2 -0
- data/app/views/layouts/component_library.html.erb +1 -0
- data/app/views/library/_componentpattern.html.erb +3 -2
- data/app/views/library/_isolationpattern.html.erb +3 -0
- data/app/views/library/index.html.erb +1 -1
- data/app/views/library/show.html.erb +1 -2
- data/lib/component_library/version.rb +1 -1
- data/lib/generators/component_library/install/templates/layout.html.erb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd5fe5f7f3c6f41062912135171378483084d10e
|
|
4
|
+
data.tar.gz: 3583250c2c8052803fc4a449f54081613b9fe0b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10a1320e93de726c50c01aebc8e832afb628939957d80ed28753b789f2fc8bd76faacc6079089e5263a7d7b32b3a58c7497696a595ceae7d9b89d9355fa18ed8
|
|
7
|
+
data.tar.gz: 5f2aacc65111c63f6321a7274b88cb582f3e3d8d23127bb71769d20f58750b1e53e42d241d0c0cf43e2ca58a5c54a8db0b6c257bba314de789fc061c1a8496fb
|
|
@@ -3,12 +3,14 @@ class LibraryController < ApplicationController
|
|
|
3
3
|
|
|
4
4
|
def index
|
|
5
5
|
dir = Dir.glob("#{Rails.root}/app/views/#{ComponentLibrary.root_directory}/**/*.erb").sort
|
|
6
|
+
@component_template = 'componentpattern'
|
|
6
7
|
@library = Library::Librarian.new(dir, ComponentLibrary.root_directory)
|
|
7
8
|
end
|
|
8
9
|
|
|
9
10
|
def show
|
|
10
11
|
suffix = params[:format] == 'erb' ? ".erb" : "/**/*.erb"
|
|
11
12
|
dir = Dir.glob("#{Rails.root}/app/views/#{ComponentLibrary.root_directory}/#{params[:path]}#{suffix}").sort
|
|
13
|
+
@component_template = params[:view] == 'isolation' ? 'isolationpattern' : 'componentpattern'
|
|
12
14
|
@library = Library::Librarian.new(dir, ComponentLibrary.root_directory, params[:path])
|
|
13
15
|
raise ActionController::RoutingError.new('Not Found') if @library.components.empty?
|
|
14
16
|
end
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<%= stylesheet_link_tag ComponentLibrary.stylesheet_path, ComponentLibrary.application_css, media: 'all' %>
|
|
6
6
|
<%= javascript_include_tag ComponentLibrary.javascript_path %>
|
|
7
7
|
<%= csrf_meta_tags %>
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
9
|
</head>
|
|
9
10
|
<body>
|
|
10
11
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<h1><%= library.title.capitalize %></h1>
|
|
2
|
+
<% library.components.each do |component| %>
|
|
3
|
+
<p class="pattern--title">
|
|
3
4
|
<% component.paths.each do |path| %>
|
|
4
5
|
/<%= link_to path[:name], component_path(path[:path]) %>
|
|
5
6
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h1>Component Library</h1>
|
|
2
2
|
<% if @library.components.any? %>
|
|
3
|
-
<%= render partial:
|
|
3
|
+
<%= render partial: @component_template, locals: { library: @library } %>
|
|
4
4
|
<% else %>
|
|
5
5
|
<p>No html components found at <code>/app/view/<%= ComponentLibrary.root_directory %></code></p>
|
|
6
6
|
<% end %>
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<%= render partial: "componentpattern", locals: { components: @library.components } %>
|
|
1
|
+
<%= render partial: @component_template, locals: { library: @library } %>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: component_library
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rich Archer
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-04-
|
|
12
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: sqlite3
|
|
@@ -93,6 +93,7 @@ files:
|
|
|
93
93
|
- app/models/library/librarian.rb
|
|
94
94
|
- app/views/layouts/component_library.html.erb
|
|
95
95
|
- app/views/library/_componentpattern.html.erb
|
|
96
|
+
- app/views/library/_isolationpattern.html.erb
|
|
96
97
|
- app/views/library/index.html.erb
|
|
97
98
|
- app/views/library/show.html.erb
|
|
98
99
|
- config/routes.rb
|