shim 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module Shim
6
6
 
7
7
  def nav_class(section)
8
8
  if current_section == section
9
- "current-page"
9
+ Shim.configuration.active_nav_class
10
10
  else
11
11
  ""
12
12
  end
@@ -1,16 +1,13 @@
1
1
  require "shim/version"
2
+ require "shim/configuration"
2
3
 
3
4
  module Shim
4
- mattr_accessor :layout, :content_path
5
+ mattr_accessor :layout, :content_path, :configuration
5
6
  @@content_path = "shim/"
6
7
  @@layout = "application"
7
-
8
- def config(&block)
9
- if block.arity == 1
10
- self[&block]
11
- else
12
- instance_eval &block
13
- end
8
+ @@configuration = Shim::Configuration.configure do |config|
9
+ config.active_nav_class = "current-page"
10
+ config
14
11
  end
15
12
 
16
13
  require 'shim/engine'
@@ -0,0 +1,8 @@
1
+ require 'active_support/configurable'
2
+
3
+ module Shim
4
+ class Configuration
5
+ include ActiveSupport::Configurable
6
+ config_accessor :active_nav_class
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Shim
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -104,6 +104,7 @@ files:
104
104
  - config/routes.rb
105
105
  - lib/shim.rb
106
106
  - lib/shim/cli.rb
107
+ - lib/shim/configuration.rb
107
108
  - lib/shim/engine.rb
108
109
  - lib/shim/version.rb
109
110
  - lib/tasks/shim_tasks.rake