ratchet_design 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec25d12b82f3d04fbb1c00a3ec6d972875d06cdb
4
- data.tar.gz: 65a3eb002e2e5e4af5846f831c21f0572ac51868
3
+ metadata.gz: dc99e2c25f82c3a23a552194e2bbfdd1a6c74aa2
4
+ data.tar.gz: 58144f1e8dfd925c152ae286910df228be26f8b1
5
5
  SHA512:
6
- metadata.gz: 073a87361ce7d26ba4ab286477c2e44a37c040918f86774ae4011097580d3d5d5c19241da30d7f3ad14663ee45fa65e945a7cdd21a491666d400d469becf98ac
7
- data.tar.gz: 847a04f20c510d3b1319b1313fb868acdcdb54fb5781588943a678f0d24f91450887309fe94020b9ba7c27a0848a81bd0166929c9eaa9feafe0a0e5e1c6bb81b
6
+ metadata.gz: c121fb3c5243341fa74686b74952a4965130a4df607edf3225ebfbdf650f38a72f3db0d997c1173f37f1f1005724d7d2303e417d02e5a82a10bd76a57c67bef5
7
+ data.tar.gz: 329b50cbaecafc123722ae1ef965a38ed1d49c2a04e2dddecfc4979b0bc7abeacfc21a999ab62c4ac0d3538d5f1af768ae9fb61cb59e971b52c90d1a76cae794
@@ -42,22 +42,21 @@ module Ratchet
42
42
  end
43
43
 
44
44
  # Set custom page selector class
45
- def selector(selector = nil)
46
- selector ? content_for(:selector) { selector } : content_for(:selector).presence
45
+ def page_class(*classes)
46
+ @classes = [] if @classes.nil?
47
+ @classes += classes
48
+ @classes.uniq!
49
+ nil
47
50
  end
48
51
 
49
52
  # Consolidated page class output
50
- def page_class( classnames = nil )
51
- if ( classnames )
52
- @page_classes ||= ''
53
- @page_classes = @page_classes + ' ' + classnames
54
- @page_classes.strip!
55
- else
56
- @page_classes || ''
57
- end
53
+ def page_classes
54
+ page_class = @classes.map(&:to_s).join(" ") rescue nil
55
+ parts = request.path.split("/").reject(&:blank?).reject{|s| s.match(/\A[0-9]+(\.[0-9]+)?\z/)}
56
+ [ parts.last, page_class ].reject(&:blank?).join(" ")
58
57
  end
59
58
 
60
- # Consolidated page class output
59
+ # Main section class output
61
60
  def main_class( classnames = nil )
62
61
  if ( classnames )
63
62
  @main_classes ||= ''
@@ -41,7 +41,7 @@ html
41
41
  / Head
42
42
  = yield :head
43
43
 
44
- body class=page_class
44
+ body class=page_classes
45
45
 
46
46
  / Icon inclusion
47
47
  = render "shared/ratchet/icons"
@@ -1,3 +1,3 @@
1
1
  module RatchetDesign
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end