slabs-rails 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d78997ccb257a32b9bff08684d7b171ae3c81bb
4
- data.tar.gz: f749835a2bcd39c3f42a9c2f57e7d2150e5b514b
3
+ metadata.gz: a18b5febc09781e815cb7e4e64e3cffc97453851
4
+ data.tar.gz: cacbd42f95fa16371443f4302aeb3c4122a7ab62
5
5
  SHA512:
6
- metadata.gz: d1d19a2aa754fb9d7a536cf28ab5561094c1521da1727339e4504fc557e3986d712b126f1b14de2146b39780e70120f95129158a22b9d256b807804d880f7e64
7
- data.tar.gz: 1f94396e5d68eda27a0bef8ed1cca3c66a52b75211dc61dbe6f257ad8f09637d92eec02fbd8974911817a21e5f84c34bff78dab9c8594678cdf5d7c9379bf742
6
+ metadata.gz: 0bd581107fa9bd308d7df6ac004b0659681ae24994a6630617facd2982af5e72bf69740173c4ad664e8908119e86638121682c7fd9207415e69b32695c6bcedf
7
+ data.tar.gz: d9ac11555a251fed664aeabe1ff1204a097bc6e37905603e3a4f1305acd5fe3d1060b6650d64c79d63f20e74cb1e026e11096463e00c7835cb8a41a6bd47199e
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1
4
+ * Standalone sprockets support
5
+
6
+ ## 1.0.0
7
+ * Project start
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2013 Boltech
3
+ Copyright (c) 2016 Boltech
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -3,29 +3,58 @@ Slabs for Rails Asset Pipeline
3
3
 
4
4
  [Slabs](http://github.com/Boltech/slabs/) is an amazing extension for [Bootstrap](http://github.com/twbs/bootstrap), ready to help developers to create websites.
5
5
 
6
+ The slabs gem integrates the Slabs Framework for Rails 4+ Asset Pipeline.
6
7
 
7
8
  ## Installation
8
9
 
9
10
  `slabs` is easy to drop into Rails with the asset pipeline.
10
11
 
11
- In your Gemfile you need to add the `slabs-rails` gem, and ensure that the `sass-rails` gem is present - it is added to new Rails applications by default.
12
+ In your Gemfile you need to add the `bootstrap-sass gem`, `slabs-rails` gem, and ensure that the `sass-rails` gem is present - it is added to new Rails applications by default.
12
13
 
13
14
  ```ruby
14
- gem 'sass-rails', '>= 3.2'
15
15
  gem 'bootstrap-sass', '~> 3.3.6'
16
16
  gem 'slabs-rails'
17
+ gem 'sass-rails', '>= 3.2'
17
18
  ```
18
19
 
20
+ `bundle install` and restart your server to make the files available through the pipeline.
21
+
19
22
  ## Usage
20
23
 
21
- Import Bootstrap and Bolt Framework into a Sass file (for example, `application.css.scss`) to get all the styles, mixins and variables!
22
- We recommend against using `//= require` directives, since none of your other stylesheets will be [able to access][antirequire] the Bootstrap and Bolt BS mixins or variables.
24
+ Import Bootstrap and Bolt Framework into a Sass file (for example, `application.scss`) to get all the styles, mixins and variables!
23
25
 
24
26
  ```scss
27
+ // "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
28
+ @import "bootstrap-sprockets";
25
29
  @import "bootstrap";
26
30
  @import "slabs";
27
31
  ```
28
32
 
33
+ Make sure the file has .scss extension (or .sass for Sass syntax). If you have just generated a new Rails app, it may come with a .css file instead. If this file exists, it will be served instead of Sass, so rename it:
34
+
35
+ ```
36
+ $ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
37
+ ```
38
+
39
+ Then, remove all the `*= require_self` and `*= require_tree` . statements from the sass file. Instead, use `@import` to import Sass files.
40
+
41
+ Do not use `*= require` in Sass or your other stylesheets will not be able to access the Bootstrap mixins or variables.
42
+
43
+ Require Bootstrap Javascripts in `app/assets/javascripts/application.js:`
44
+
45
+
46
+ ```
47
+ //= require jquery
48
+ //= require bootstrap
49
+ //= require slabs
50
+ ```
51
+
52
+ `bootstrap-sprockets` and `bootstrap` should not both be included in `application.js`.
53
+
54
+ `bootstrap-sprockets` provides individual Bootstrap Javascript files (alert.js or dropdown.js, for example), while `bootstrap` provides a concatenated file containing all Bootstrap Javascripts.
55
+
56
+ `slabs-sprockets` provides individual Slabs Javascript files (headers.js or components.js, for example), while `slabs` provides a concatenated file containing all Slabs Javascripts.
57
+
29
58
  ## Credits
30
59
 
31
60
  <!-- feel free to make these link wherever you wish -->
@@ -2,11 +2,11 @@ module SlabsRails
2
2
  class << self
3
3
  # Inspired by Kaminari
4
4
  def load!
5
-
6
5
  if rails?
7
6
  register_rails_engine
7
+ elsif sprockets?
8
+ register_sprockets
8
9
  end
9
-
10
10
  configure_sass
11
11
  end
12
12
 
@@ -28,9 +28,9 @@ module SlabsRails
28
28
  end
29
29
 
30
30
  # Environment detection helpers
31
- def asset_pipeline?
32
- defined?(::Sprockets)
33
- end
31
+ def sprockets?
32
+ defined?(::Sprockets)
33
+ end
34
34
 
35
35
  def rails?
36
36
  defined?(::Rails)
@@ -45,6 +45,11 @@ module SlabsRails
45
45
  def register_rails_engine
46
46
  require 'slabs-rails/engine'
47
47
  end
48
+
49
+ def register_sprockets
50
+ Sprockets.append_path(stylesheets_path)
51
+ Sprockets.append_path(javascripts_path)
52
+ end
48
53
  end
49
54
  end
50
55
 
@@ -0,0 +1,3 @@
1
+ module SlabsRails
2
+ VERSION = '1.0.1'
3
+ end
@@ -1,9 +1,10 @@
1
1
  lib = File.expand_path('../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'slabs-rails/version'
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = "slabs-rails"
6
- s.version = "1.0.0"
7
+ s.version = SlabsRails::VERSION
7
8
  s.authors = ["Jorge Najera"]
8
9
  s.email = 'jorge.najera@boltech.mx'
9
10
  s.summary = "Slabs Framework for Rails"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slabs-rails
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
  - Jorge Najera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -45,6 +45,7 @@ extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
47
  - .gitignore
48
+ - CHANGELOG.md
48
49
  - LICENSE.txt
49
50
  - README.md
50
51
  - assets/images/ajax-loader.gif
@@ -110,6 +111,7 @@ files:
110
111
  - assets/stylesheets/slabs/people/_people-2.scss
111
112
  - lib/slabs-rails.rb
112
113
  - lib/slabs-rails/engine.rb
114
+ - lib/slabs-rails/version.rb
113
115
  - slabs-rails.gemspec
114
116
  homepage: https://github.com/Boltech/slabs-rails
115
117
  licenses:
@@ -131,9 +133,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  version: '0'
132
134
  requirements: []
133
135
  rubyforge_project:
134
- rubygems_version: 2.4.6
136
+ rubygems_version: 2.4.8
135
137
  signing_key:
136
138
  specification_version: 4
137
139
  summary: Slabs Framework for Rails
138
140
  test_files: []
139
- has_rdoc: