jap_mag 1.3.2 → 1.3.5

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
  SHA256:
3
- metadata.gz: ad7860047ecbc2f0eb308c5c14e8e07f9de20953f5dd711c2f8e1814e7cadeca
4
- data.tar.gz: 434a1f22e88e06163adc8e203b1ea5ae59ca097feed8b2a86e339b0bd1540a6d
3
+ metadata.gz: 6a65ff965780098ac76734497dee642f07790f98115a9d84e2dfb29b1960b6a5
4
+ data.tar.gz: 202a22e1358394c15bfc8e64f19ea6f655466adf01f1ed6385af892eec328a2e
5
5
  SHA512:
6
- metadata.gz: 23c4a705759b652492b56e1f3570f166707bddf2e74a4c42f52224e020c2696657d2a705d421177015586a22d23d7bc4ccc8b8525d9560db6c5e5bd6b03d55d2
7
- data.tar.gz: 15074ed2ba030db699231549944d3108bb37c116ee971df6102f8abfa940af4d424c2e7a4e0ca0a54d8ec2bd56a4c4a4cbfb5afe7ca0e8502b15edab6ab1e518
6
+ metadata.gz: f4c962c085d78a3837788b98ef79dca79cffe5cc671de5dfbe6176b30bde0fe84faff6454dfd5935497f41196bcf3690fc42f0eb5336664be4366606b6d676f3
7
+ data.tar.gz: 856b253088bd36722764e0080d49a25b4896e0a8342c25e809d302dbb92671288d8d1b22822a961d07366f3b3396bbbf33c8dadf2ff1726ed561a40d475902bc
@@ -24,13 +24,16 @@ module JapMagWidgetsHelper
24
24
  end
25
25
 
26
26
  def title *titles
27
- seperator = " - "
27
+ default_options = {
28
+ sitename: I18n.t("logo"),
29
+ seperator: ' - '
30
+ }
28
31
 
29
- default_options = {sitename: _("/logo")}
30
32
  options = titles.last.is_a?(Hash) ? titles.pop : {}
31
33
  options = default_options.merge(options)
32
- page_title = page_title_for_return = titles.join(seperator)
33
- page_title = options[:sitename] + seperator + page_title_for_return if not options[:sitename].blank?
34
+
35
+ page_title = page_title_for_return = titles.join(options[:seperator])
36
+ page_title = options[:sitename] + options[:seperator] + page_title_for_return if not options[:sitename].blank?
34
37
 
35
38
  content_for :title, page_title
36
39
 
@@ -1,3 +1,3 @@
1
1
  module JapMag
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.5"
3
3
  end
data/lib/jap_mag.rb CHANGED
@@ -43,29 +43,15 @@ module JapMag
43
43
  # multiple arguments: "page#index", "page#intro"
44
44
  #
45
45
  def current_controller_action_in?(*args)
46
- controller = params["controller"]
47
- action = params["action"]
46
+ controller = params[:controller]
47
+ action = params[:action]
48
+ #raise args.inspect if args != 'homepage/page#index'
48
49
 
49
- if args.size == 1
50
- if args.first.is_a?(Array)
51
- arguments = args.first.split(" ").first
52
- elsif args.first.is_a?(String)
53
- if args.first.split(" ").size > 1
54
- arguments = args.first.split(" ")
55
- else
56
- arguments = args
57
- end
58
- end
59
- else
60
- arguments = args
61
- end
62
-
63
- #raise arguments.inspect
50
+ args = args.first if args.size == 1 && args.first.is_a?(Array)
64
51
 
65
- arguments.each do |element|
66
- if element.include?("#")
67
- array = element.match(/([a-z\-\_\/]*)#([a-z\-\_]*)/).to_a
68
- c, a = array[1], array[2]
52
+ args.each do |element|
53
+ if element.to_s.include?("#")
54
+ c, a = element.split('#')
69
55
  return true if controller == c && action == a
70
56
  else
71
57
  return true if controller == element
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jap_mag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - DING Yu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2022-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: will_paginate
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.1.4
75
+ rubygems_version: 3.3.5
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: jap_mag-