asterisk_mini_statement 0.1.4 → 0.1.5

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: c13c22c873c5639258a9ebfcee0cc65e6fd81585
4
- data.tar.gz: 52a662d74c97cc39a8801691c6732783446f2f39
3
+ metadata.gz: 1210d73f6bc4b557e5f4af98b7dcc75644f5f669
4
+ data.tar.gz: 1b9c7de2395480df3577ceca41524771b0febd1e
5
5
  SHA512:
6
- metadata.gz: 4a329cb3670bcb27686f64b15fbae1b74ad021bfc8d256443489a8f88e3a388a568430ef52bb303fa5cdd004b4dda72d4d7c3e2190790a2935135acd0271a4f3
7
- data.tar.gz: 62459d67951f77f39d3dc8dad190f5c0ba7609a43a36efeced2de039d2ea705b8c26eff8484f671779591f1dbe722c86814e572b1b0b3cba0d2d05909508271d
6
+ metadata.gz: 3658953cf085dcac7ad56493f24684f294a5d051d7f933884b9132b1658fa716b4578d708b2c7b697d786ea62075d52ec5a9c1e3996eb860eb31a0e0d0b87920
7
+ data.tar.gz: f539564e1adfba20decc64e7f31894ca2ff6634623f1b460d1ed35484ff511d99221a0f127fe56504149cf7e72ee75be6d60eae5266ea684b0f4be00c9fda73a
@@ -1,3 +1,4 @@
1
- tC_���E/���xTv�q�F⾮�)���Ѩmt\a��1X���o�vY��U��E���w���
2
- g��298ʽ��Y����' (g�j�X1�� J���>�߻W~0���ٵcG���
3
- Ğ�GT�r4r[�m��,���|;���`[xe�+6�|���ֱ�i�㿀���g�^@�߶�&�cE|��:RP�g��RR�uɧ��#�7U��NP8 $�,+�� Z:���������߳^��|-�[}�U
1
+ \��GQ��1YugJoAr���Z�җXv����h7�-��q���Jr~��
2
+ {�'}��dM3Y����Iau��Џ�[� % N�=�z�d� Qb��b9�e�g��SѶ��/�����R���Ts7�M��x�=�q9���:�\'���̧�%��
3
+ ?��5���BHsb�<B��_�t0|^����_S��ox���X�ù�����=ĭ���� p�L
4
+ ���~�
data.tar.gz.sig CHANGED
Binary file
@@ -27,11 +27,9 @@ class AsteriskMiniStatement
27
27
  enddate: (Date.today - 1).strftime("%d-%b-%Y"),
28
28
  telno: 'unknown', outgoing_regex: /SIP\/(\d+)@/)
29
29
 
30
- sdate = Date.parse startdate
31
- edate = Date.parse enddate
30
+ sdate, edate = [startdate, enddate].map {|x| Date.parse x}
31
+ s = File.read cdr_file
32
32
 
33
- s = File.read cdr_file
34
-
35
33
  headings = %i(accountcode src dst dcontet clid channel dstchannel
36
34
  lastapp lastdata start answer end duration billsec disposition
37
35
  amaflags astid)
@@ -85,7 +83,7 @@ class AsteriskMiniStatement
85
83
 
86
84
  title = 'Telephone mini-statement'
87
85
 
88
- summary = "
86
+ s = "
89
87
  #{title}
90
88
  #{'=' * title.length}
91
89
 
@@ -95,24 +93,25 @@ Period: #{px.summary.period}
95
93
  Breakdown:
96
94
 
97
95
  Date/time Telephone duration
98
- ========= =========== ========"
96
+ ========= =========== ========
97
+ "
99
98
 
100
- records = px.records.inject('') do |r, day|
99
+ px.records.inject(s) do |r, day|
101
100
 
102
101
  date = Date.parse(day.date)
103
102
  r << "\n" + date.strftime("%A #{date.day.ordinalize} %B %Y") + "\n\n"
104
103
 
105
104
  day.records.inject(r) do |r2, x|
106
105
 
107
- r2 << (x.io == 'in' ? '>' : '<')
108
- r2 << Time.parse(x.time).strftime(" %l:%M%P: ")
109
- r2 << x.telno.ljust(13) + x.dur.rjust(8) + "\n"
106
+ r2 << (x.io == 'in' ? '>' : '<') + \
107
+ Time.parse(x.time).strftime(" %l:%M%P: ") + \
108
+ x.telno.ljust(13) + x.dur.rjust(8) + "\n"
110
109
  end
111
110
 
112
111
  r << "\n" + '-' * 32 + "\n"
113
112
  end
114
113
 
115
- @to_s = [summary,records].join("\n")
114
+ @to_s = s
116
115
 
117
116
  end
118
117
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asterisk_mini_statement
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- �w�X�+�2a ܐ�KkJ-߀G�3)%���\�UV��-9��_8�����|�p@��+W��5�L^+ݘ�6�߱��@6+;@���#Ƅ���� .V��'C������
2
- r�t:�=�!O��`�?yY���G�����K�/~?s)�&��7��<@=������_�EŅ�Ms��d��69w�T&{vܴR3Frʌf�w؛��ڣ��c��#�5d<���"�2:�C/40Q��4M�j� o�
1
+ 3!{
2
+ F��V��1���VɟD�\(��FG;t7�,)XI�, >l�,�H���G�,QL��B���Óږ���+z���C2Qw��+��9 ݌NCõfmo��I��qCu)����x-��KgJ����g�^[NM�ל0��@|p�7��j�*5O3'��1`