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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91ef574e09a08bec9b01578773e8e2c09d291280
4
- data.tar.gz: 3bf945c7c0e2d31568bca9bc39d7187a2153e35d
3
+ metadata.gz: b21bf6c2eedd8d5e888b0c0d5189dbd281099b07
4
+ data.tar.gz: 844d88a9f6569104fd0c73765c105b8f212beb97
5
5
  SHA512:
6
- metadata.gz: 167d0296ca91d32099ae506c5e1c8dddeba040d6ecff94e6e00ead47c8d940c0eb727201449a671d4770c7f3219f254e10cd70c769dd94ae70aaa546f966dbab
7
- data.tar.gz: f07eb50756fdf4d873128ded104167da3dba81e3dc07ae6ed17d0c758701268f2fa86395b18388e872b85b78ce0b216c5506762ab5b6acfc59d1cc18a7ca9269
6
+ metadata.gz: a4f26b5100435b389ebf6850848d3477c8ec7a218d0d0e26b7efebae7b07a2b699dee2cb4d47ba617aaab3a2b0c5420a32f18798d888edb789cc8f7a84cebf80
7
+ data.tar.gz: 65eed75f15bbdea85c4362dbe36249385720a3f925596ec5f007b8cfbc27ecefdf9206f1a79112aaf8b197b53dd4dda86adf9bbb1cea9e32a06c32eea4d1ab44
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.3.1 (2016-09-26)
4
+ ### Fixes
5
+ - Prevent menu items from being highlighted which have the same last path element as other menu items
6
+
3
7
  ## 0.3.0 (2016-07-07)
4
8
  ### Changes
5
9
  - Rails 5.0 support
@@ -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 = path
7
- @path_str = path.join('#')
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
- !!(@path_str =~ /\A#{args.join('#')}/i)
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
@@ -1,3 +1,3 @@
1
1
  module RailsMenuManager
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  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.0
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-07-07 00:00:00.000000000 Z
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: