Skip to content

Commit

Permalink
Remoção do clipboard #169
Browse files Browse the repository at this point in the history
  • Loading branch information
edusantana committed Jun 16, 2020
1 parent e66ee43 commit 7e9f45a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion bin/instalador.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ if [ "$codename" = "bionic" ]; then
ruby-ffi \
libffi-dev \
unzip \
xclip \
wget \
perl \
luajit \
Expand Down
5 changes: 0 additions & 5 deletions lib/limarka/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def importa(arquivo)
end

method_option :interativo, :aliases => '-i', :desc => 'Solicita os parâmetros de forma interativa.', :type => :boolean, :default => false
method_option :clipboard, :aliases => '-c', :desc => 'Utiliza o conteúdo da área de transferência como o nome do arquivo.', :type => :boolean, :default => false

# method_option :arquivo, :aliases => '-a', :desc => 'Caminho completo ou apenas o nome do arquivo na pasta imagens. Somente arquivos existêntes são válidos. Se não for especificado e o nome do arquivo esteja copiado (na área de transferência), e o arquivo existir, ele será utilizado.'
method_option :legenda, :aliases => '-l', :desc => 'Legenda da figura.', :default => "Legenda da figura."
Expand All @@ -88,10 +87,6 @@ def importa(arquivo)
desc "fig ARQUIVO", "Imprime códigos para inclusão de imagens em conformidade com ABNT (em LaTeX)"
def fig(arquivo=nil)

if (options[:clipboard]) then
arquivo = Clipboard.paste # Ler do clipboard, requer xclip: sudo apt-get install xclip
end

if (arquivo) then
if arquivo.start_with?("file://") then
arquivo = arquivo[7,-1]
Expand Down
6 changes: 1 addition & 5 deletions lib/limarka/ref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ module Limarka
class Ref < Thor
include Thor::Actions

method_option :clipboard, :aliases => '-c', :desc => 'Incluir referência bibtex do clipboard (área de transferência)', :default => false, :type => :boolean
method_option :bibfile, :aliases => '-f', :desc => 'Arquivo de referências bibtex onde será incluído a referência', :default => "referencias.bib", :type => :string
desc "add", "Adiciona referência ao arquivo de bibliografia."
long_desc <<-DESC
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`).
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.
DESC
def add
if (options[:clipboard]) then
referencia = $stdin.read
end
begin
entry = BibTeX.parse(referencia)
error = entry.length.zero?
Expand Down
1 change: 0 additions & 1 deletion limarka.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "cucumber"
spec.add_development_dependency "aruba"

#spec.add_dependency "clipboard"
spec.add_dependency "ffi"
spec.add_dependency "colorize"
#spec.add_dependency "pdf-forms", "~> 1.2"
Expand Down

0 comments on commit 7e9f45a

Please sign in to comment.