incline 0.2.16 → 0.2.17

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: f2846685d579c97b8dea5676b5658caffc91c8ce
4
- data.tar.gz: f72cb83c349d080073bab59993a94b936fbc903f
3
+ metadata.gz: 26b57eeb71154ecd78ca518cff42f4611b83039d
4
+ data.tar.gz: deaf5ce2ff1810f725b928d00aec489e80e63a76
5
5
  SHA512:
6
- metadata.gz: f5afc6ca4f6a52f9cabba786848ba7e51c2f4550860ee18967517b65bbd22a599fc8c35fd55da6838b1135b20613ca2cda57f06ae18419a32e394f36c29ff5da
7
- data.tar.gz: c9a5a3995188ff87793a9e5e9d40a44862697a943cde1e92ef1b8e06a44f8ac5a40fa778e6310bebf6cac401e315abb8ff6c4a6af727d602a20ef70365bdee62
6
+ metadata.gz: 0b1350992064923d07dbdd0de0257ebbe98f9bf308a62b5b35d3dbe36dfd9c90f905fb1b18d16009ba82b4ee7438eb090820c4c80424a3698bd240cb58a96917
7
+ data.tar.gz: 25bc635ab9533868136a17239a0141ab7922d74f814eb11a99de455055334b04cbcbf052cfab22b7906c9b88be7c08bcbf06f68498fec9cfae78acf6b40d7d0c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incline (0.2.16)
4
+ incline (0.2.17)
5
5
  ansi (~> 1.5.0)
6
6
  bcrypt
7
7
  bootstrap-sass
@@ -58,7 +58,7 @@ GEM
58
58
  tzinfo (~> 1.1)
59
59
  ansi (1.5.0)
60
60
  arel (6.0.4)
61
- autoprefixer-rails (7.1.4.1)
61
+ autoprefixer-rails (7.1.5)
62
62
  execjs
63
63
  bcrypt (3.1.11)
64
64
  bootstrap-sass (3.3.7)
@@ -140,7 +140,7 @@ GEM
140
140
  redcarpet (3.4.0)
141
141
  rubyserial (0.4.0)
142
142
  ffi (~> 1.9, >= 1.9.3)
143
- sass (3.5.1)
143
+ sass (3.5.2)
144
144
  sass-listen (~> 4.0.0)
145
145
  sass-listen (4.0.0)
146
146
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -109,20 +109,39 @@ module Incline
109
109
  @valid_items = nil if refresh
110
110
  @valid_items ||=
111
111
  begin
112
- Incline::ActionSecurity.update_all(visible: false)
112
+ # remove all paths and set all items to hidden.
113
+ Incline::ActionSecurity.update_all(visible: false, path: '#')
113
114
 
114
115
  ret = Incline
115
116
  .route_list
116
- .reject{|r| r[:action] == 'api'}
117
+ .reject{|r| %w(api locate).include?(r[:action]) }
117
118
  .map do |r|
119
+
118
120
  item = ActionSecurity.find_or_initialize_by(controller_name: r[:controller], action_name: r[:action])
119
- item.path = "#{r[:path]} [#{r[:verb]}]"
121
+
122
+ # ensure the current path is set to the item.
123
+ item_path = "#{r[:path]} [#{r[:verb]}]"
124
+ if item.path == '#' || item.path.blank?
125
+ item.path = item_path
126
+ # only update the flags once if the path has not yet been set.
127
+ item.update_flags if update_flags
128
+ elsif !item.path.include?(item_path)
129
+ item.path += "\n" + item_path
130
+ end
131
+
132
+ # re-sort the path list and make the item visible.
133
+ item.path = item.path.split("\n").sort.join("\n")
120
134
  item.visible = true
121
- item.update_flags if update_flags
135
+
122
136
  item.save!
123
137
  item
138
+ end.sort do |a,b|
139
+ if a.controller_name == b.controller_name
140
+ a.action_name <=> b.action_name
141
+ else
142
+ a.controller_name <=> b.controller_name
143
+ end
124
144
  end
125
- .sort{|a,b| a.controller_name == b.controller_name ? a.action_name <=> b.action_name : a.controller_name <=> b.controller_name}
126
145
 
127
146
  def ret.[](*args)
128
147
  if args.length == 2
@@ -41,7 +41,17 @@
41
41
  {
42
42
  data: 'path',
43
43
  orderable: true,
44
- searchable: true
44
+ searchable: true,
45
+ render: function(data, type, row, meta) {
46
+ if (type === 'display')
47
+ {
48
+ return data.replace(/\n/g, '<br>');
49
+ }
50
+ else
51
+ {
52
+ return data;
53
+ }
54
+ }
45
55
  },
46
56
  {
47
57
  data: 'controller_name',
@@ -1,3 +1,3 @@
1
1
  module Incline
2
- VERSION = "0.2.16"
2
+ VERSION = "0.2.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: incline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beau Barker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2017-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails