Skip to content

Commit

Permalink
Require Bootstrap as a dependency and update assets
Browse files Browse the repository at this point in the history
Maintaining assets up-to-date may be difficult sometimes when you have a lot of them.
To minimize this work, Bootstrap was added as a runtime dependency
so that its most recent stable version is installed along with sb-admin.
As for the other dependencies, the lack of an official maintained Rails gem makes it impossible to do the same.
Therefore, those were updated to their latest version as of the date of this commit.
  • Loading branch information
neemiasvf committed May 2, 2018
1 parent 277dd09 commit 42c971f
Show file tree
Hide file tree
Showing 13 changed files with 2,157 additions and 23,491 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
/spec/reports/
/tmp/
/*.gem
.idea/
.DS_Store
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ Or install it yourself as:

## Usage

This gem has two dependencies: `jquery-rails` and `font-awesome-rails` in order to keep updated the versions of **jQuery** and **font-awesome**, so be sure to require `jquery-rails` on your `application.js` before require the `bootstrap_sb_admin_base_v1` file like so:
This gem has three dependencies: `jquery-rails`, `font-awesome-sass` and `bootstrap` in order to keep updated the versions of **jQuery**, **Font Awesome** and **Bootstrap**, so be sure to require these on your `application.js` before requiring the `bootstrap_sb_admin_base_v1` file like so:

```ruby
//= require jquery
//= require jquery3
//= require popper
//= require bootstrap
//= require bootstrap_sb_admin_base_v1
//= require turbolinks
//= require_tree .
```

and on the `application.css` file, be sure to require the `font-awesome-rails` file:
and on the `application.scss` file, be sure to require the `font-awesome-sass` and `bootstrap` file:

```ruby
*= require font-awesome
*= require bootstrap_sb_admin_base_v1
@import 'bootstrap';
@import 'font-awesome-sprockets';
@import 'font-awesome';
@import 'bootstrap_sb_admin_base_v1';
```

And you're ready to use the HTML structure of the Bootstrap based admin theme SB Admin on your Rails application. All the details and documentation about this are [here](http://startbootstrap.com/template-overviews/sb-admin/).
Expand Down
7 changes: 4 additions & 3 deletions bootstrap_sb_admin_base_v1.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require 'bootstrap_sb_admin_base_v1/version'
Gem::Specification.new do |spec|
spec.name = "bootstrap_sb_admin_base_v1"
spec.version = BootstrapSbAdminBaseV1::VERSION
spec.authors = ["Ivan Gonzalez"]
spec.email = ["[email protected]"]
spec.authors = ["Ivan Gonzalez", "Neemias Freitas"]
spec.email = ["[email protected]", "[email protected]"]

spec.summary = "Rails gem of the Bootstrap based admin theme SB Admin"
spec.description = "Rails gem of the Bootstrap based admin theme SB Admin. Originally created by Start Bootstrap. You could check the original theme on https://github.com/BlackrockDigital/startbootstrap-sb-admin"
Expand All @@ -20,5 +20,6 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_runtime_dependency "jquery-rails"
spec.add_runtime_dependency "font-awesome-rails"
spec.add_runtime_dependency "font-awesome-sass"
spec.add_runtime_dependency "bootstrap"
end
3 changes: 2 additions & 1 deletion lib/bootstrap_sb_admin_base_v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module BootstrapSbAdminBaseV1
module Rails
class Engine < ::Rails::Engine
require "jquery-rails"
require "font-awesome-rails"
require "font-awesome-sass"
require "bootstrap"
end
end
end
2 changes: 1 addition & 1 deletion lib/bootstrap_sb_admin_base_v1/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BootstrapSbAdminBaseV1
VERSION = "0.1.0"
VERSION = "0.1.1"
end
Loading

0 comments on commit 42c971f

Please sign in to comment.