limarka 0.4.0 → 0.4.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: fa1896b0e71ab909e97ba9c80795702b4adb45af
4
- data.tar.gz: 4977d97a73b3fd227dae4049bdad1be25ba5010f
3
+ metadata.gz: 50337c57ae98f567962fe560e67128309d31ed57
4
+ data.tar.gz: f96312b6a8e4b72e80c74cfcb8898c215fd8b915
5
5
  SHA512:
6
- metadata.gz: f6928663dd2c372bd139691c3d703f443dac9adc44c9f47bd235786d3d3b5ee6122d6b6212ef3984b11cfa20309322e901b00c75f2c3673c27a7e1da3e4c2298
7
- data.tar.gz: d81246bb185e683269733b24e29ec4c4907ba317eb774aab39e5a29f0b7a2a894a89fb372d0f2438cabe74f442c76163b6fd46b4b483ba55e30bddc2a1f923eb
6
+ metadata.gz: e7bcd8b703d707fa42f19231b0fdc00370aa90b0913e69433d5f1cae19f3e466ae5382b4c8f0342cee5fb540d9b2c90120229bd326c4b8abecae33051eb846df
7
+ data.tar.gz: 71baa12736b1979aa102efc0c7e37bc0ac5c1c9fc9381153fab126b2ebc06cbbcba1281cc81ef11171a95654d20776e67c964984043d32755fc6d1bc4f442e16
@@ -1,5 +1,5 @@
1
1
  user=abntex
2
- project=trabalho-academico-pandoc-abntex2
2
+ project=limarka
3
3
  bugs-label=**Bugs corrigidos:**
4
4
  enhancement-label=**Melhorias implementadas:**
5
5
  issues-label=**Issues fechados:**
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
1
  # Change Log
2
2
 
3
- ## [0.4.0](https://github.com/abntex/limarka/tree/0.4.0) (2016-11-16)
4
- [Full Changelog](https://github.com/abntex/limarka/compare/v0.3.0...0.4.0)
3
+ ## [0.4.1](https://github.com/abntex/limarka/tree/0.4.1) (2016-11-17)
4
+ [Full Changelog](https://github.com/abntex/limarka/compare/v0.4.0...0.4.1)
5
+
6
+ **Closed issues:**
7
+
8
+ - Possibilitar incluir referência bibtex da área de transferência [\#69](https://github.com/abntex/limarka/issues/69)
9
+
10
+ ## [v0.4.0](https://github.com/abntex/limarka/tree/v0.4.0) (2016-11-16)
11
+ [Full Changelog](https://github.com/abntex/limarka/compare/v0.3.0...v0.4.0)
5
12
 
6
13
  **Implemented enhancements:**
7
14
 
data/lib/limarka/cli.rb CHANGED
@@ -6,6 +6,7 @@ require 'colorize'
6
6
  require 'open3'
7
7
 
8
8
  require 'limarka/configuracao'
9
+ require 'limarka/ref'
9
10
  require 'limarka/conversor'
10
11
  require 'clipboard'
11
12
 
@@ -273,6 +274,9 @@ TEX
273
274
  desc "configuracao help", "Exporta e atualiza configurações"
274
275
  subcommand "configuracao", Limarka::Configuracao
275
276
 
277
+ desc "ref", "Adiciona ou referencia bibliografia"
278
+ subcommand "ref", Limarka::Ref
279
+
276
280
  end
277
281
  end
278
282
 
@@ -0,0 +1,47 @@
1
+ # coding: utf-8
2
+ require "thor"
3
+ require 'open3'
4
+ require 'bibtex'
5
+ require 'clipboard'
6
+
7
+ module Limarka
8
+
9
+ class Ref < Thor
10
+
11
+ method_option :clipboard, :aliases => '-c', :desc => 'Incluir referência bibtex do clipboard (área de transferência)', :default => false, :type => :boolean
12
+ method_option :bibfile, :aliases => '-f', :desc => 'Arquivo de referências bibtex onde será incluído a referência', :default => "referencias.bib", :type => :string
13
+ desc "add", "Adiciona referência ao arquivo de bibliografia."
14
+ long_desc <<-DESC
15
+ Quando você estiver navegando poderá copiar a referência bibtex (do google acadêmico, Zotero, etc.) e incluir ao arquivo de gerência de bibliografia (geralmente referencias.bib) utilizando esse comando. A inclusão do texto ocorrerá da entrada padrão, a não ser que a leitura do clipboard seja acionada (opção `-c`).
16
+ DESC
17
+ def add
18
+ if (options[:clipboard]) then
19
+ referencia = Clipboard.paste
20
+ else
21
+ referencia = $stdin.read
22
+ end
23
+ entry = BibTeX.parse(referencia)
24
+ if (entry.length.zero?) then
25
+ puts "Entrada não apresenta uma referência válida: #{referencia}"
26
+ return
27
+ else
28
+ referencias = BibTeX.open(options[:bibfile], :include => [:meta_content])
29
+ referencias << entry.entries
30
+ if (referencias.duplicates?) then
31
+ puts "Referência duplicada. Nada foi feito."
32
+ else
33
+ referencias.save
34
+ end
35
+ puts <<MSG
36
+
37
+ #{entry[0]}
38
+
39
+ Para referenciar utilize: \\cite{#{entry[0].key}} ou \\citeonline{#{entry[0].key}}
40
+
41
+ MSG
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+
@@ -1,3 +1,3 @@
1
1
  module Limarka
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limarka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo de Santana Medeiros Alexandre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-16 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -218,6 +218,7 @@ files:
218
218
  - lib/limarka/configuracao.rb
219
219
  - lib/limarka/conversor.rb
220
220
  - lib/limarka/pdfconf.rb
221
+ - lib/limarka/ref.rb
221
222
  - lib/limarka/trabalho.rb
222
223
  - lib/limarka/version.rb
223
224
  - limarka.gemspec