podpisy 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: fe3671aff7f1a63003effc1f87b086855b8a9973
4
- data.tar.gz: 33cdbc7b038e5c30b5fbc49d6bce739946deb5a0
3
+ metadata.gz: c0b3a5068a10184bdbfcc51b076fd7697c880512
4
+ data.tar.gz: a7bd5ec1d4416e9d22b7e8face8dc3a5219ff2c8
5
5
  SHA512:
6
- metadata.gz: 40242cab06049fd905edc6c9ffd07c7feb352afcf67507f23a190fcfb6e9cf61ab503b30d7384024ed948bda454c11578a305c5c70ac8f0ab9ea213c97a12723
7
- data.tar.gz: ab8485445393c636c0d2438b3a1047a212216da8d285b9a047b0359d60e95c2481aacba97201bb37d4ed433b3bb2f4873b49b3a4557df69b177e80304b10ef56
6
+ metadata.gz: 0de8a284f34da77ab492d9c0aa181f06cb88e939f10e077c08bc86fc9b911c3c619cea7967a63558c45b82670beff9c05f12dbb9d7f71805b716d3b243a5f964
7
+ data.tar.gz: 5098fb38470ca0970eca6df3b8226f5721e131cdab0eb4ae8dab01f3a1b1814b1f868ff7fd4ea7460e39ecb6e26ae0e550032f8f81e3716baa14d688cbd94908
@@ -42,16 +42,22 @@ module Podpisy
42
42
  end
43
43
  end
44
44
 
45
+ def first_last_name(row)
46
+ fn = row['first_name'] || row['name'].split(' ')[0...-1].join(' ')
47
+ ln = row['last_name'] || row['name'].split(' ')[-1]
48
+ [fn, ln]
49
+ end
50
+
45
51
  def to_tex(o = STDOUT)
46
52
  i = 1
47
53
  CSV.foreach(@fn, headers: true, col_sep: ',') do |row|
48
54
  city= @kody.unambiguous(row['postcode'], :m, :p, :w)
49
- f = remove_special_chars(row['first_name'] || '').capitalize
50
- l = remove_special_chars(row['last_name'] || '').capitalize
55
+ fn, ln = first_last_name(row)
56
+ f = remove_special_chars(fn || '').capitalize
57
+ l = remove_special_chars(fn || '').capitalize
51
58
  o.puts "#{i}. & \\first{#{f}} \\last{#{l}} & \\city{#{city}} \\\\"
52
- i+=1
59
+ i+=1
53
60
  end
54
61
  end
55
62
  end
56
-
57
63
  end
@@ -1,3 +1,3 @@
1
1
  module Podpisy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podpisy
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
  - Marcin Koziej