dynarex 1.5.41 → 1.5.42

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
  SHA1:
3
- metadata.gz: 842bde190d3cb79c50892bc960f7f31fcf918319
4
- data.tar.gz: 9e16299717daf5f49463324dbe62878d40bc525a
3
+ metadata.gz: 57081646a9a8b349a8fb4e204f71aa8f28b81604
4
+ data.tar.gz: b9ed9c832cf3dc9c249fa9df8211852af17cfb5c
5
5
  SHA512:
6
- metadata.gz: 6731218f52c4d9cfa89a92550b09ef712bef397d9241e0a8651f85c851f4b34c5b26bb931b56b8fdd9d300ec529b633160d8eeedae94196b6c51bd32b117cd87
7
- data.tar.gz: 154490d98941e7a4b65e6d6cb3c248708238d6c6c060f15122f1fe931ce518aa1376bbca5a58bf3d1ef6dd40db43ba268a9a9e797b0e17a052bce2c75d638774
6
+ metadata.gz: 9441eb13e214b144bf12af9b11d3cc0d085ce4052c70eb3055522cefaa694e7a1cefd1b89bc52593cba233882d49fbcf70d576111171ef53f259f346c8a19b83
7
+ data.tar.gz: 0decd6196dbeeb393755d637a4fd647f3a75c371f5af39754c21215dd71f4d4c5a66d442aa48042aa023b696e4a7f6920b2ab4d87c612ca91f2b3f170fce9a2b
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -27,7 +27,7 @@ end
27
27
  class Dynarex
28
28
 
29
29
  attr_accessor :format_mask, :delimiter, :xslt_schema, :schema, :linked,
30
- :order, :type, :limit_by, :xslt
30
+ :order, :type, :limit, :xslt
31
31
 
32
32
 
33
33
  #Create a new dynarex document from 1 of the following options:
@@ -44,14 +44,9 @@ class Dynarex
44
44
  @delimiter = ''
45
45
  @spaces_delimited = false
46
46
  @order = 'ascending'
47
+ @limit = nil
47
48
 
48
49
  openx(rawx.clone) if rawx
49
- =begin 160315
50
- if @order == 'descending' then
51
- @records = records_to_h(:descending)
52
- rebuild_doc
53
- end
54
- =end
55
50
 
56
51
  end
57
52
 
@@ -122,15 +117,9 @@ class Dynarex
122
117
 
123
118
  def order=(value)
124
119
 
125
- self.summary.merge!({order: value})
126
- =begin jr 160315
127
- if @order == 'ascending' and value == 'descending' then
128
- sort_records
129
- elsif @order == 'descending' and value == 'ascending'
130
- sort_records
131
- end
132
- =end
133
- @order = value
120
+ self.summary.merge!({order: value.to_s})
121
+
122
+ @order = value.to_s
134
123
  end
135
124
 
136
125
  def recordx_type()
@@ -147,10 +136,6 @@ class Dynarex
147
136
  @summary[:type] = v
148
137
  end
149
138
 
150
- def limit_by=(val)
151
- @limit_by = val.to_i
152
- end
153
-
154
139
  # Returns the hash representation of the document summary.
155
140
  #
156
141
  def summary
@@ -700,12 +685,20 @@ EOF
700
685
  def display_xml(options={})
701
686
 
702
687
  opt = {unescape_html: false}.merge options
703
- load_records if @dirty_flag == true
704
- doc = rebuild_doc(:external)
688
+
689
+ state = :external
690
+
691
+ if @dirty_flag == true then
692
+ load_records
693
+ state = :internal
694
+ end
695
+
696
+ doc = rebuild_doc(state)
697
+
705
698
  if opt[:unescape_html] == true then
706
- doc.content(opt) #jr230711 pretty: true
699
+ doc.content(opt)
707
700
  else
708
- doc.xml(opt) #jr230711 pretty: true
701
+ doc.xml(opt)
709
702
  end
710
703
  end
711
704
 
@@ -951,7 +944,6 @@ EOF
951
944
  h.each {|key, item| h.delete(key) if not h2.has_key? key}
952
945
 
953
946
  @flat_records = @records.values.map{|x| x[:body]}
954
- @flat_records = @flat_records.take @limit_by if @limit_by
955
947
 
956
948
  rebuild_doc
957
949
  self
@@ -1101,8 +1093,7 @@ EOF
1101
1093
  def load_records
1102
1094
 
1103
1095
  @records = records_to_h
1104
-
1105
- @records = @records.take @limit_by if @limit_by
1096
+
1106
1097
 
1107
1098
  @records.instance_eval do
1108
1099
  def delete_item(i)
@@ -1123,6 +1114,7 @@ EOF
1123
1114
 
1124
1115
  i = @doc.root.xpath('max(records/*/attribute::id)') || 0
1125
1116
  records = @doc.root.xpath('records/*')
1117
+ records = records.take @limit if @limit
1126
1118
 
1127
1119
  recs = records #jr160315 (order == :descending ? records.reverse : records)
1128
1120
  a = recs.inject({}) do |result,row|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.41
4
+ version: 1.5.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  zafTuKRozNy5wCw7Z32VaDGcJ+yTPq73CrcPrNyaoxqGfU0qNsh6oGvwrq4Q1k4j
32
32
  Pz2GWE7KigXTBg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-10-30 00:00:00.000000000 Z
34
+ date: 2015-10-31 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex-import
metadata.gz.sig CHANGED
Binary file