hellobase 0.1.14 → 0.1.18
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c845087b29c43d1b30d6b890516a532baa1c6848d57ee4dc0ba8be27837bea1b
|
4
|
+
data.tar.gz: 77adb590420eb53377250526052986e60c468a460bb308c3404e42fbf0c03f14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc84120eca87a3faeea1a8a8fe8b7da9ff8af48e77ff0cb13e73b76a6e498ee167af925be81062af45dca9d6be3b6a9a425dc7da8465f2ecd9a769aa16c80ec1
|
7
|
+
data.tar.gz: 632211e4b6007b5c1f42ec54c9797843a87b616b0917d4ca2ca7c5d562b4a66c84adf7e75f4c53249500d07a13dbd34201af4fba5265c89ad3be8e1de703ef09
|
@@ -20,7 +20,7 @@ Time.singleton_class.prepend(
|
|
20
20
|
|
21
21
|
def new(*args)
|
22
22
|
# only allow ActiveSupport::TimeZone to use Time.new
|
23
|
-
unless caller_locations
|
23
|
+
unless caller_locations.any? {|loc| loc.path.end_with? '/active_support/values/time_zone.rb' }
|
24
24
|
raise Hellobase::Error.new(:datetime_new, nil)
|
25
25
|
end
|
26
26
|
|
data/lib/hellobase/core_ext.rb
CHANGED
@@ -7,55 +7,52 @@ require 'active_admin/inputs'
|
|
7
7
|
class DatepickerWithTimeInput
|
8
8
|
include ::Formtastic::Inputs::Base
|
9
9
|
|
10
|
-
def self.virtual_attributes(
|
11
|
-
[:"_dpwt_#{
|
10
|
+
def self.virtual_attributes(base)
|
11
|
+
[:"_dpwt_#{base}_d", :"_dpwt_#{base}_h", :"_dpwt_#{base}_m"]
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.define_virtual_attributes(klass,
|
15
|
-
|
14
|
+
def self.define_virtual_attributes(klass, base)
|
15
|
+
attrs = virtual_attributes(base)
|
16
|
+
ivars = attrs.map {|a| :"@#{a}" }
|
17
|
+
method = :"_dpwt_set_#{base}"
|
16
18
|
|
17
|
-
klass.class_eval
|
18
|
-
|
19
|
-
|
20
|
-
def _dpwt_#{attr}_d
|
21
|
-
self.#{attr}&.strftime('%Y-%m-%d')
|
19
|
+
klass.class_eval do
|
20
|
+
define_method attrs[0] do
|
21
|
+
send(base)&.strftime('%Y-%m-%d')
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
define_method attrs[1] do
|
25
|
+
send(base)&.strftime('%H')
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
define_method attrs[2] do
|
29
|
+
send(base)&.strftime('%M')
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
attrs.each_with_index do |a, i|
|
33
|
+
define_method :"#{a}=" do |val|
|
34
|
+
instance_variable_set ivars[i], val
|
35
|
+
send(method)
|
35
36
|
|
36
|
-
|
37
|
+
val
|
38
|
+
end
|
37
39
|
end
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
define_method method do
|
42
|
+
send :"#{base}=",
|
43
|
+
ivars.any? {|v| instance_variable_get(v).blank? } ?
|
44
|
+
nil :
|
45
|
+
[
|
46
|
+
instance_variable_get(ivars[0]),
|
47
|
+
[
|
48
|
+
instance_variable_get(ivars[1]),
|
49
|
+
instance_variable_get(ivars[2])
|
50
|
+
].join(':')
|
51
|
+
].join(' ')
|
44
52
|
end
|
45
53
|
|
46
|
-
|
47
|
-
|
48
|
-
_dpwt_set_#{attr}
|
49
|
-
|
50
|
-
val
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
def _dpwt_set_#{attr}
|
56
|
-
self.#{attr} = @_dpwt_#{attr}_d.blank? || @_dpwt_#{attr}_h.blank? || @_dpwt_#{attr}_m.blank? ? nil : [@_dpwt_#{attr}_d, [@_dpwt_#{attr}_h, @_dpwt_#{attr}_m].join(':')].join(' ')
|
57
|
-
end
|
58
|
-
RUBY
|
54
|
+
private method
|
55
|
+
end
|
59
56
|
end
|
60
57
|
|
61
58
|
def to_html
|
data/lib/hellobase/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hellobase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
|
-
rubygems_version: 3.
|
181
|
+
rubygems_version: 3.2.32
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: Ruby runtime environment for Hellobase
|