component_library 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e15d6d319bb3d6856f70b71a7929ac47bb73964
4
- data.tar.gz: 50a8a3e046f13ccc794fdf1bae0127c44dd8ee59
3
+ metadata.gz: cd5fe5f7f3c6f41062912135171378483084d10e
4
+ data.tar.gz: 3583250c2c8052803fc4a449f54081613b9fe0b6
5
5
  SHA512:
6
- metadata.gz: fc77e22338bb1d3229513602e5fd673ff48417ab89ba806f79def986efe80954d4638a17efea604c3b9ba153ae1b88deca6d4b2144933079a314bee2acc3eda4
7
- data.tar.gz: 1b005fd79451265bc2bbff6275aa773c4a84c1e37d625c73cce4b84f5eefcceae1704e731f8513ee43b6d1aae24ce035430cfe848cc46f445746438a263adab2
6
+ metadata.gz: 10a1320e93de726c50c01aebc8e832afb628939957d80ed28753b789f2fc8bd76faacc6079089e5263a7d7b32b3a58c7497696a595ceae7d9b89d9355fa18ed8
7
+ data.tar.gz: 5f2aacc65111c63f6321a7274b88cb582f3e3d8d23127bb71769d20f58750b1e53e42d241d0c0cf43e2ca58a5c54a8db0b6c257bba314de789fc061c1a8496fb
@@ -60,4 +60,8 @@
60
60
  content: "";
61
61
  clear: both;
62
62
  }
63
+ }
64
+ .pattern--title {
65
+ overflow: scroll;
66
+ white-space: nowrap;
63
67
  }
@@ -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
- <% components.each do |component| %>
2
- <p>
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 %>
@@ -0,0 +1,3 @@
1
+ <% library.components.each do |component| %>
2
+ <%= render component.render %>
3
+ <% end %>
@@ -1,6 +1,6 @@
1
1
  <h1>Component Library</h1>
2
2
  <% if @library.components.any? %>
3
- <%= render partial: "componentpattern", locals: { components: @library.components } %>
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
- <h1><%= @library.title.capitalize %></h1>
2
- <%= render partial: "componentpattern", locals: { components: @library.components } %>
1
+ <%= render partial: @component_template, locals: { library: @library } %>
@@ -1,3 +1,3 @@
1
1
  module ComponentLibrary
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -4,6 +4,7 @@
4
4
  <title>Component</title>
5
5
  <%= stylesheet_link_tag 'application', media: 'all' %>
6
6
  <%= stylesheet_link_tag ComponentLibrary.stylesheet_path, media: 'all' %>
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
8
  </head>
8
9
  <body>
9
10
 
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.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-20 00:00:00.000000000 Z
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