bs5 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -112
  3. data/app/components/bs5/example_component.html.erb +8 -0
  4. data/app/components/bs5/example_component.rb +44 -0
  5. data/app/controllers/bs5/application_controller.rb +9 -0
  6. data/app/controllers/bs5/examples_controller.rb +9 -0
  7. data/app/helpers/bs5/application_helper.rb +2 -0
  8. data/app/helpers/bs5/examples_helper.rb +9 -0
  9. data/app/jobs/bs5/application_job.rb +2 -0
  10. data/app/mailers/bs5/application_mailer.rb +2 -0
  11. data/app/models/bs5/application_record.rb +2 -0
  12. data/app/views/bs5/examples/_accordion.html.erb +3 -0
  13. data/app/views/bs5/examples/_alert.html.erb +4 -0
  14. data/app/views/bs5/examples/_badge.html.erb +4 -0
  15. data/app/views/bs5/examples/accordion/default/_example.html.erb +2 -0
  16. data/app/views/bs5/examples/accordion/default/snippet.html.erb +11 -0
  17. data/app/views/bs5/examples/accordion/flush/_example.html.erb +2 -0
  18. data/app/views/bs5/examples/accordion/flush/snippet.html.erb +11 -0
  19. data/app/views/bs5/examples/alert/default/_example.html.erb +2 -0
  20. data/app/views/bs5/examples/alert/default/snippet.html.erb +3 -0
  21. data/app/views/bs5/examples/alert/dismissable/_example.html.erb +2 -0
  22. data/app/views/bs5/examples/alert/dismissable/snippet.html.erb +3 -0
  23. data/app/views/bs5/examples/alert/style/_example.html.erb +2 -0
  24. data/app/views/bs5/examples/alert/style/snippet.html.erb +3 -0
  25. data/app/views/bs5/examples/badge/default/_example.html.erb +2 -0
  26. data/app/views/bs5/examples/badge/default/snippet.html.erb +1 -0
  27. data/app/views/bs5/examples/badge/pill/_example.html.erb +2 -0
  28. data/app/views/bs5/examples/badge/pill/snippet.html.erb +1 -0
  29. data/app/views/bs5/examples/badge/style/_example.html.erb +2 -0
  30. data/app/views/bs5/examples/badge/style/snippet.html.erb +1 -0
  31. data/app/views/bs5/examples/index.html.erb +4 -0
  32. data/app/views/layouts/bs5/application.html.erb +6 -7
  33. data/config/routes.rb +5 -0
  34. data/lib/bs5.rb +3 -1
  35. data/lib/bs5/version.rb +1 -1
  36. data/lib/generators/bs5/install/install_generator.rb +28 -20
  37. data/lib/tasks/bs5_tasks.rake +1 -0
  38. data/lib/tasks/ci.rake +3 -0
  39. data/lib/tasks/rubocop.rake +5 -0
  40. metadata +67 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4eeed7da6108bdb379e711c57a906f8cd5bc66730e0a79485f941b5a1a29651
4
- data.tar.gz: 6b2819922250d5b3449def44bcde45703115fdd234697dbfd8476827d485fe0c
3
+ metadata.gz: 3ee72cbd5fc34edcfe4923bd3d94bc29fe00ff19de68e05ba6655ce4c62c6311
4
+ data.tar.gz: 0dbd89dec2629ec881a73df2644166ec6533896646cde8cbc960fdd529c656c2
5
5
  SHA512:
