rails_base 0.75.4 → 0.75.6
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7be240ad162cad85b3a70e4163f99eea08a0eec55d8ce97ab6a9e83f59d6559a
|
4
|
+
data.tar.gz: 8357b2607d6eae820b73be0e794ad6cab80912d7cf02d6524f4ba95d47626caf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ff5f552ba5e901555fdfd4df622a0c3bccef9e0e1f169fcfd50778143814ba7796483c2876121c67885ffc7dc9145c5ebc12954f47016497924a53c5c43d0a
|
7
|
+
data.tar.gz: 2ae800d156442306b2f34374c1e0c5ab417e233c57c1aa341c516da5df110c2af3c0227dcee5112fb28ba51ed549b8cd598b0f15e38b77a3bad5c4f27d7bb02d
|
@@ -15,6 +15,7 @@
|
|
15
15
|
close_display = start_open ? 'inline' : 'none'
|
16
16
|
open_display = !start_open ? 'inline' : 'none'
|
17
17
|
id_transposed = "id_transposed_#{rand(100_000..999_999)}"
|
18
|
+
function_name = options.fetch(:function_name, id_transposed)
|
18
19
|
%>
|
19
20
|
|
20
21
|
<% if use_fa_icon %>
|
@@ -49,6 +50,33 @@
|
|
49
50
|
<% end %>
|
50
51
|
});
|
51
52
|
|
53
|
+
function <%= function_name %>_collapse_open(){
|
54
|
+
_rails_base_toggle_base_footer('hide')
|
55
|
+
$(`#<%= body %>`).collapse('show')
|
56
|
+
<% if use_fa_icon %>
|
57
|
+
$(`#<%= fa_icon_span_id %> .open`).hide()
|
58
|
+
$(`#<%= fa_icon_span_id %> .closed`).show()
|
59
|
+
<% end %>
|
60
|
+
}
|
61
|
+
|
62
|
+
function <%= function_name %>_collapse_close(){
|
63
|
+
_rails_base_toggle_base_footer('hide')
|
64
|
+
$(`#<%= body %>`).collapse('hide')
|
65
|
+
<% if use_fa_icon %>
|
66
|
+
$(`#<%= fa_icon_span_id %> .open`).show()
|
67
|
+
$(`#<%= fa_icon_span_id %> .closed`).hide()
|
68
|
+
<% end %>
|
69
|
+
}
|
70
|
+
|
71
|
+
function <%= function_name %>_collapse_toggle(){
|
72
|
+
_rails_base_toggle_base_footer('hide')
|
73
|
+
$(`#<%= body %>`).collapse('toggle')
|
74
|
+
<% if use_fa_icon %>
|
75
|
+
$(`#<%= fa_icon_span_id %> .open`).toggle()
|
76
|
+
$(`#<%= fa_icon_span_id %> .closed`).toggle()
|
77
|
+
<% end %>
|
78
|
+
}
|
79
|
+
|
52
80
|
$(`#<%= body %>`).on('shown.bs.collapse', function () {
|
53
81
|
_rails_base_reload_base_footer();
|
54
82
|
_rails_base_toggle_base_footer('show')
|
data/lib/rails_base/version.rb
CHANGED
data/lib/rails_base.rb
CHANGED
@@ -73,17 +73,30 @@ module RailsBase
|
|
73
73
|
# This can be very useful if you want to add new methods to already defined classes from RailsBase
|
74
74
|
# EG: You want to add a new method to the User Model
|
75
75
|
# EG: You want to overload a method for the services/rails_base/name_change.rb
|
76
|
-
def self.reloadable_paths!(relative_path
|
76
|
+
def self.reloadable_paths!(relative_path: nil, only_files: [], skip_files: [])
|
77
77
|
unless Array === skip_files
|
78
78
|
raise ArgumentError, "When `skip_files` provided, it is expected to be an array"
|
79
79
|
end
|
80
80
|
|
81
|
-
|
82
|
-
|
81
|
+
unless Array === only_files
|
82
|
+
raise ArgumentError, "When `only_files` provided, it is expected to be an array"
|
83
|
+
end
|
84
|
+
|
85
|
+
override_files = if relative_path
|
86
|
+
Dir.glob("#{Rails.root.join(relative_path)}/**/*.rb")
|
87
|
+
elsif only_files.presence
|
88
|
+
only_files.map { Rails.root.join(_1) }
|
89
|
+
else
|
90
|
+
[]
|
91
|
+
end
|
92
|
+
|
93
|
+
Rails.autoloaders.main.ignore(*override_files)
|
83
94
|
|
84
95
|
Rails.configuration.to_prepare do
|
85
|
-
|
86
|
-
|
96
|
+
override_files.sort.each do |override|
|
97
|
+
if skip_files.any? { override.include?(_1) }
|
98
|
+
next
|
99
|
+
end
|
87
100
|
|
88
101
|
load override
|
89
102
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.75.
|
4
|
+
version: 0.75.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|