rails-bootstrap-sass-grid_size_display 0.0.1 → 1.0.0

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: adda83231d0d9768e2d5fbd1bd1bebb2cac7b0cc
4
- data.tar.gz: 046e3d722358d96e65fac247e2b28ea44f22252a
3
+ metadata.gz: 7ba1940003367bccc6f1ca774f73823afdbbe2eb
4
+ data.tar.gz: f4d6b5552f13f9b6b64c43c02ded65b82e958daf
5
5
  SHA512:
6
- metadata.gz: 6c217dfdb927c16cf46d0d4501dab99f5ba54289e7352eec47f58b09a43f5548698853c86d06dcf5cb5334d3d39c08bd496cf7a017f3fe63150dce01b16df4b7
7
- data.tar.gz: b6900d999404a7a6d1fa69794b4df36654e726ab511f77d9d4adf43e05e0cca2edc678dc6306e60d1a9ec09213c2098e16e5a8931093e3577c5e3430deb833db
6
+ metadata.gz: 2f27386a7a3e6ff205b2147cd9cd0d41e93a19d2ed4abc01d94f3751305ff89184fd5116156f8e00bc284a584b6011d6977bd878bbf01cb3be3bc5160bab4260
7
+ data.tar.gz: 06b6da358af98d039e06b5e35c2d198436cf889d1d381ff0de00108768027e643ab70ba87f3db9104c02cc870d6f7d6bfa6b14f20661c101470e75c0a7651a3a
@@ -1,4 +1,4 @@
1
- = GridSizeDisplay
1
+ # GridSizeDisplay
2
2
 
3
3
  If you are using Rails and the bootstrap-sass gem, display a visual indicator to let
4
4
  you know what bootstrap grid size you are using. This gem uses the default
@@ -28,9 +28,7 @@ From the Bootstrap3 documentation:
28
28
  Add this line to your applications Rails + bootstrap-sass enabled application Gemfile:
29
29
 
30
30
  ```ruby
31
- group :development do
32
- gem 'gem_size_display'
33
- end
31
+ gem 'gem_size_display'
34
32
  ```
35
33
 
36
34
  And then execute:
@@ -40,7 +38,6 @@ $ bundle
40
38
  ```
41
39
 
42
40
  Include the Sass partial to your application.scss file. Be sure to include it after bootstrap.
43
-
44
41
  ```sass
45
42
  // app/assets/stylesheets/application.scss
46
43
  ...
@@ -49,6 +46,20 @@ Include the Sass partial to your application.scss file. Be sure to include it af
49
46
  @import "grid_size_display/media_sizes";
50
47
  ```
51
48
 
49
+ ## Configuration
50
+
51
+ The gem is enabled by default if you are in development environment.
52
+ You can add an initializer to control when to enable the gem:
53
+ ```ruby
54
+ # config/initializers/grid_size_display.rb
55
+
56
+ GridSizeDisplay.configure do |config|
57
+ # config.enabled = false
58
+ # config.enabled = Rails.env.development?
59
+ end
60
+ ```
61
+
62
+
52
63
  ## Special query strings
53
64
 
54
65
  By default the visual indicator will be displayed on every request. If you include
@@ -43,7 +43,7 @@ module GridSizeDisplay
43
43
  end
44
44
 
45
45
  def display_grid?(req)
46
- req.session['grid_size_display']
46
+ ::GridSizeDisplay.config.enabled? && req.session['grid_size_display']
47
47
  end
48
48
 
49
49
 
@@ -1,3 +1,3 @@
1
1
  module GridSizeDisplay
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,4 +1,24 @@
1
1
  require "grid_size_display/engine"
2
2
 
3
3
  module GridSizeDisplay
4
+
5
+ def self.config
6
+ @config ||= ::GridSizeDisplay::Config.new
7
+ end
8
+
9
+ def self.configure(&_block)
10
+ yield(config) if block_given?
11
+ end
12
+
13
+ class Config
14
+ attr_accessor :enabled
15
+
16
+ def initialize
17
+ @enabled = Rails.env.development?
18
+ end
19
+
20
+ def enabled?
21
+ @enabled
22
+ end
23
+ end
4
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-bootstrap-sass-grid_size_display
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jennifer Reyes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,7 +106,7 @@ files:
106
106
  - ".gitignore"
107
107
  - Gemfile
108
108
  - MIT-LICENSE
109
- - README.rdoc
109
+ - README.md
110
110
  - Rakefile
111
111
  - app/assets/stylesheets/grid_size_display/_media_sizes.scss
112
112
  - app/controllers/grid_size_display/application_controller.rb