6
- metadata.gz: 9e034c5d510d1d5518bf505f7c40566db8898e2daedfd051e85312c3ab21b772604f9142cce65bf571564631b0832d6c7510f681bbdc5e1bce31fbe14c533588
7
- data.tar.gz: 4c54522c6bb42cf7485a174ec6675e122211beb3b6e329507576237f15be6bfef0acd795cd76eebc969c9883a9cbd4f69b45067873d8d05b6703093473ad1ce0
6
+ metadata.gz: 10ae1e04be4fbabe8dc937eae77ce0235337a504fa7c8728ee2f1f243e7a44b3ca19d5231efca55488921da9b7695e3471c72cc1ca15b7dc8edcd4ad1e830cf6
7
+ data.tar.gz: 591bd085c636e1a0e575ef9c6fc1a62f399856305808012dcefc5264ebf3dd88067f81a66f2b006b26f8de199267844e90b368d902581bd40d5fec4c9c9d11c8
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a Ruby on Rails engine to include [Bootstrap 5](https://v5.getbootstrap.com/).
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/bs5.svg)](https://badge.fury.io/rb/bs5)
5
+ [![Gem Version](https://badge.fury.io/rb/bs5.svg)](https://badge.fury.io/rb/bs5) [![Build Status](https://travis-ci.org/bazzel/bs5.svg?branch=main)](https://travis-ci.org/bazzel/bs5) [![Ruby Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://rubystyle.guide)
6
6
 
7
7
  ## Usage
8
8
 
@@ -34,117 +34,6 @@ Run the following command to setup your project to use Bootstrap 5.
34
34
 
35
35
  $ rails generate bs5:install
36
36
 
37
- ## Components
38
-
39
- - [Accordion](#accordion) ✅
40
- - [Alert](#alert) ✅
41
- - [Badge](#badge) ✅
42
- - Breadcrumb
43
- - Buttons
44
- - Button group
45
- - Card
46
- - Carousel
47
- - [Close button](#close-button) ✅
48
- - Collapse
49
- - Dropdowns
50
- - List group
51
- - Modal
52
- - Nav & tabs
53
- - Navbar
54
- - Pagination
55
- - Popovers
56
- - Progress
57
- - Scrollspy
58
- - Spinners
59
- - Toasts
60
- - Tooltips
61
-
62
-
63
- ### [Accordion](https://v5.getbootstrap.com/docs/5.0/components/accordion/)
64
-
65
- ```
66
- <%= bs5_accordion do |accordion| %>
67
- <% accordion.slot(:item, title: 'Accordion Item #1', collapsed: false) do %>
68
- <strong>This is the first item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
69
- <% end %>
70
- <% accordion.slot(:item, title: 'Accordion Item #2') do %>
71
- <strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
72
- <% end %>
73
- <% accordion.slot(:item, title: 'Accordion Item #3') do %>
74
- <strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
75
- <% end %>
76
- <%- end %>
77
- ```
78
-
79
- ```
80
- <%= bs5_accordion(flush: true) do |accordion| %>
81
- <% accordion.slot(:item, title: 'Accordion Item #1') do %>
82
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
83
- <% end %>
84
- <% accordion.slot(:item, title: 'Accordion Item #2') do %>
85
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
86
- <% end %>
87
- <% accordion.slot(:item, title: 'Accordion Item #3') do %>
88
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
89
- <% end %>
90
- <%- end %>
91
- ```
92
-
93
- ### [Alert](https://v5.getbootstrap.com/docs/5.0/components/alerts/)
94
-
95
- ```
96
- <%= bs5_alert do %>
97
- A simple primary alert—check it out!
98
- <%- end %>
99
- ```
100
-
101
- ```
102
- <%= bs5_alert(style: :warning, is_dismissable: true) do %>
103
- <strong>Holy guacamole!</strong> You should check in on some of those fields below.
104
- <%- end %>
105
- ```
106
-
107
- ### [Badge](https://v5.getbootstrap.com/docs/5.0/components/badge/)
108
-
109
- ```
110
- <%= bs5_badge(text: 'New') %>
111
- ```
112
-
113
- ```
114
- <%= bs5_badge(text: 'Warning', style: :warning) %>
115
- ```
116
-
117
- ```
118
- <%= bs5_badge(text: 'Danger', style: :danger, pill: true) %>
119
- ```
120
-
121
-
122
- ### [Breadcrumb](https://v5.getbootstrap.com/docs/5.0/components/breadcrumb/)
123
-
124
- ### [Button](https://v5.getbootstrap.com/docs/5.0/components/buttons/)
125
-
126
- ### [Close button](https://v5.getbootstrap.com/docs/5.0/components/close-button/)
127
-
128
- ```
129
- <%= bs5_close_button %>
130
- ```
131
-
132
- ```
133
- <%= bs5_close_button(disabled: true) %>
134
- ```
135
-
136
- ```
137
- <%= bs5_close_button(white: true) %>
138
- ```
139
-
140
- ```
141
- <%= bs5_close_button(data: { controller: 'hello', action: "click->hello#greet }) %>
142
- ```
143
-
144
- ## Previewing components
145
-
146
- - http://localhost:3000/rails/view_components
147
-
148
37
  ## Contributing
149
38
 
150
39
  Contribution directions go here.
@@ -0,0 +1,8 @@
1
+ <div class="mt-4 mb-3">
2
+ <div class="border rounded-2 p-4">
3
+ <%= render template: snippet %>
4
+ </div>
5
+ <div class="highlight p-4">
6
+ <pre class='mb-0'><code><%= highlight %></code></pre>
7
+ </div>
8
+ </div>
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rouge'
4
+
5
+ module Bs5
6
+ class ExampleComponent < ViewComponent::Base
7
+ include ComponentsHelper
8
+
9
+ attr_reader :snippet
10
+
11
+ def initialize(snippet:)
12
+ @snippet = snippet
13
+ @path = snippet.split('/')
14
+ @basename = @path.pop
15
+ end
16
+
17
+ def highlight
18
+ formatter = Rouge::Formatters::HTML.new
19
+ lexer = Rouge::Lexer.find(language)
20
+ formatter.format(lexer.lex(file_content)).html_safe # rubocop:disable Rails/OutputSafety
21
+ end
22
+
23
+ private
24
+
25
+ def file_content
26
+ @file_content ||= file.read
27
+ end
28
+
29
+ def file
30
+ @file ||= examples_path
31
+ .join(*@path)
32
+ .children
33
+ .find { |ch| ch.basename.to_s.start_with?(@basename) }
34
+ end
35
+
36
+ def examples_path
37
+ Engine.root.join('app', 'views', 'bs5', 'examples')
38
+ end
39
+
40
+ def language
41
+ file.extname.delete('.')
42
+ end
43
+ end
44
+ end
@@ -1,5 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bs5
2
4
  class ApplicationController < ActionController::Base
3
5
  protect_from_forgery with: :exception
6
+ before_action :set_views_path
7
+
8
+ private
9
+
10
+ def set_views_path
11
+ append_view_path Engine.root.join('app', 'views', 'bs5', 'examples')
12
+ end
4
13
  end
5
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_dependency 'bs5/application_controller'
4
+
5
+ module Bs5
6
+ class ExamplesController < ApplicationController
7
+ def index; end
8
+ end
9
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bs5
2
4
  module ApplicationHelper
3
5
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bs5
4
+ module ExamplesHelper
5
+ def bs5_example(*args)
6
+ render ExampleComponent.new(*args)
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bs5
2
4
  class ApplicationJob < ActiveJob::Base
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bs5
2
4
  class ApplicationMailer < ActionMailer::Base
3
5
  default from: 'from@example.com'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bs5
2
4
  class ApplicationRecord < ActiveRecord::Base
3
5
  self.abstract_class = true
@@ -0,0 +1,3 @@
1
+ <h2>Accordion</h2>
2
+ <%= render 'bs5/examples/accordion/default/example' %>
3
+ <%= render 'bs5/examples/accordion/flush/example' %>
@@ -0,0 +1,4 @@
1
+ <h2>Alert</h2>
2
+ <%= render 'bs5/examples/alert/default/example' %>
3
+ <%= render 'bs5/examples/alert/style/example' %>
4
+ <%= render 'bs5/examples/alert/dismissable/example' %>
@@ -0,0 +1,4 @@
1
+ <h2>Badge</h2>
2
+ <%= render 'bs5/examples/badge/default/example' %>
3
+ <%= render 'bs5/examples/badge/style/example' %>
4
+ <%= render 'bs5/examples/badge/pill/example' %>
@@ -0,0 +1,2 @@
1
+ <h3>Default</h3>
2
+ <%= bs5_example(snippet: 'accordion/default/snippet') %>
@@ -0,0 +1,11 @@
1
+ <%= bs5_accordion do |accordion| %>
2
+ <% accordion.slot(:item, title: 'Accordion Item #1', collapsed: false) do %>
3
+ <strong>This is the first item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
4
+ <% end %>
5
+ <% accordion.slot(:item, title: 'Accordion Item #2') do %>
6
+ <strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
7
+ <% end %>
8
+ <% accordion.slot(:item, title: 'Accordion Item #3') do %>
9
+ <strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
10
+ <% end %>
11
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h3>Flush</h3>
2
+ <%= bs5_example(snippet: 'accordion/flush/snippet') %>
@@ -0,0 +1,11 @@
1
+ <%= bs5_accordion(flush: true) do |accordion| %>
2
+ <% accordion.slot(:item, title: 'Accordion Item #1') do %>
3
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
4
+ <% end %>
5
+ <% accordion.slot(:item, title: 'Accordion Item #2') do %>
6
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
7
+ <% end %>
8
+ <% accordion.slot(:item, title: 'Accordion Item #3') do %>
9
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
10
+ <% end %>
11
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h3>Default</h3>
2
+ <%= bs5_example(snippet: 'alert/default/snippet') %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_alert do %>
2
+ A simple primary alert—check it out!
3
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h3>Dismissable</h3>
2
+ <%= bs5_example(snippet: 'alert/dismissable/snippet') %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_alert(style: :warning, is_dismissable: true) do %>
2
+ <strong>Holy guacamole!</strong> You should check in on some of those fields below.
3
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h3>Style</h3>
2
+ <%= bs5_example(snippet: 'alert/style/snippet') %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_alert(style: :danger) do %>
2
+ A simple danger alert—check it out!
3
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h3>Default</h3>
2
+ <%= bs5_example(snippet: 'badge/default/snippet') %>
@@ -0,0 +1 @@
1
+ <%= bs5_badge(text: 'New') %>
@@ -0,0 +1,2 @@
1
+ <h3>Pill</h3>
2
+ <%= bs5_example(snippet: 'badge/pill/snippet') %>
@@ -0,0 +1 @@
1
+ <%= bs5_badge(text: 'Danger', style: :danger, pill: true) %>
@@ -0,0 +1,2 @@
1
+ <h3>Style</h3>
2
+ <%= bs5_example(snippet: 'badge/style/snippet') %>
@@ -0,0 +1 @@
1
+ <%= bs5_badge(text: 'Warning', style: :warning) %>
@@ -0,0 +1,4 @@
1
+ <h1>Bootstrap Examples</h1>
2
+ <%= render 'accordion' %>
3
+ <%= render 'alert' %>
4
+ <%= render 'badge' %>
@@ -2,14 +2,13 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Bs5</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag "bs5/application", media: "all" %>
5
+ <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
6
+ <%= stylesheet_pack_tag 'styles', media: 'all', 'data-turbolinks-track': 'reload' %>
7
+ <style><%= Rouge::Themes::Github.render(scope: '.highlight') %></style>
9
8
  </head>
10
9
  <body>
11
-
12
- <%= yield %>
13
-
10
+ <div class="container">
11
+ <%= yield %>
12
+ </div>
14
13
  </body>
15
14
  </html>
@@ -1,2 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Bs5::Engine.routes.draw do
4
+ get 'examples/index'
5
+
6
+ root to: 'examples#index'
2
7
  end
data/lib/bs5.rb CHANGED
@@ -1,4 +1,6 @@
1
- require "bs5/engine"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bs5/engine'
2
4
 
3
5
  module Bs5
4
6
  # Your code goes here...
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs5
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
@@ -1,29 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Bs5::InstallGenerator < Rails::Generators::Base
4
- def add_bootstrap
5
- run 'yarn add bootstrap@next popper.js'
3
+ module Bs5
4
+ class InstallGenerator < Rails::Generators::Base
5
+ def add_bootstrap # rubocop:disable Metrics/MethodLength
6
+ run 'yarn add bootstrap@next popper.js'
6
7
 
7
- create_file 'app/javascript/packs/styles.scss', <<~HEREDOC
8
- @import "~bootstrap/scss/bootstrap";
9
- HEREDOC
10
-
11
- inject_into_file 'app/views/layouts/application.html.erb', before: '</head>' do
12
- <<~HEREDOC
13
- <%= stylesheet_pack_tag 'styles', media: 'all', 'data-turbolinks-track': 'reload' %>
8
+ create_file 'app/javascript/packs/styles.scss', <<~HEREDOC
9
+ @import "~bootstrap/scss/bootstrap";
14
10
  HEREDOC
15
- end
16
11
 
17
- inject_into_file 'app/controllers/application_controller.rb', after: "ActionController::Base\n" do
18
- <<~HEREDOC
19
- helper Bs5::Engine.helpers
20
- HEREDOC
21
- end
12
+ inject_into_file 'app/views/layouts/application.html.erb', before: '</head>' do
13
+ <<~HEREDOC
14
+ <%= stylesheet_pack_tag 'styles', media: 'all', 'data-turbolinks-track': 'reload' %>
15
+ HEREDOC
16
+ end
22
17
 
23
- append_file 'app/javascript/packs/application.js', <<~HEREDOC
24
- import "bootstrap";
25
- HEREDOC
18
+ inject_into_file 'app/controllers/application_controller.rb', after: "ActionController::Base\n" do
19
+ <<~HEREDOC
20
+ helper Bs5::Engine.helpers
21
+ HEREDOC
22
+ end
26
23
 
27
- gsub_file 'config/webpacker.yml', 'extract_css: false', 'extract_css: true'
24
+ inject_into_file 'config/routes.rb', after: "Rails.application.routes.draw do\n" do
25
+ <<~HEREDOC
26
+ mount Bs5::Engine => '/bs5'
27
+ HEREDOC
28
+ end
29
+
30
+ append_file 'app/javascript/packs/application.js', <<~HEREDOC
31
+ import "bootstrap";
32
+ HEREDOC
33
+
34
+ gsub_file 'config/webpacker.yml', 'extract_css: false', 'extract_css: true'
35
+ end
28
36
  end
29
37
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # desc "Explaining what the task does"
2
3
  # task :bs5 do
3
4
  # # Task goes here
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ task ci: %i[rubocop spec]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubocop/rake_task'
4
+
5
+ RuboCop::RakeTask.new(:rubocop)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Baselier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2020-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,6 +30,34 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 6.0.3.4
33
+ - !ruby/object:Gem::Dependency
34
+ name: rouge
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: 3.25.0
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 3.25.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: rubocop-rails
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.8'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.8'
33
61
  - !ruby/object:Gem::Dependency
34
62
  name: view_component
35
63
  requirement: !ruby/object:Gem::Requirement
@@ -45,19 +73,19 @@ dependencies:
45
73
  - !ruby/object:Gem::Version
46
74
  version: 2.22.0
47
75
  - !ruby/object:Gem::Dependency
48
- name: sqlite3
76
+ name: capybara
49
77
  requirement: !ruby/object:Gem::Requirement
50
78
  requirements:
51
- - - ">="
79
+ - - "~>"
52
80
  - !ruby/object:Gem::Version
53
- version: '0'
81
+ version: '3.33'
54
82
  type: :development
55
83
  prerelease: false
56
84
  version_requirements: !ruby/object:Gem::Requirement
57
85
  requirements:
58
- - - ">="
86
+ - - "~>"
59
87
  - !ruby/object:Gem::Version
60
- version: '0'
88
+ version: '3.33'
61
89
  - !ruby/object:Gem::Dependency
62
90
  name: rspec-rails
63
91
  requirement: !ruby/object:Gem::Requirement
@@ -73,19 +101,19 @@ dependencies:
73
101
  - !ruby/object:Gem::Version
74
102
  version: 4.0.1
75
103
  - !ruby/object:Gem::Dependency
76
- name: capybara
104
+ name: sqlite3
77
105
  requirement: !ruby/object:Gem::Requirement
78
106
  requirements:
79
- - - "~>"
107
+ - - ">="
80
108
  - !ruby/object:Gem::Version
81
- version: '3.33'
109
+ version: '0'
82
110
  type: :development
83
111
  prerelease: false
84
112
  version_requirements: !ruby/object:Gem::Requirement
85
113
  requirements:
86
- - - "~>"
114
+ - - ">="
87
115
  - !ruby/object:Gem::Version
88
- version: '3.33'
116
+ version: '0'
89
117
  description: "[WIP] Rails engine to include Bootstrap 5."
90
118
  email:
91
119
  - patrick.baselier@gmail.com
@@ -106,13 +134,37 @@ files:
106
134
  - app/components/bs5/badge_component.rb
107
135
  - app/components/bs5/close_button_component.html.erb
108
136
  - app/components/bs5/close_button_component.rb
137
+ - app/components/bs5/example_component.html.erb
138
+ - app/components/bs5/example_component.rb
109
139
  - app/controllers/bs5/application_controller.rb
140
+ - app/controllers/bs5/examples_controller.rb
110
141
  - app/helpers/bs5/application_helper.rb
111
142
  - app/helpers/bs5/components_helper.rb
143
+ - app/helpers/bs5/examples_helper.rb
112
144
  - app/jobs/bs5/application_job.rb
113
145
  - app/mailers/bs5/application_mailer.rb
114
146
  - app/models/bs5/application_record.rb
115
147
  - app/validators/style_validator.rb
148
+ - app/views/bs5/examples/_accordion.html.erb
149
+ - app/views/bs5/examples/_alert.html.erb
150
+ - app/views/bs5/examples/_badge.html.erb
151
+ - app/views/bs5/examples/accordion/default/_example.html.erb
152
+ - app/views/bs5/examples/accordion/default/snippet.html.erb
153
+ - app/views/bs5/examples/accordion/flush/_example.html.erb
154
+ - app/views/bs5/examples/accordion/flush/snippet.html.erb
155
+ - app/views/bs5/examples/alert/default/_example.html.erb
156
+ - app/views/bs5/examples/alert/default/snippet.html.erb
157
+ - app/views/bs5/examples/alert/dismissable/_example.html.erb
158
+ - app/views/bs5/examples/alert/dismissable/snippet.html.erb
159
+ - app/views/bs5/examples/alert/style/_example.html.erb
160
+ - app/views/bs5/examples/alert/style/snippet.html.erb
161
+ - app/views/bs5/examples/badge/default/_example.html.erb
162
+ - app/views/bs5/examples/badge/default/snippet.html.erb
163
+ - app/views/bs5/examples/badge/pill/_example.html.erb
164
+ - app/views/bs5/examples/badge/pill/snippet.html.erb
165
+ - app/views/bs5/examples/badge/style/_example.html.erb
166
+ - app/views/bs5/examples/badge/style/snippet.html.erb
167
+ - app/views/bs5/examples/index.html.erb
116
168
  - app/views/layouts/bs5/application.html.erb
117
169
  - config/locales/en.yml
118
170
  - config/routes.rb
@@ -122,6 +174,8 @@ files:
122
174
  - lib/generators/bs5/install/USAGE
123
175
  - lib/generators/bs5/install/install_generator.rb
124
176
  - lib/tasks/bs5_tasks.rake
177
+ - lib/tasks/ci.rake
178
+ - lib/tasks/rubocop.rake
125
179
  homepage: https://github.com/bazzel/bs5
126
180
  licenses:
127
181
  - MIT
@@ -134,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
188
  requirements:
135
189
  - - ">="
136
190
  - !ruby/object:Gem::Version
137
- version: '0'
191
+ version: 2.6.6
138
192
  required_rubygems_version: !ruby/object:Gem::Requirement
139
193
  requirements:
140
194
  - - ">="