postino 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -8
- data/lib/postino/form.rb +1 -9
- data/lib/postino/form/address.rb +0 -11
- data/lib/postino/version.rb +1 -1
- data/postino.gemspec +3 -4
- data/spec/postino/address_spec.rb +0 -8
- data/spec/postino/form_spec.rb +0 -8
- data/spec/postino/generator_spec.rb +2 -2
- metadata +6 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8b826024c2e815a1e39395bbb65c1f056ce67ee
|
4
|
+
data.tar.gz: d0a1308c3adb4be5b8027bac4f34f64f57c7270a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba606ff236f0efeb20309e468c12d3e7a47ce0107eced1d698d94af0f90cd2039662a5d94048d634e7aa6125884428c8c638f7829a0ddd8970d86ab93d8f117e
|
7
|
+
data.tar.gz: b99fe873eb863c209d91fe5850a68f5e93d41f12cd2259cd4852f5985ed82327cedf0fbd1bae6b32be9582333f681b618eda9075c79d5bdeac4ac369389b6c04
|
data/README.md
CHANGED
@@ -1,26 +1,32 @@
|
|
1
|
-
# Postino [![Gem Version](https://badge.fury.io/rb/postino.png)](http://badge.fury.io/rb/postino) [![Build Status](https://travis-ci.org/
|
1
|
+
# Postino [![Gem Version](https://badge.fury.io/rb/postino.png)](http://badge.fury.io/rb/postino) [![Build Status](https://travis-ci.org/interconn-wisp/postino.png?branch=master)](https://travis-ci.org/interconn-wisp/postino) [![Dependency Status](https://gemnasium.com/interconn-wisp/postino.png)](https://gemnasium.com/interconn-wisp/postino) [![Code Climate](https://codeclimate.com/github/interconn-wisp/postino.png)](https://codeclimate.com/github/interconn-wisp/postino)
|
2
2
|
|
3
|
-
[Postino](https://github.com/
|
3
|
+
[Postino](https://github.com/interconn-wisp/postino) is a Ruby gem that allows to quickly generate Italian postal
|
4
4
|
payment forms in PDF format using [Prawn](https://github.com/prawnpdf/prawn).
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
|
-
|
10
|
+
```ruby
|
11
|
+
gem 'postino'
|
12
|
+
```
|
11
13
|
|
12
14
|
And then execute:
|
13
15
|
|
14
|
-
|
16
|
+
```console
|
17
|
+
$ bundle
|
18
|
+
```
|
15
19
|
|
16
20
|
Or install it yourself as:
|
17
21
|
|
18
|
-
|
22
|
+
```console
|
23
|
+
$ gem install postino
|
24
|
+
```
|
19
25
|
|
20
26
|
## Usage
|
21
27
|
|
22
28
|
```ruby
|
23
|
-
Postino::Form.new do |f|
|
29
|
+
Postino::Form.new.tap do |f|
|
24
30
|
f.account_number = '0123456789'
|
25
31
|
f.numeric_amount = 11111
|
26
32
|
f.text_amount = 'UNDICIMILACENTOUNDICI/00'
|
@@ -28,7 +34,7 @@ Postino::Form.new do |f|
|
|
28
34
|
f.reason = 'LOREM IPSUM DOLOR SIT AMET, ADIPISCING CONSECTETUR ELIT'
|
29
35
|
f.payer_name = 'MARIO ROSSI'
|
30
36
|
|
31
|
-
f.address.
|
37
|
+
f.address.tap do |a|
|
32
38
|
a.street = 'VIA FASULLA, 123'
|
33
39
|
a.zip_code = '00100'
|
34
40
|
a.city = 'ROMA'
|
@@ -39,7 +45,7 @@ end.generate('my_form.pdf')
|
|
39
45
|
|
40
46
|
## Contributing
|
41
47
|
|
42
|
-
1. [Fork it](http://github.com/
|
48
|
+
1. [Fork it](http://github.com/interconn-wisp/postino/fork)
|
43
49
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
44
50
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
45
51
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/postino/form.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'docile'
|
2
|
-
|
3
1
|
module Postino
|
4
2
|
class Form
|
5
3
|
attr_accessor :account_number, :text_amount, :numeric_amount, :payee_name,
|
@@ -7,14 +5,8 @@ module Postino
|
|
7
5
|
|
8
6
|
attr_reader :address
|
9
7
|
|
10
|
-
def initialize
|
8
|
+
def initialize
|
11
9
|
@address = Address.new
|
12
|
-
configure(&block) if block_given?
|
13
|
-
end
|
14
|
-
|
15
|
-
def configure(&block)
|
16
|
-
Docile.dsl_eval(self, self, &block)
|
17
|
-
self
|
18
10
|
end
|
19
11
|
|
20
12
|
def generate(path)
|
data/lib/postino/form/address.rb
CHANGED
@@ -1,19 +1,8 @@
|
|
1
|
-
require 'docile'
|
2
|
-
|
3
1
|
module Postino
|
4
2
|
class Form
|
5
3
|
class Address
|
6
4
|
attr_accessor :street, :zip_code, :city, :state
|
7
5
|
|
8
|
-
def initialize(&block)
|
9
|
-
configure(&block) if block_given?
|
10
|
-
end
|
11
|
-
|
12
|
-
def configure(&block)
|
13
|
-
Docile.dsl_eval(self, self, &block)
|
14
|
-
self
|
15
|
-
end
|
16
|
-
|
17
6
|
def location
|
18
7
|
"#{city} (#{state})"
|
19
8
|
end
|
data/lib/postino/version.rb
CHANGED
data/postino.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Postino::VERSION
|
9
9
|
spec.authors = ["Alessandro Desantis"]
|
10
10
|
spec.email = ["desa.alessandro@gmail.com"]
|
11
|
-
spec.summary = %q{A
|
12
|
-
spec.description = %q{
|
13
|
-
spec.homepage = "https://github.com/
|
11
|
+
spec.summary = %q{A Ruby library to generate Italian postal payment forms.}
|
12
|
+
spec.description = %q{Postinoallows you to generate Italian postal payment forms in PDF format using Prawn.}
|
13
|
+
spec.homepage = "https://github.com/interconn-wisp/postino"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "prawn", '~> 0.14'
|
22
|
-
spec.add_runtime_dependency "docile", '~> 1.1'
|
23
22
|
|
24
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
25
24
|
spec.add_development_dependency "rake", '~> 10.1'
|
@@ -3,14 +3,6 @@ require 'spec_helper'
|
|
3
3
|
describe Postino::Form::Address do
|
4
4
|
subject { Postino::Form::Address.new }
|
5
5
|
|
6
|
-
describe '#configure' do
|
7
|
-
it 'takes a block for configuration' do
|
8
|
-
subject.configure do |a|
|
9
|
-
a.zip_code = '00100'
|
10
|
-
end.zip_code.should == '00100'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
6
|
describe '#location' do
|
15
7
|
before do
|
16
8
|
subject.city = 'Roma'
|
data/spec/postino/form_spec.rb
CHANGED
@@ -3,14 +3,6 @@ require 'spec_helper'
|
|
3
3
|
describe Postino::Form do
|
4
4
|
subject { Postino::Form.new }
|
5
5
|
|
6
|
-
describe '#configure' do
|
7
|
-
it 'takes a block for configuration' do
|
8
|
-
subject.configure do |f|
|
9
|
-
f.account_number = 'test'
|
10
|
-
end.account_number.should == 'test'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
6
|
describe '#generate' do
|
15
7
|
it 'generates the PDF form' do
|
16
8
|
Postino::Generator.expects(:generate_form).once
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Postino::Generator do
|
4
4
|
describe '.generate_form' do
|
5
5
|
let(:form) do
|
6
|
-
Postino::Form.new do |f|
|
6
|
+
Postino::Form.new.tap do |f|
|
7
7
|
f.account_number = '1234567890'
|
8
8
|
f.numeric_amount = 11111
|
9
9
|
f.text_amount = 'UNDICIMILACENTOUNDICI/00'
|
@@ -11,7 +11,7 @@ describe Postino::Generator do
|
|
11
11
|
f.reason = 'LOREM IPSUM DOLOR SIT AMET, ADIPISCING CONSECTETUR ELIT.'
|
12
12
|
f.payer_name = 'MARIO ROSSI DI MONTEBIANCO'
|
13
13
|
|
14
|
-
f.address.
|
14
|
+
f.address.tap do |a|
|
15
15
|
a.street = 'VIA FASULLA, 123'
|
16
16
|
a.zip_code = '00100'
|
17
17
|
a.city = 'ROMA'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Desantis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prawn
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.14'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: docile
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.1'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,8 +94,8 @@ dependencies:
|
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '1.0'
|
111
|
-
description:
|
112
|
-
|
97
|
+
description: Postinoallows you to generate Italian postal payment forms in PDF format
|
98
|
+
using Prawn.
|
113
99
|
email:
|
114
100
|
- desa.alessandro@gmail.com
|
115
101
|
executables: []
|
@@ -134,7 +120,7 @@ files:
|
|
134
120
|
- spec/postino/form_spec.rb
|
135
121
|
- spec/postino/generator_spec.rb
|
136
122
|
- spec/spec_helper.rb
|
137
|
-
homepage: https://github.com/
|
123
|
+
homepage: https://github.com/interconn-wisp/postino
|
138
124
|
licenses:
|
139
125
|
- MIT
|
140
126
|
metadata: {}
|
@@ -157,7 +143,7 @@ rubyforge_project:
|
|
157
143
|
rubygems_version: 2.2.1
|
158
144
|
signing_key:
|
159
145
|
specification_version: 4
|
160
|
-
summary: A
|
146
|
+
summary: A Ruby library to generate Italian postal payment forms.
|
161
147
|
test_files:
|
162
148
|
- spec/postino/address_spec.rb
|
163
149
|
- spec/postino/form_spec.rb
|