iboleto 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.en.md +6 -0
- data/README.md +7 -0
- data/bin/iboleto +20 -6
- data/iboleto.gemspec +0 -1
- data/lib/iboleto/version.rb +1 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebc892d6883bc1690b198f273aa3a9acc9fc87e7
|
4
|
+
data.tar.gz: 70a0c47793e2c10a20ff37f43597d7ba8791fbb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4337abd3a521d716ec30f922146175bcf2d9c2b625562f64b307b99333859f171ec7f5faccbab397be35f076d049aedcc98e28f922731faf466f9038f495230
|
7
|
+
data.tar.gz: e92f5274555c555d43fa705b592b3bc7c384a5299855e185dd6f017ac88a1c6669bc610c2b6561191b58bb6e4b0b016daac3e6299faf5b1f2ee31013eebab05f
|
data/README.en.md
CHANGED
@@ -18,6 +18,12 @@ Add this line to your application's Gemfile:
|
|
18
18
|
|
19
19
|
$ iboleto
|
20
20
|
|
21
|
+
## GTK-2 copy/paste support
|
22
|
+
If you want iboleto to clipboard copy the read barcode, you just
|
23
|
+
need to install the __gtk2__ gem with the following command:
|
24
|
+
|
25
|
+
$ gem install gtk2
|
26
|
+
|
21
27
|
## Contributing
|
22
28
|
|
23
29
|
1. Fork it ( https://github.com/[my-github-username]/iboleto/fork )
|
data/README.md
CHANGED
@@ -16,6 +16,13 @@ Então você pode colar os números no seu **internet bank** para realizar o pag
|
|
16
16
|
|
17
17
|
$ iboleto
|
18
18
|
|
19
|
+
## Suporte à copiar/colar do GTK-2
|
20
|
+
Se você deseja que o iboleto automaticamente copie para
|
21
|
+
àrea de trabalho o código de barras lido, basta você instalar
|
22
|
+
a gem __gtk2__ com o comando abaixo
|
23
|
+
|
24
|
+
$ gem install gtk2
|
25
|
+
|
19
26
|
## Para contribuir
|
20
27
|
|
21
28
|
1. Fork ( https://github.com/abinoam/iboleto/fork )
|
data/bin/iboleto
CHANGED
@@ -3,7 +3,13 @@
|
|
3
3
|
|
4
4
|
# Last updated at October, 06, 2014.
|
5
5
|
|
6
|
-
|
6
|
+
# Require gtk2 if available
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'gtk2'
|
10
|
+
rescue LoadError
|
11
|
+
end
|
12
|
+
|
7
13
|
require 'socket'
|
8
14
|
|
9
15
|
class ClientQuitError < RuntimeError; end
|
@@ -33,21 +39,29 @@ loop do
|
|
33
39
|
begin
|
34
40
|
while line = s.gets # read a line at a time
|
35
41
|
if m = line.match(/POST \/iBoleto\?cod=(\d+)+&dec=(\d+)/)
|
36
|
-
clip = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD)
|
37
|
-
|
38
42
|
cod = m[1]
|
39
43
|
dec = m[2]
|
40
44
|
|
41
45
|
boleto_regexp = /\A(\w{5})(\w{5})(\w{5})(\w{6})(\w{5})(\w{6})(\w{1})(\w{14})\Z/
|
42
|
-
boleto = dec.dup.sub!(boleto_regexp, '\1 2 \3 \4 \5 \6 \7 \8')
|
46
|
+
boleto = dec.dup.sub!(boleto_regexp, '\1 \2 \3 \4 \5 \6 \7 \8')
|
43
47
|
boleto_with_tabs = dec.dup.sub!(boleto_regexp, "\\1\t\\2\t\\3\t\\4\t\\5\t\\6\t\\7\t\\8")
|
44
48
|
|
45
49
|
conv_regexp = /\A(\d{12})(\d{12})(\d{12})(\d{12})\Z/
|
46
50
|
conv = dec.dup.sub!(conv_regexp, '\1 \2 \3 \4')
|
47
51
|
conv_with_tabs = dec.dup.sub!(conv_regexp, "\\1\t\\2\t\\3\t\\4")
|
48
52
|
|
49
|
-
|
50
|
-
|
53
|
+
boleto_info = [cod, dec, boleto, boleto_with_tabs, conv, conv_with_tabs].compact.join("\n")
|
54
|
+
|
55
|
+
puts
|
56
|
+
puts "Boleto Information (in more than one format/spacing):"
|
57
|
+
puts boleto_info
|
58
|
+
puts
|
59
|
+
|
60
|
+
if defined? Gtk
|
61
|
+
clip = Gtk::Clipboard.get(Gdk::Selection::CLIPBOARD)
|
62
|
+
clip.set_text(boleto_info)
|
63
|
+
clip.store
|
64
|
+
end
|
51
65
|
end
|
52
66
|
|
53
67
|
if ["\n\r", "\n", "\r\n"].include? line
|
data/iboleto.gemspec
CHANGED
data/lib/iboleto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iboleto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abinoam Praxedes Marques Jr.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: gtk2
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
description: Linux compatible CLI Ruby server for QuadriMind IBoleto android app -
|
56
42
|
http://www.quadrimind.com/iBoleto/
|
57
43
|
email:
|
@@ -91,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
77
|
version: '0'
|
92
78
|
requirements: []
|
93
79
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.4.
|
80
|
+
rubygems_version: 2.4.6
|
95
81
|
signing_key:
|
96
82
|
specification_version: 4
|
97
83
|
summary: Linux compatible CLI Ruby server for IBoleto android app
|