gitlab-license 1.3.0 → 1.3.1
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/lib/gitlab/license.rb +18 -6
- data/lib/gitlab/license/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc45d84ba41ec6f999cd4569cdf27b7acaf2476cf87c35e4121369633e1d3251
|
4
|
+
data.tar.gz: 5076ad7c092c002fbf727b8c16fefc41aeb836e1a150f82d311dd3e5b43cac25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab4289143609c6f7d9a225d626b8a8c939e734b8eb39105a1994898b63854416ce2ab5b74ee1cc0dcbaee75c6eec28d5fe2a09a3f638ce08fa4b45b29b9af642
|
7
|
+
data.tar.gz: 9b1e46528d6d2309d40dfba3408fbff1e1edc93b5437ea7b354b08573eb0331a3dcb039b0bf996103a713e3e1470abfadf265c0435b2d33e567af07aa52fc71d
|
data/lib/gitlab/license.rb
CHANGED
@@ -184,16 +184,16 @@ module Gitlab
|
|
184
184
|
@version = version
|
185
185
|
|
186
186
|
@licensee = attributes['licensee']
|
187
|
+
@type = attributes['type']
|
187
188
|
|
188
189
|
# `issued_at` is the legacy name for starts_at.
|
189
190
|
# TODO: Move to starts_at in a next version.
|
190
|
-
%w[issued_at expires_at notify_admins_at notify_users_at block_changes_at].each do |
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
next unless value
|
191
|
+
%w[issued_at expires_at notify_admins_at notify_users_at block_changes_at].each do |attr_name|
|
192
|
+
set_date_attribute(attr_name, attributes[attr_name])
|
193
|
+
end
|
195
194
|
|
196
|
-
|
195
|
+
%w[last_synced_at next_sync_at].each do |attr_name|
|
196
|
+
set_datetime_attribute(attr_name, attributes[attr_name])
|
197
197
|
end
|
198
198
|
|
199
199
|
restrictions = attributes['restrictions']
|
@@ -202,5 +202,17 @@ module Gitlab
|
|
202
202
|
@restrictions = restrictions
|
203
203
|
end
|
204
204
|
end
|
205
|
+
|
206
|
+
def set_date_attribute(attr_name, value, date_class = Date)
|
207
|
+
value = date_class.parse(value) rescue nil if value.is_a?(String)
|
208
|
+
|
209
|
+
return unless value
|
210
|
+
|
211
|
+
send("#{attr_name}=", value)
|
212
|
+
end
|
213
|
+
|
214
|
+
def set_datetime_attribute(attr_name, value)
|
215
|
+
set_date_attribute(attr_name, value, DateTime)
|
216
|
+
end
|
205
217
|
end
|
206
218
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-license
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Douwe Maan
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-02-
|
13
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|