get_link_list 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac1be854a76b6a26b7f75569836d02c9918a6b98
4
- data.tar.gz: bfc03015b573e95230c591b77f65ec23648274a4
3
+ metadata.gz: 5da00a1cde16c45acd27c4c436986c687c3ae7a6
4
+ data.tar.gz: b1b12bd5d9933168500aaaf8d9fef45df5e927b9
5
5
  SHA512:
6
- metadata.gz: fb2366d635ca1ca6e8f2ddebfce7d1ea109edc73ecdd862f07316cec83b26252bf1e396b10fe5f2cb69f502956361fe3d8e0bce9f66f0454519885cb79f98147
7
- data.tar.gz: 6b10b1e45e2d9855873df8adf619611d7b8d93052d3cbd1585ccfe2dfd5217dc623552c02f0af34e86d28563fac5c040c097efecc15b4f4added5aa08b9174e6
6
+ metadata.gz: bf7fa02c50890254e2a8b33d9913e08c296dba5b9753fd6f7a00d58f526240fa292911487c2853565b12138b534a79409b24f578fa8f8ffde685c1f5a7206312
7
+ data.tar.gz: d02150fd2cf2f07680bf33b5eacecd27c5d57dfddc8ee251da8dd7ca8e412e5d7785178399bca82df5a52e0aff183dbaedc1ccdf596a8a5d7232860a285e44b6
@@ -0,0 +1,10 @@
1
+ module GetLinkList
2
+ class Config
3
+ attr_accessor :ignore_controller
4
+
5
+ def initialize
6
+ @ignore_controller = []
7
+ end
8
+
9
+ end
10
+ end
@@ -1,5 +1,14 @@
1
1
  require 'get_link_list/helper'
2
+ require 'get_link_list/config'
2
3
  module GetLinkList
4
+ def self.config
5
+ @config ||= GetLinkList::Config.new
6
+ end
7
+
8
+ def self.configure(&block)
9
+ yield(config) if block_given?
10
+ end
11
+
3
12
  class Engine < ::Rails::Engine
4
13
  initializer 'get_link_list.action_view_helpers' do
5
14
  ActiveSupport.on_load :action_view do
@@ -4,8 +4,10 @@ module GetLinkList
4
4
  def render_get_links
5
5
  @paths = Hash.new { |hash,key| hash[key] = Hash.new {} }
6
6
  Rails.application.routes.routes.each do |route|
7
- if "GET" =~ route.constraints[:request_method] && route.path.spec.left != "/"
8
- @paths[route.defaults[:controller]][route.defaults[:action]] = match_initial_path_segment(route.path.spec.to_s)
7
+ if "GET" =~ route.constraints[:request_method] && route.path.spec.left != "/"
8
+ if not GetLinkList.config.ignore_controller.include?(route.defaults[:controller])
9
+ @paths[route.defaults[:controller]][route.defaults[:action]] = match_initial_path_segment(route.path.spec.to_s)
10
+ end
9
11
  end
10
12
  end
11
13
  render partial: 'get_link_list/get_link', locals: { paths: @paths }
@@ -1,3 +1,3 @@
1
1
  module GetLinkList
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: get_link_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - candle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2015-08-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: It showed your rails project GET path
14
14
  email:
@@ -30,6 +30,7 @@ files:
30
30
  - app/views/layouts/get_link_list/application.html.erb
31
31
  - config/routes.rb
32
32
  - lib/get_link_list.rb
33
+ - lib/get_link_list/config.rb
33
34
  - lib/get_link_list/engine.rb
34
35
  - lib/get_link_list/helper.rb
35
36
  - lib/get_link_list/version.rb