rails-menu-manager 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rails_menu_manager/menu_item.rb +11 -4
- data/lib/rails_menu_manager/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b21bf6c2eedd8d5e888b0c0d5189dbd281099b07
|
4
|
+
data.tar.gz: 844d88a9f6569104fd0c73765c105b8f212beb97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4f26b5100435b389ebf6850848d3477c8ec7a218d0d0e26b7efebae7b07a2b699dee2cb4d47ba617aaab3a2b0c5420a32f18798d888edb789cc8f7a84cebf80
|
7
|
+
data.tar.gz: 65eed75f15bbdea85c4362dbe36249385720a3f925596ec5f007b8cfbc27ecefdf9206f1a79112aaf8b197b53dd4dda86adf9bbb1cea9e32a06c32eea4d1ab44
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
module RailsMenuManager
|
2
2
|
class MenuItem
|
3
|
+
PATH_SEPARATOR = 0x1F.chr
|
4
|
+
|
3
5
|
attr_reader :path, :options
|
4
6
|
|
5
7
|
def initialize(path, options = {})
|
6
|
-
@path
|
7
|
-
@
|
8
|
-
@options = options
|
8
|
+
@path = path
|
9
|
+
@options = options
|
9
10
|
end
|
10
11
|
|
11
12
|
def in?(*args)
|
12
13
|
return false if path.nil?
|
13
14
|
|
14
|
-
!!(
|
15
|
+
!!(path_as_string(path) =~ /\A#{path_as_string(args)}/i)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def path_as_string(path)
|
21
|
+
path.join(PATH_SEPARATOR) + PATH_SEPARATOR
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-menu-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Schwab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -136,4 +136,3 @@ signing_key:
|
|
136
136
|
specification_version: 4
|
137
137
|
summary: Simple menu manager for Rails.
|
138
138
|
test_files: []
|
139
|
-
has_rdoc:
|