kanban_txt 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9360c54f29f7eaa21b1b0f1c8459eab0511c2c0c
4
- data.tar.gz: 6e2c9fca8f36aa362e7902f4a4604d0afb09cc26
3
+ metadata.gz: 67e88fa7e5e00f8738767e7ec2187d88149b6ff3
4
+ data.tar.gz: 8a8f3342c380d4e29569896e21417891b16a8241
5
5
  SHA512:
6
- metadata.gz: e97ffb2185e292f4f6aae90e084a77d2aed9775eeb055b90d3d2ce9cb29449eccce933f53e23f0d4c17bb9e8ba6cff86de2ee7fb0241d5938a0b92606385a46d
7
- data.tar.gz: 73cbfcdf850c08c2ac62e21eaaf34ef59c27f89384bb7b80ac93954d359191342c3ec9bbdec05feb9ba59167f49bed739b127c7b08c434ff4d977fd65a8824ea
6
+ metadata.gz: fdb6f698102332eb1087415d6bb36b30a1b27ede3f71f81c8e5fd93555295703579007ebb719977ef7a76b789d0c2ba26f4b06c676b793bc195668598adc9d3c
7
+ data.tar.gz: 37bc972c79c754abe912e4f3027aed2ce46a95eb95c6f5c1492f0bffc321b13929a2d0597b60ad8abd01ba2edf66ee0e07d6c59ecb7eebed625b075c59eb0968
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ^���k��� �����Tt��z�\��L��A��+�
2
- ٓa�{<�&�8�n�Ԯ��"s0�J�&����o�>�ԍ���*��d6s���������P�Q!�����q�Z:#0����d|Z{�e�}���K3j4��׾ *}��s
1
+ ='~�ep��5dn徔Y�<:��b]+󔼒чF%����?�V4 �@3#��� z{C־.Z�� '_��^��9�n'ஆI��#e8�dZI|�t]=f�����z�B����K]���c�2x�5���B(���\�N��1G��?z NU�X>��R��S�?T�eEOm�=�~��`+N�ʤ�Q���Q�g���/�K�#�I��ÔW J6�i��%>n-햔υ{ s���fԇȽ:�|U���7�&SD�I *
data/lib/kanban_txt.rb CHANGED
@@ -13,13 +13,7 @@ class KanbanTxt
13
13
  def initialize(filename='kanban.txt', title: nil,
14
14
  headings: ['Backlog', 'Todo', 'In progress', 'Done'], path: '.')
15
15
 
16
- if title.nil? then
17
- raise 'KanbanTxt: title: must be provided e.g. ' + \
18
- 'KanbanTxt.new title: "project1"'
19
- end
20
-
21
16
  @filename, @path, @title, @headings = filename, path, title, headings
22
- @keys = @headings.map{|x| x.downcase.gsub(/[\s\-_]/,'').to_sym}
23
17
 
24
18
  fpath = File.join(path, filename)
25
19
 
@@ -28,6 +22,14 @@ class KanbanTxt
28
22
  @rx = import_to_rx(File.read(fpath))
29
23
 
30
24
  else
25
+
26
+ if title.nil? then
27
+ raise 'KanbanTxt: title: must be provided e.g. ' + \
28
+ 'KanbanTxt.new title: "project1"'
29
+ end
30
+
31
+ @keys = @headings.map{|x| x.downcase.gsub(/[\s\-_]/,'').to_sym}
32
+
31
33
  @rx = new_rx
32
34
  end
33
35
 
@@ -51,7 +53,7 @@ class KanbanTxt
51
53
 
52
54
  def archive()
53
55
 
54
- # archive the daily planner
56
+ # archive the kanban at most once a day
55
57
  # e.g. kanban/gtk2html/2015/k121215.xml
56
58
 
57
59
  archive_path = File.join(@path, @title, @d.year.to_s)
@@ -63,17 +65,13 @@ class KanbanTxt
63
65
  end
64
66
 
65
67
  def import_to_rx(s)
66
-
67
- raw_rows = s.split(/.*(?=^[\w, ]+\n\-+)/)
68
68
 
69
- raw_rows.shift
70
- rows = raw_rows.map do |x|
71
- a = x.lines
72
- a.shift 2
73
- a.join.strip
74
- end
75
-
76
- new_rx(@keys.zip(rows))
69
+ rows = s.split(/.*(?=^[\w, ]+\n\-+)/)
70
+ @title = rows.shift[/^(.*)\s+Kanban$/,1]
71
+
72
+ @headings = rows.map {|x| x.lines.first.chomp}
73
+ @keys = @headings.map{|x| x.downcase.gsub(/[\s\-_]/,'').to_sym}
74
+ new_rx(@keys.zip(rows[0..-1].map { |x| x.lines[2..-1].join.strip }))
77
75
 
78
76
  end
79
77
 
@@ -81,23 +79,22 @@ class KanbanTxt
81
79
 
82
80
  len = @headings.length
83
81
  values = @rx.to_h.values[1..-1]
84
- a = @headings.zip(values)
85
82
 
86
- a2 = a.map do |title, value|
83
+ a = @headings.zip(values).map do |title, value|
87
84
  row = []
88
- row << title + "\n" << '-' * title.length + ("\n\n" + value).rstrip + "\n"
85
+ row << title + "\n" << '-' * title.length + \
86
+ ("\n\n" + value).rstrip + "\n"
89
87
  row.join
90
88
  end
91
89
 
92
- "%s\n%s\n\n%s\n" % [@rx.title, '=' * rx.title.length, a2.join("\n")]
90
+ "%s\n%s\n\n%s\n" % [@rx.title, '=' * rx.title.length, a.join("\n")]
93
91
 
94
92
  end
95
93
 
96
- def new_rx(h=@keys.zip([''] * @headings.length))
97
-
98
- title = @title + ' Kanban'
99
- RecordX.new({title: title }.merge(Hash[h]))
94
+ def new_rx(h=@keys.zip([''] * @keys.length))
95
+
96
+ RecordX.new({title: @title + ' Kanban' }.merge(Hash[h]))
100
97
 
101
98
  end
102
99
 
103
- end
100
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanban_txt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,28 +31,28 @@ cert_chain:
31
31
  ZGMasogHFPcxiu8iC/NpWGYcSslPTXWu/XlGGG+6/93zA4r0ZM2VgT6NpvgVsP5E
32
32
  RHbksmtUR7KDmw==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-12-12 00:00:00.000000000 Z
34
+ date: 2015-12-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
- name: recordx
37
+ name: dynarex
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.2'
42
+ version: '1.6'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.2.4
45
+ version: 1.6.1
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '0.2'
52
+ version: '1.6'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.2.4
55
+ version: 1.6.1
56
56
  description:
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
metadata.gz.sig CHANGED
Binary file