dxlite 0.3.4 → 0.3.5

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: 28362d972f8389e1b817f21be4fb9524ca4188761b4f4128c21a886eb67a11a5
4
- data.tar.gz: df45a19238f82766d2abd14f08dc0f105b6bb1d66e4ddf85c46e4089f2600c8a
3
+ metadata.gz: 52a6f519b3142ed9207a881bf65f9df9afceed0bc0eccdb258aa46b61988f20e
4
+ data.tar.gz: 1df9a6b682dc8a05fea3d88152c2d8fdb6042cc75aa246731fa69374568bacfd
5
5
  SHA512:
6
- metadata.gz: 515c3ed54028756c1ff4a5e660f204b878b0c2098f8de61ac43096c7b3191d2a2ffaf9b8d1f0a5f8fed62d80dd22845661c2927bc40bddc5a44c02986e1b32bc
7
- data.tar.gz: e8aa916f1ebf5118440c45d75c75ec116d64cd98215ba1a0b9d85c49d8c4d92530d7686f1833097506f6453e8370587700c1dd67aba88ab51ff4ee0c24703932
6
+ metadata.gz: 641a55501dcada49b36db49c38cbbaf66d94283b9c96f5572a7cfce098b651e899d0d3cdede7561cd2b0ce53b42f3a0b1c97518e39cf12ed75b0ca4ead920cef
7
+ data.tar.gz: 1b5abceae389e71fd4f813e6cc841abf212eab8db0a56800dc1f627452b454593cf4b86ced042b8ce14a33c6ae34908f3ef90b968f39979fb268cf1feb2781f0
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1,2 @@
1
- ^���D/��1��M���1�.k<�.Z�4��c�uװ'.������[�
2
- ��HErr�=��ÆXr�`�]��JS`xp VѤ�X5��x4DYOy[��}����3@����>6UC�BH&
3
- ��Rj4�Kl�: �����Yϖ?g���kiF�n����� ~ܞ({y3��eL�l�K�ЎVF7����߰z��w�(�"�"c�3p�&u�>e<���6�B��\�˲�(-+�P��ϐ��g���>�jb�j�r����%�`,��}��,��a�ot'.&_&82���\�]>�{bo .�o%���Ĝ7���ҙ
4
- ���X��-������ڇ���dIl�X�n�!�i?�Ɇ�aQ���4
1
+ o�U!05<Zz��4C4&Psep�+Em�+�E���mOd�4>�~�AW?C/(���&�m|��
2
+ N�Ň� � �CÍ�T�I��F'�د2vh�<���]���\B)Ú�Q�����9���GDHIT�̦�\Za��*�ͷwo��*�������^�@����f�� ��������hߋ��n��=J��4hm��/���Y��i+}r3"`�e��I��9?���nr'X?�ʅ6/=����]�(�ij�0��������Y�o*��z�1�=n�Ը��*�c*l�S�hv�$�޽bHc���O�V �wB���Dcһ+�'�b�r�Ƞ���E(���
data.tar.gz.sig CHANGED
Binary file
data/lib/dxlite.rb CHANGED
@@ -11,7 +11,7 @@ require 'rxfhelper'
11
11
  class DxLite
12
12
  using ColouredText
13
13
 
14
- attr_accessor :summary, :filepath
14
+ attr_accessor :summary, :filepath, :schema
15
15
  attr_reader :records
16
16
 
17
17
  def initialize(s=nil, autosave: false, debug: false)
@@ -92,9 +92,25 @@ class DxLite
92
92
  end
93
93
 
94
94
  def create(rawh, id: nil, custom_attributes: {created: Time.now})
95
+
96
+ if id.nil? then
97
+
98
+ puts '@records: ' + @records.inspect if @debug
99
+
100
+ if @records then
101
+ id = @records.map {|x| x[:id].to_i}.max.to_i + 1
102
+ else
103
+ @records = []
104
+ id = 1
105
+ end
106
+
107
+ end
95
108
 
96
- id ||= @records.map {|x| x[:id].to_i}.max.to_i + 1
97
109
  h2 = custom_attributes
110
+
111
+ fields = rawh.keys
112
+ puts 'fields: ' + fields.inspect if @debug
113
+
98
114
  h3 = fields.map {|x| [x.to_sym, nil] }.to_h.merge(rawh)
99
115
  h = {id: id.to_s, created: h2[:created], last_modified: nil, body: h3}
100
116
  @records << h
@@ -121,7 +137,9 @@ class DxLite
121
137
  if obj.is_a? Array then
122
138
 
123
139
  unless schema() then
140
+ puts 'obj.first: ' + obj.first.inspect if @debug
124
141
  cols = obj.first.keys.map {|c| c == 'id' ? 'uid' : c}
142
+ puts 'after cols' if @debug
125
143
  self.schema = "items/item(%s)" % cols.join(', ')
126
144
  end
127
145
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  dwbAN6/wokoLVZAiMRG1vZlI6RhtSOTHvFHbfBE5JI9rhjRtui8yeV+t8iI8G4Zs
36
36
  2NszuYzdlVfzlrUiPWY5jL9P
37
37
  -----END CERTIFICATE-----
38
- date: 2021-01-31 00:00:00.000000000 Z
38
+ date: 2021-02-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: recordx
metadata.gz.sig CHANGED
Binary file