podpisy 0.1.2 → 0.1.3

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: c184812cff66a2ca7bb7a6555eccb36f32299d77
4
- data.tar.gz: 3458f0b85162539be525001634b70dc166f18a7f
3
+ metadata.gz: 3dde9eec35971b410ce66251b951328f80084357
4
+ data.tar.gz: 7638ed7a4fcc661019d7d074e9c121dde37a5846
5
5
  SHA512:
6
- metadata.gz: 5d04156facc7a595ff09597666fb5185b0161312e80becc446765c426fe752998251b29b5970644e8f4a7bb67c715770a7ffcc5073480a111e8b415126d5bfc2
7
- data.tar.gz: e86a94885ea4b07da065d7234db982a0d3578ad2ef59834b79e6a73067ea2591cb4877b4145e6c8096c886314fa9ec7de22ad18fcfef0cd8c506c202b6b45827
6
+ metadata.gz: 597074e230b52118f10a03ba61fc414fdf22232afc54598cf2824e8ef7324ee37627d2ddc2155523394759b8f274aabe9b3777489ae3edd956c991ae78f0ae6b
7
+ data.tar.gz: 64e1f9df2a72923111150e1452a17ba8c24100698577ec5c76183eba84d71023316bff5617c4096ee68f9e6afe1b471fcd5d9cd5e90e35e954c31b9a64549e0a
data/README.md CHANGED
@@ -1,43 +1,30 @@
1
- # Podpisy
1
+ # Podpisy
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/podpisy`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Narzędzie CLI które przekształca podpisy pod apelem w formacie CSV do formatu TeX (potrzebnego do generowania PDF z podpisami), lub do nowego CSV.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'podpisy'
5
+ ## Instalacja
6
+ ```
7
+ gem install podpisy
13
8
  ```
14
9
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install podpisy
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
10
+ ## Format wejściowy
30
11
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
12
+ Plik CSV powinien mieć następujące kolumny:
13
+ - `first_name`, `last_name` – imię i nazwisko
14
+ - lub `name` – imię i nazwsiko połączone
15
+ - `postcode` – kod pocztowy (na podstawie którego może zostać wyszukany obszar)
32
16
 
33
- ## Contributing
17
+ ## Format wyjściowy
34
18
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/podpisy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
19
+ ### TeX
36
20
 
37
- ## License
21
+ Aby wygenerować podpisyw w tex:
22
+ ```sh
23
+ $ podpisy -at podpisy.tex podpisy.csv
24
+ ```
38
25
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
26
+ Podanie opcji `-a` zastąpi kody pocztowe nazwami miejscowości (zwykle tego używamy)
40
27
 
41
- ## Code of Conduct
28
+ ### CSV
42
29
 
43
- Everyone interacting in the Podpisy project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/podpisy/blob/master/CODE_OF_CONDUCT.md).
30
+ Można wygenerować także plik CSV. Jedyny use case w tej chwili to opcja `-a`, która zamieni wartości w kolumnie `postcode` na nazwę miejscowości.
@@ -1,3 +1,3 @@
1
1
  module Podpisy
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ sudo apt-get install texlive texlive-lang-polish texlive-latex-extra texlive-xetex \
4
+ texlive-latex-recommended texlive-plain-extra lmodern texlive-fonts-recommended \
5
+ texmaker
@@ -0,0 +1,55 @@
1
+ \NeedsTeXFormat{LaTeX2e}[1997/06/01]
2
+ \ProvidesClass{podpisy}[2016/03/15 v0.01 Akcja Demokracj podpisy]
3
+
4
+ \newcommand{\cmnt}[1]{}
5
+ \newcommand{\first}[1]{#1}
6
+ \newcommand{\last}[1]{#1}
7
+ \newcommand{\city}[1]{#1}
8
+
9
+ \DeclareOption{comments}{%
10
+ \renewcommand{\cmnt}[1]{&\multicolumn{2}{p{12cm}}{\it\small #1 } \\}%
11
+ }
12
+
13
+ \DeclareOption{namesonly}{%
14
+ \renewcommand{\last}[1]{}%
15
+ }
16
+
17
+ \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
18
+ \ProcessOptions\relax
19
+
20
+ \LoadClass{article}
21
+ \RequirePackage{fontspec}
22
+ \RequirePackage{longtable}
23
+ \RequirePackage{graphicx}
24
+ \RequirePackage{ifthen}
25
+
26
+ \date{}
27
+ \setmainfont{Times New Roman}
28
+ \parskip=0.5em
29
+ \parindent=0cm
30
+ \setlength{\emergencystretch}{3em}
31
+
32
+ \newcommand{\apel}{%
33
+ \clearpage%
34
+ \thispagestyle{empty}%
35
+ }
36
+
37
+ \newcommand{\logoakcja}{\begin{center}
38
+ \includegraphics[width=3cm]{LOGO_POZIOM_BW}
39
+ \end{center}}
40
+
41
+ \newcommand{\logoakcjaoraz}[1]{\begin{center}
42
+ \begin{tabular}{ll}
43
+ \includegraphics[width=3cm]{LOGO_POZIOM_BW}
44
+ \includegraphics[width=3cm]{#1}
45
+ \end{tabular}
46
+ \end{center}}
47
+
48
+
49
+ \newcommand{\podpisy}[1]{%
50
+ \addtocounter{page}{-1}%
51
+ \newpage%
52
+ \begin{longtable}{rp{6cm}p{6cm}}%
53
+ \input{#1}%
54
+ \end{longtable}%
55
+ }
@@ -0,0 +1,43 @@
1
+ \documentclass[11pt,comments]{podpisy}
2
+
3
+ \title{Apel Akcji Demokracja (tytuł pliku PDF)}
4
+
5
+ \begin{document}
6
+ \apel
7
+
8
+
9
+ \begin{center}
10
+ \LARGE Apel do
11
+
12
+ \LARGE Kogo...
13
+ \end{center}
14
+
15
+ Treść apelu
16
+
17
+ \begin{flushright}
18
+ X Obywatelek i Obywateli
19
+ \end{flushright}
20
+
21
+ \vskip3cm
22
+
23
+
24
+ Podpisy zebrano na stronie
25
+ \texttt{https://akcjademokracja.pl/uchodzcy\_podlasie}
26
+
27
+ Akcja Demokracja buduje ruch ludzi zaangażowanych w
28
+ ważne dla nich sprawy. Wykorzystując nowe technologie, dajemy
29
+ możliwość działania na rzecz lepszego, bardziej sprawiedliwego
30
+ polskiego społeczeństwa. \\
31
+ Więcej informacji na stronie
32
+ \texttt{www.akcjademokracja.pl}
33
+
34
+ %Osoba kontaktowa: Weronika Paszewska (696 478 802)
35
+ Osoba kontaktowa: Bogumił Kolmasiak, tel. +48~888~193~767
36
+
37
+
38
+ \vskip2cm
39
+ \logoakcjaoraz{kodlogo.png}
40
+
41
+ \podpisy{petition.tex}
42
+
43
+ \end{document}
@@ -0,0 +1,43 @@
1
+ \documentclass[11pt]{podpisy}
2
+
3
+ \title{Apel Akcji Demokracja (tytuł pliku PDF)}
4
+
5
+ \begin{document}
6
+ \apel
7
+
8
+
9
+ \begin{center}
10
+ \LARGE Apel do
11
+
12
+ \LARGE Kogo...
13
+ \end{center}
14
+
15
+ Treść apelu
16
+
17
+ \begin{flushright}
18
+ X Obywatelek i Obywateli
19
+ \end{flushright}
20
+
21
+ \vskip3cm
22
+
23
+
24
+ Podpisy zebrano na stronie
25
+ \texttt{https://akcjademokracja.pl/uchodzcy\_podlasie}
26
+
27
+ Akcja Demokracja buduje ruch ludzi zaangażowanych w
28
+ ważne dla nich sprawy. Wykorzystując nowe technologie, dajemy
29
+ możliwość działania na rzecz lepszego, bardziej sprawiedliwego
30
+ polskiego społeczeństwa. \\
31
+ Więcej informacji na stronie
32
+ \texttt{www.akcjademokracja.pl}
33
+
34
+ %Osoba kontaktowa: Weronika Paszewska (696 478 802)
35
+ Osoba kontaktowa: Bogumił Kolmasiak, tel. +48~888~193~767
36
+
37
+
38
+ \vskip2cm
39
+ \logoakcjaoraz{kodlogo.png}
40
+
41
+ \podpisy{petition.tex}
42
+
43
+ \end{document}
@@ -0,0 +1,49 @@
1
+ #!/bin/ruby
2
+
3
+ # from:
4
+ # name,email,postcode,area,Comments about the air quality of Warsaw,
5
+ # to:
6
+ # 1. & \first{Name} \last{Surname} & \city{City} \\
7
+ # \cmnt{Ugh!}
8
+
9
+ require 'csv'
10
+
11
+ def remove_special_chars(s)
12
+ return '' if s.nil?
13
+ s = s.gsub(/[${}^\\]/, '')
14
+ s = s.gsub(/[~_]/, '-')
15
+ s = s.gsub(/&/, ' i ')
16
+ s = s.gsub(/#/, '\\#')
17
+ s = s.gsub(/%/, '\\%')
18
+ s
19
+ end
20
+
21
+ if ARGV.empty? or ARGV.count < 2
22
+ puts "Usage: <filename> <comment field name>"
23
+ puts 'Example: survey.csv "Comments about the air quality of Warsaw"'
24
+ exit!
25
+ end
26
+
27
+ filename = ARGV.shift
28
+ f = CSV.open(filename, headers: true)
29
+
30
+ cmnt_field = ARGV.shift
31
+ #p cmnt_field
32
+
33
+ out = []
34
+
35
+ f.each_with_index do |l, i|
36
+ fname, lname = l["name"].split(" ").map(&:capitalize)
37
+ out << "#{i + 1}. & \\first{#{remove_special_chars(fname)}} \\last{#{remove_special_chars(lname)}} & \\city{#{l["area"] ? l["area"] : ""}} \\\\"
38
+
39
+ if l[cmnt_field]
40
+ cmnt = l[cmnt_field].strip
41
+ out << "\\cmnt{#{remove_special_chars(cmnt)}}"
42
+ end
43
+ end
44
+
45
+ filename2 = File.basename(filename, '.csv') + '.tex'
46
+ File.open(filename2, "w") do |outf|
47
+ outf.puts(out)
48
+ end
49
+ puts "Wrote to #{filename2}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podpisy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Koziej
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2019-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -102,6 +102,13 @@ files:
102
102
  - lib/podpisy/signatures.rb
103
103
  - lib/podpisy/version.rb
104
104
  - podpisy.gemspec
105
+ - share/szablon/LOGO_POZIOM_BW.png
106
+ - share/szablon/LOGO_POZIOM_CMYK.eps
107
+ - share/szablon/instaluj_pakiety.sh
108
+ - share/szablon/podpisy.cls
109
+ - share/szablon/podpisy.tex
110
+ - share/szablon/podpisy_no_comment.tex
111
+ - share/szablon/survey_to_tex.rb
105
112
  homepage: https://gitlab.com/akcjademokracja/podpisy
106
113
  licenses:
107
114
  - MIT