trap 0.0.1 → 1.0.0

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: 6dfb4d5ec281807111853d256b36096b66f6a808
4
- data.tar.gz: ea9c65def6b9ca4ad393c4c6a46bfab2f9c6c908
3
+ metadata.gz: a868c88fe829672a906f026eef464625fe63662f
4
+ data.tar.gz: 48ea4bf781f5eb68710f197a190773e2a959c5c6
5
5
  SHA512:
6
- metadata.gz: 794d4945079544069965bbf87969375bdd7c1e436d490afe36c32c4ad61cbd16268d636c900273d9b037e41165d1f64872d20227735d407cd1cb76513a6bd784
7
- data.tar.gz: c05cdc376a26cb0e63654fc227b6c557d761c3cf695afb59298754852789aec20532295bbbe6debd9982c1ab443320d580adcdddca42b26bfbb5488bafdc54dd
6
+ metadata.gz: a1a925558ee5f4ea2543ad4d58d2843c407458fdce6356de8830d1c0693a9fc1f940b1b354fd6d3375fbd00286c8f30120168d431caf517d7e56a9a07ded468c
7
+ data.tar.gz: bc677123fcaf1eae8ae6d8ff0601230d6fa52fcd93ed6ae22d78665768653b465b601cf911820f6f4a8a521c900984bdc24c9881b81f7bf95e2658227abe8d62
@@ -8,6 +8,29 @@ module BootstrapHelper
8
8
  end
9
9
  end
10
10
 
11
+ def dropdown(text, icon = nil, &block)
12
+ content_tag :li, class: :drowdown do
13
+ concat(link_to('#', class: 'dropdown-toggle', data: { toggle: :dropdown }) do
14
+ if icon
15
+ concat icon_element icon
16
+ concat ' '
17
+ end
18
+ concat text
19
+ unless icon
20
+ concat ' '
21
+ concat content_tag :span, '', class: :caret
22
+ end
23
+ end)
24
+ concat(content_tag(:ul, class: 'dropdown-menu') do
25
+ yield block
26
+ end)
27
+ end
28
+ end
29
+
30
+ def icon_element(name)
31
+ content_tag :span, '', class: "glyphicon glyphicon-#{name}"
32
+ end
33
+
11
34
  private
12
35
 
13
36
  def is_active?(path, options = {})
data/lib/trap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Trap
2
- VERSION = "0.0.1"
2
+ VERSION = '1.0.0'
3
3
  end
data/lib/trap.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  require 'trap/version'
2
2
  require 'trap/helpers/bootstrap_helper'
3
3
 
4
- module Trap
5
- include BootstrapHelper
6
- end
4
+ ActionView::Base.send :include, BootstrapHelper
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trap
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
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-12 00:00:00.000000000 Z
11
+ date: 2016-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  requirements: []
81
81
  rubyforge_project:
82
- rubygems_version: 2.4.6
82
+ rubygems_version: 2.5.1
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Bootstrap helpers