s2p 0.0.6 → 0.0.7
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 +4 -4
- data/LICENSE +21 -0
- data/lib/s2p/component.rb +20 -0
- data/lib/s2p/search.rb +0 -15
- data/lib/s2p/version.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f70e0e13983e0319e806abfb6a3233c9662974e1d4ed4aa5c3399639b52ed217
|
4
|
+
data.tar.gz: 8913f389f10b5cb25889e39ecb61134db36ccd578666137208228391e3c2bcd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e487b0839f7d7dd5799b775013968b6b48bcc6c86a22443abe579cc33b3b13874f7f5b09d41214031031e1bd5cc6c22d7e3ac76cfc4468861c2fd2294dd6fed
|
7
|
+
data.tar.gz: 448b69b923d8e4df14c7c092c3e6773b4e86653871d47b4020688a74e9a244d5e0e22338f364344dc516e98dc4849ecfd6f7cd01f5b5f9de11f6ed2badac926b
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Gregory Brown (skillstopractice.com)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/lib/s2p/component.rb
CHANGED
@@ -58,4 +58,24 @@ module S2P
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
61
|
+
|
62
|
+
module ComponentDebugger
|
63
|
+
def to_html
|
64
|
+
if self.class.const_defined?(:DEBUG_TEMPLATE)
|
65
|
+
t(self.class::DEBUG_TEMPLATE, c: self, x: self.x)
|
66
|
+
else
|
67
|
+
t(DEBUG_TEMPLATE, c: self, x: self.x)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
DEBUG_TEMPLATE = <<-ERB
|
72
|
+
<div class="border border-solid p-3 border-danger">
|
73
|
+
<strong><pre><%= c.class %></pre></strong>
|
74
|
+
|
75
|
+
<% if c.respond_to?(:debugging_info) %>
|
76
|
+
<pre><%= c.debugging_info.pretty_inspect %></pre>
|
77
|
+
<% end %>
|
78
|
+
</div>
|
79
|
+
ERB
|
80
|
+
end
|
61
81
|
end
|
data/lib/s2p/search.rb
CHANGED
@@ -173,21 +173,6 @@ module S2P
|
|
173
173
|
end
|
174
174
|
end
|
175
175
|
|
176
|
-
def cond_localized_date_range(*ranges)
|
177
|
-
ranges.each do |range|
|
178
|
-
cond_localized_date_range!(*range)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
# NOTE: You can use cond_range instead of this method when working with date columns
|
183
|
-
# in the DB as they're zoneless. This method is only necessary when working with
|
184
|
-
# datetime fields, because for those you will need to translate the beginning/end of the
|
185
|
-
# range to the localized beginning/end of day times.
|
186
|
-
def cond_localized_date_range!(start_key, end_key, column)
|
187
|
-
cond(start_key) { |s,v| s.where("#{from.table_name}.#{column} >= ?", PetersenToolbox.to_local_time(Date.parse(v)).beginning_of_day) }
|
188
|
-
cond(end_key) { |s,v| s.where("#{from.table_name}.#{column} <= ?", PetersenToolbox.to_local_time(Date.parse(v)).end_of_day) }
|
189
|
-
end
|
190
|
-
|
191
176
|
attr_reader :from
|
192
177
|
end
|
193
178
|
|
data/lib/s2p/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s2p
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Brown
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-
|
10
|
+
date: 2025-04-04 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Experimental dev utilies from skillstopractice.com. Will eventually find
|
14
13
|
homes in their own gems if they pan out.
|
@@ -17,16 +16,15 @@ executables: []
|
|
17
16
|
extensions: []
|
18
17
|
extra_rdoc_files: []
|
19
18
|
files:
|
19
|
+
- LICENSE
|
20
20
|
- lib/s2p/component.rb
|
21
21
|
- lib/s2p/contractor.rb
|
22
22
|
- lib/s2p/notebook.rb
|
23
23
|
- lib/s2p/search.rb
|
24
24
|
- lib/s2p/version.rb
|
25
|
-
homepage:
|
26
25
|
licenses:
|
27
26
|
- MIT
|
28
27
|
metadata: {}
|
29
|
-
post_install_message:
|
30
28
|
rdoc_options: []
|
31
29
|
require_paths:
|
32
30
|
- lib
|
@@ -41,8 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
39
|
- !ruby/object:Gem::Version
|
42
40
|
version: '0'
|
43
41
|
requirements: []
|
44
|
-
rubygems_version: 3.
|
45
|
-
signing_key:
|
42
|
+
rubygems_version: 3.6.2
|
46
43
|
specification_version: 4
|
47
44
|
summary: Experimental dev utilies from skillstopractice.com
|
48
45
|
test_files: []
|