nsi-abntformat 0.2.0 → 1.0.0
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.
- data/CONTRIBUTORS +1 -1
- data/Gemfile +0 -5
- data/Gemfile.lock +34 -0
- data/README.rdoc +32 -3
- data/Rakefile +1 -4
- data/VERSION +1 -1
- data/lib/referencia_bibliografica.rb +70 -136
- data/nsi-abntformat.gemspec +66 -0
- data/spec/referencia_bibliografica_spec.rb +156 -0
- data/{test → spec}/spec_helper.rb +1 -1
- metadata +52 -17
- data/test/referencia_bibliografica_spec.rb +0 -195
data/CONTRIBUTORS
CHANGED
data/Gemfile
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
2
|
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
3
|
group :development do
|
9
4
|
gem "rspec", ">= 0"
|
10
5
|
gem "bundler", "> 1.0.0"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.3)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.8.3)
|
7
|
+
bundler (~> 1.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rdoc
|
11
|
+
json (1.6.6)
|
12
|
+
rake (0.9.2.2)
|
13
|
+
rdoc (3.12)
|
14
|
+
json (~> 1.4)
|
15
|
+
rspec (2.9.0)
|
16
|
+
rspec-core (~> 2.9.0)
|
17
|
+
rspec-expectations (~> 2.9.0)
|
18
|
+
rspec-mocks (~> 2.9.0)
|
19
|
+
rspec-core (2.9.0)
|
20
|
+
rspec-expectations (2.9.0)
|
21
|
+
diff-lcs (~> 1.1.3)
|
22
|
+
rspec-mocks (2.9.0)
|
23
|
+
unicode (0.4.2)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (> 1.0.0)
|
30
|
+
diff-lcs (>= 1.1.3)
|
31
|
+
jeweler (~> 1.8.3)
|
32
|
+
rake
|
33
|
+
rspec
|
34
|
+
unicode
|
data/README.rdoc
CHANGED
@@ -1,11 +1,40 @@
|
|
1
1
|
= nsi-abntformat
|
2
2
|
|
3
|
-
|
3
|
+
== Como instalar:
|
4
4
|
|
5
|
-
|
5
|
+
gem install nsi-abntformat
|
6
6
|
|
7
|
+
- Mais informações: https://rubygems.org/gems/nsi-abntformat
|
8
|
+
|
9
|
+
== Como usar
|
10
|
+
|
11
|
+
No exemplo abaixo, é gerada uma referência bibliográfica para trabalho de conclusão:
|
12
|
+
|
13
|
+
require "referencia_bibliografica"
|
14
|
+
|
15
|
+
class Documento
|
16
|
+
include ReferenciaBibliografica
|
17
|
+
|
18
|
+
attr_accessor :tipo, :autores, :titulo, :subtitulo, :data_defesa,
|
19
|
+
:total_folhas, :tipo_trabalho, :instituicao, :local_defesa
|
20
|
+
end
|
21
|
+
|
22
|
+
documento = Documento.new
|
23
|
+
documento.tipo = 'trabalho de conclusão'
|
24
|
+
documento.autores = 'Linus Torvalds'
|
25
|
+
documento.titulo = 'Git'
|
26
|
+
documento.subtitulo = 'Destruindo o Passado de Trevas'
|
27
|
+
documento.data_defesa = 2008
|
28
|
+
documento.total_folhas = 120
|
29
|
+
documento.tipo_trabalho = 'Tese (Doutorado em Computacao)'
|
30
|
+
documento.instituicao = 'Instituto Federal Fluminense'
|
31
|
+
documento.local_defesa = 'Campos dos Goytacazes/RJ'
|
32
|
+
|
33
|
+
documento.referencia_abnt
|
34
|
+
|
35
|
+
=> 'TORVALDS, L. Git: Destruindo o Passado de Trevas. 2008. 120 f. Tese (Doutorado em Computacao) - Instituto Federal Fluminense, Campos dos Goytacazes/RJ.'
|
36
|
+
Copyright
|
7
37
|
== Copyright
|
8
38
|
|
9
39
|
Copyright (c) 2012 Núcleo de Pesquisa em Sistemas de Informação. See LICENSE.txt for
|
10
40
|
further details.
|
11
|
-
|
data/Rakefile
CHANGED
@@ -11,10 +11,8 @@ rescue Bundler::BundlerError => e
|
|
11
11
|
end
|
12
12
|
require 'rake'
|
13
13
|
|
14
|
-
|
15
14
|
require 'jeweler'
|
16
15
|
Jeweler::Tasks.new do |gem|
|
17
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
18
16
|
gem.name = "nsi-abntformat"
|
19
17
|
gem.homepage = "http://github.com/oswluiz/nsi-abntformat"
|
20
18
|
gem.license = "MIT"
|
@@ -22,14 +20,13 @@ Jeweler::Tasks.new do |gem|
|
|
22
20
|
gem.description = "Transforms objects containing documentation metadata in bibliographic references on ABNT format"
|
23
21
|
gem.email = "oswluizf@gmail.com"
|
24
22
|
gem.authors = ["Oswaldo Ferreira"]
|
25
|
-
# dependencies defined in Gemfile
|
26
23
|
end
|
27
24
|
Jeweler::RubygemsDotOrgTasks.new
|
28
25
|
|
29
26
|
require 'rspec/core'
|
30
27
|
require 'rspec/core/rake_task'
|
31
28
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
-
spec.pattern = FileList['
|
29
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
30
|
spec.rspec_opts = "--color --format nested"
|
34
31
|
end
|
35
32
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
@@ -1,152 +1,86 @@
|
|
1
1
|
#coding:utf-8
|
2
|
+
|
2
3
|
require 'unicode'
|
3
4
|
|
4
|
-
|
5
|
+
module ReferenciaBibliografica
|
6
|
+
def referencia_abnt
|
7
|
+
tipos = {
|
8
|
+
'trabalho de conclusão' => :referencia_trabalho_conclusao,
|
9
|
+
'artigo de anais de eventos' => :referencia_artigo_anais_evento,
|
10
|
+
'artigo de periodico' => :referencia_artigo_periodico,
|
11
|
+
'periodico tecnico cientifico' => :referencia_periodico_tecnico_cientifico,
|
12
|
+
'livro' => :referencia_livro,
|
13
|
+
'relatorio tecnico cientifico' => :referencia_relatorio_tecnico_cientifico,
|
14
|
+
'imagem' => :referencia_imagem,
|
15
|
+
'objetos de aprendizagem' => :referencia_objetos_de_aprendizagem,
|
16
|
+
'outros conteúdos' => :referencia_outros_conteudos }
|
17
|
+
__send__(tipos[self.tipo])
|
18
|
+
end
|
5
19
|
|
6
|
-
|
7
|
-
lista_autores = autores.split(';')
|
8
|
-
lista_autores.each_index do |i|
|
9
|
-
nome_autor = lista_autores[i].split(' ')
|
10
|
-
if nome_autor.include? ('')
|
11
|
-
nome_autor.delete('')
|
12
|
-
end
|
13
|
-
nome_abnt = Unicode.upcase nome_autor.pop + ','
|
14
|
-
nome_autor.each_index do |j|
|
15
|
-
nome_abnt += ' ' + nome_autor[j][0] + '.'
|
16
|
-
end
|
17
|
-
lista_autores[i] = nome_abnt
|
18
|
-
end
|
19
|
-
return lista_autores * "; "
|
20
|
-
end
|
20
|
+
private
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
subtitulo = _gerar_subtitulo(trabalho_conclusao)
|
26
|
-
defesa = trabalho_conclusao.data_defesa
|
27
|
-
folhas = trabalho_conclusao.total_folhas
|
28
|
-
tipo = trabalho_conclusao.tipo_trabalho
|
29
|
-
instituicao = trabalho_conclusao.instituicao
|
30
|
-
local = trabalho_conclusao.local_defesa
|
31
|
-
return "#{autores} #{titulo}#{subtitulo}. #{defesa}. "\
|
32
|
-
"#{folhas} f. #{tipo} - #{instituicao}, #{local}."
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
def _referencia_artigo_anais_evento(artigo_anais_evento)
|
37
|
-
autores = _monta_nome(artigo_anais_evento.autores)
|
38
|
-
titulo = artigo_anais_evento.titulo
|
39
|
-
subtitulo = _gerar_subtitulo(artigo_anais_evento)
|
40
|
-
nome_evento = artigo_anais_evento.nome_evento
|
41
|
-
numero_evento = artigo_anais_evento.numero_evento
|
42
|
-
ano_evento = artigo_anais_evento.ano_evento
|
43
|
-
local_evento = artigo_anais_evento.local_evento
|
44
|
-
titulo_anais = artigo_anais_evento.titulo_anais
|
45
|
-
local_publicacao = artigo_anais_evento.local_publicacao
|
46
|
-
editora = artigo_anais_evento.editora
|
47
|
-
ano_publicacao = artigo_anais_evento.ano_publicacao
|
48
|
-
pagina_inicial = artigo_anais_evento.pagina_inicial
|
49
|
-
pagina_final = artigo_anais_evento.pagina_final
|
50
|
-
return "#{autores} #{titulo}.#{subtitulo} In: #{nome_evento}, " \
|
51
|
-
"#{numero_evento}., #{ano_evento}, #{local_evento}. " \
|
52
|
-
"#{titulo_anais}. #{local_publicacao}: #{editora}, " \
|
53
|
-
"#{ano_publicacao}. P. #{pagina_inicial}-#{pagina_final}."
|
54
|
-
end
|
22
|
+
def referencia_objetos_de_aprendizagem
|
23
|
+
"#{autores_abnt} #{titulo}. #{instituicao}."
|
24
|
+
end
|
55
25
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
subtitulo = _gerar_subtitulo(artigo_periodico)
|
60
|
-
nome = artigo_periodico.nome_periodico
|
61
|
-
local = artigo_periodico.local_publicacao
|
62
|
-
volume = artigo_periodico.volume
|
63
|
-
fasciculo = artigo_periodico.fasciculo
|
64
|
-
pagina_inicial = artigo_periodico.pagina_inicial
|
65
|
-
pagina_final = artigo_periodico.pagina_final
|
66
|
-
data = artigo_periodico.data_publicacao
|
67
|
-
return "#{autores} #{titulo}#{subtitulo}. #{nome}, #{local}, " \
|
68
|
-
"v. #{volume}, n. #{fasciculo}, " \
|
69
|
-
"p. #{pagina_inicial}-#{pagina_final}, #{data}."
|
70
|
-
end
|
26
|
+
def referencia_imagem
|
27
|
+
"#{autores_abnt} #{titulo}. #{instituicao}, #{local}."
|
28
|
+
end
|
71
29
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
ano_primeiro = periodico_tecnico_cientifico.ano_primeiro_volume
|
77
|
-
ano_ultimo = periodico_tecnico_cientifico.ano_ultimo_volume
|
78
|
-
return "#{titulo}. #{local}: #{editora}, " \
|
79
|
-
"#{ano_primeiro}-#{ano_ultimo}"
|
80
|
-
end
|
30
|
+
def referencia_relatorio_tecnico_cientifico
|
31
|
+
"#{autores_abnt} #{titulo}. #{local_publicacao}: #{instituicao}, "\
|
32
|
+
"#{ano_publicacao}. #{numero_paginas} p."
|
33
|
+
end
|
81
34
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
traducao = _gerar_opcional(livro.traducao)
|
87
|
-
edicao = _gerar_opcional(livro.edicao)
|
88
|
-
publicacao = livro.local_publicacao
|
89
|
-
editora = livro.editora
|
90
|
-
ano = livro.ano_publicacao
|
91
|
-
paginas = livro.numero_paginas
|
92
|
-
return "#{autores} #{titulo}: #{subtitulo}. #{traducao}#{edicao}" \
|
93
|
-
"#{publicacao}: #{editora}, #{ano}. #{paginas} p."
|
94
|
-
end
|
35
|
+
def referencia_livro
|
36
|
+
"#{autores_abnt} #{titulo}#{gerar_subtitulo}. #{traducao}#{edicao}"\
|
37
|
+
"#{local_publicacao}: #{editora}, #{ano_publicacao}. #{numero_paginas} p."
|
38
|
+
end
|
95
39
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
instituicao = relatorio_tecnico_cientifico.instituicao
|
101
|
-
ano = relatorio_tecnico_cientifico.ano_publicacao
|
102
|
-
paginas = relatorio_tecnico_cientifico.numero_paginas
|
103
|
-
return "#{autores} #{titulo}. #{local}: #{instituicao}, #{ano}. " \
|
104
|
-
"#{paginas} p."
|
105
|
-
end
|
40
|
+
def referencia_periodico_tecnico_cientifico
|
41
|
+
"#{titulo}. #{local_publicacao}: #{editora}, "\
|
42
|
+
"#{ano_primeiro_volume}-#{ano_ultimo_volume}"
|
43
|
+
end
|
106
44
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
return "#{autores} #{titulo}. #{instituicao}, #{local}."
|
113
|
-
end
|
45
|
+
def referencia_artigo_periodico
|
46
|
+
"#{autores_abnt} #{titulo}#{gerar_subtitulo}. #{nome_periodico}, "\
|
47
|
+
"#{local_publicacao}, v. #{volume}, n. #{fasciculo}, "\
|
48
|
+
"p. #{pagina_inicial}-#{pagina_final}, #{data_publicacao}."
|
49
|
+
end
|
114
50
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
51
|
+
def referencia_artigo_anais_evento
|
52
|
+
"#{autores_abnt} #{titulo}#{gerar_subtitulo}. In: #{nome_evento}, "\
|
53
|
+
"#{numero_evento}., #{ano_evento}, #{local_evento}. "\
|
54
|
+
"#{titulo_anais}. #{local_publicacao}: #{editora}, "\
|
55
|
+
"#{ano_publicacao}. P. #{pagina_inicial}-#{pagina_final}."
|
56
|
+
end
|
121
57
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
instituicao = outros_conteudos.instituicao
|
126
|
-
return "#{autores} #{titulo}. #{instituicao}."
|
127
|
-
end
|
58
|
+
def referencia_outros_conteudos
|
59
|
+
"#{autores_abnt} #{titulo}. #{instituicao}."
|
60
|
+
end
|
128
61
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
'artigo de periodico' => :_referencia_artigo_periodico,
|
134
|
-
'periodico tecnico cientifico' => :_referencia_periodico_tecnico_cientifico,
|
135
|
-
'livro' => :_referencia_livro,
|
136
|
-
'relatorio tecnico cientifico' => :_referencia_relatorio_tecnico_cientifico,
|
137
|
-
'imagem' => :_referencia_imagem,
|
138
|
-
'objetos de aprendizagem' => :_referencia_objetos_de_aprendizagem,
|
139
|
-
'outros conteúdos' => :_referencia_outros_conteudos }
|
140
|
-
public_method(conversores[documento.tipo]).call documento
|
141
|
-
end
|
142
|
-
|
143
|
-
def _gerar_subtitulo(documento)
|
144
|
-
return _gerar_opcional(documento.subtitulo)
|
145
|
-
end
|
62
|
+
def referencia_trabalho_conclusao
|
63
|
+
"#{autores_abnt} #{titulo}#{gerar_subtitulo}. #{data_defesa}. "\
|
64
|
+
"#{total_folhas} f. #{tipo_trabalho} - #{instituicao}, #{local_defesa}."
|
65
|
+
end
|
146
66
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
67
|
+
def gerar_subtitulo
|
68
|
+
subtitulo ? ": #{subtitulo}" : ''
|
69
|
+
# subtitulo || ''
|
70
|
+
end
|
151
71
|
|
72
|
+
def autores_abnt
|
73
|
+
lista_autores_abnt = []
|
74
|
+
lista_autores = autores.split(';')
|
75
|
+
lista_autores.each do |autor|
|
76
|
+
nome_autor = autor.split(' ')
|
77
|
+
nome_autor.delete('')
|
78
|
+
nome_abnt = Unicode.upcase(nome_autor.pop + ',')
|
79
|
+
nome_autor.each do |palavra|
|
80
|
+
nome_abnt += ' ' + palavra[0] + '.'
|
81
|
+
end
|
82
|
+
lista_autores_abnt << nome_abnt
|
83
|
+
end
|
84
|
+
lista_autores_abnt * "; "
|
85
|
+
end
|
152
86
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "nsi-abntformat"
|
8
|
+
s.version = "1.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Oswaldo Ferreira"]
|
12
|
+
s.date = "2012-04-04"
|
13
|
+
s.description = "Transforms objects containing documentation metadata in bibliographic references on ABNT format"
|
14
|
+
s.email = "oswluizf@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"CONTRIBUTORS",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"lib/referencia_bibliografica.rb",
|
29
|
+
"nsi-abntformat.gemspec",
|
30
|
+
"spec/referencia_bibliografica_spec.rb",
|
31
|
+
"spec/spec_helper.rb"
|
32
|
+
]
|
33
|
+
s.homepage = "http://github.com/oswluiz/nsi-abntformat"
|
34
|
+
s.licenses = ["MIT"]
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
s.rubygems_version = "1.8.21"
|
37
|
+
s.summary = "ABNT Format"
|
38
|
+
|
39
|
+
if s.respond_to? :specification_version then
|
40
|
+
s.specification_version = 3
|
41
|
+
|
42
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
44
|
+
s.add_development_dependency(%q<bundler>, ["> 1.0.0"])
|
45
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
46
|
+
s.add_development_dependency(%q<unicode>, [">= 0"])
|
47
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<diff-lcs>, [">= 1.1.3"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
51
|
+
s.add_dependency(%q<bundler>, ["> 1.0.0"])
|
52
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
53
|
+
s.add_dependency(%q<unicode>, [">= 0"])
|
54
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
55
|
+
s.add_dependency(%q<diff-lcs>, [">= 1.1.3"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
59
|
+
s.add_dependency(%q<bundler>, ["> 1.0.0"])
|
60
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
61
|
+
s.add_dependency(%q<unicode>, [">= 0"])
|
62
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
63
|
+
s.add_dependency(%q<diff-lcs>, [">= 1.1.3"])
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
@@ -0,0 +1,156 @@
|
|
1
|
+
#coding: utf-8
|
2
|
+
|
3
|
+
require_relative "spec_helper"
|
4
|
+
|
5
|
+
describe ReferenciaBibliografica do
|
6
|
+
class Documento
|
7
|
+
include ReferenciaBibliografica
|
8
|
+
end
|
9
|
+
|
10
|
+
subject { Documento.new }
|
11
|
+
|
12
|
+
it "trabalho de conclusão" do
|
13
|
+
subject.stub('tipo') { 'trabalho de conclusão' }
|
14
|
+
subject.stub('autores') { 'Ian Fantucci' }
|
15
|
+
subject.stub('titulo') { 'Contribuição do alerta, da atenção, '\
|
16
|
+
'da intenção e da expectativa temporal para o desempenho de '\
|
17
|
+
'humanos em tarefas de tempo de reação' }
|
18
|
+
subject.stub('subtitulo') { nil }
|
19
|
+
subject.stub('data_defesa') { '2001' }
|
20
|
+
subject.stub('total_folhas') { '130' }
|
21
|
+
subject.stub('tipo_trabalho') { 'Tese (Doutorado em Psicologia)' }
|
22
|
+
subject.stub('instituicao') { 'Instituto de Psicologia, '\
|
23
|
+
'Universidade de São Paulo' }
|
24
|
+
subject.stub!('local_defesa') { 'São Paulo' }
|
25
|
+
|
26
|
+
subject.referencia_abnt.should == (
|
27
|
+
'FANTUCCI, I. Contribuição do alerta, da atenção, da intenção e da'\
|
28
|
+
' expectativa temporal para o desempenho de humanos em tarefas de '\
|
29
|
+
'tempo de reação. 2001. 130 f. Tese (Doutorado em Psicologia) - '\
|
30
|
+
'Instituto de Psicologia, Universidade de São Paulo, São Paulo.')
|
31
|
+
end
|
32
|
+
|
33
|
+
it "gerando referencia para artigos de anais de eventos" do
|
34
|
+
subject.stub('tipo') { 'artigo de anais de eventos' }
|
35
|
+
subject.stub('autores') { 'Antônio Fernandes Bueno Moreira' }
|
36
|
+
subject.stub('titulo') { 'Multiculturalismo, Currículo e '\
|
37
|
+
'Formação de Professores' }
|
38
|
+
subject.stub('subtitulo') { nil }
|
39
|
+
subject.stub('nome_evento') { 'SEMINÁRIO DE EDUCAÇÃO BÁSICA' }
|
40
|
+
subject.stub('numero_evento') { '2' }
|
41
|
+
subject.stub('ano_evento') { '1998' }
|
42
|
+
subject.stub('local_evento') { 'Santa Cruz do Sul' }
|
43
|
+
subject.stub('titulo_anais') { 'Anais' }
|
44
|
+
subject.stub('local_publicacao') { 'Santa Cruz do Sul' }
|
45
|
+
subject.stub('editora') { 'EDUNISC' }
|
46
|
+
subject.stub('ano_publicacao') { '1998' }
|
47
|
+
subject.stub('pagina_inicial') { '15' }
|
48
|
+
subject.stub('pagina_final') { '30' }
|
49
|
+
|
50
|
+
subject.referencia_abnt.should == (
|
51
|
+
'MOREIRA, A. F. B. Multiculturalismo, Currículo e Formação de '\
|
52
|
+
'Professores. In: SEMINÁRIO DE EDUCAÇÃO BÁSICA, 2., 1998, Santa '\
|
53
|
+
'Cruz do Sul. Anais. Santa Cruz do Sul: EDUNISC, 1998. P. 15-30.')
|
54
|
+
end
|
55
|
+
|
56
|
+
it "gerando referencia de artigo de periodico" do
|
57
|
+
subject.stub('tipo') { 'artigo de periodico' }
|
58
|
+
subject.stub('autores') { 'Demerval Saviani' }
|
59
|
+
subject.stub('titulo') { 'A Universidade e a Problemática da Educação e Cultura' }
|
60
|
+
subject.stub('subtitulo') { nil }
|
61
|
+
subject.stub('nome_periodico') { 'Educação Brasileira' }
|
62
|
+
subject.stub('local_publicacao') { 'Brasília' }
|
63
|
+
subject.stub('volume') { '1' }
|
64
|
+
subject.stub('fasciculo') { '3' }
|
65
|
+
subject.stub('pagina_inicial') { '35' }
|
66
|
+
subject.stub('pagina_final') { '58' }
|
67
|
+
subject.stub('data_publicacao') { '1979' }
|
68
|
+
|
69
|
+
subject.referencia_abnt.should == (
|
70
|
+
"SAVIANI, D. A Universidade e a Problemática da Educação e Cultura."\
|
71
|
+
" Educação Brasileira, Brasília, v. 1, n. 3, p. 35-58, 1979.")
|
72
|
+
end
|
73
|
+
|
74
|
+
it "gerando referencia de periodico tecnico cientifico" do
|
75
|
+
subject.stub('tipo') { 'periodico tecnico cientifico' }
|
76
|
+
subject.stub('titulo') { 'EDUCAÇÃO & REALIDADE' }
|
77
|
+
subject.stub('local_publicacao') { 'Porto Alegre' }
|
78
|
+
subject.stub('editora') { 'UFRGS/FACED' }
|
79
|
+
subject.stub('ano_primeiro_volume') { '1975' }
|
80
|
+
subject.stub('ano_ultimo_volume') { nil }
|
81
|
+
|
82
|
+
subject.referencia_abnt.should == (
|
83
|
+
'EDUCAÇÃO & REALIDADE. Porto Alegre:'\
|
84
|
+
' UFRGS/FACED, 1975-')
|
85
|
+
end
|
86
|
+
|
87
|
+
it "gerando referencia de livro" do
|
88
|
+
subject.stub('tipo') { 'livro' }
|
89
|
+
subject.stub('autores') { 'Marcos Antônio Azevedo; '\
|
90
|
+
'Vinícios Nogueira Almeida Guerra' }
|
91
|
+
subject.stub('titulo') { 'Mania de bater' }
|
92
|
+
subject.stub('subtitulo') { 'a punição corporal doméstica de crianças '\
|
93
|
+
'e adolescentes no Brasil' }
|
94
|
+
subject.stub('traducao') { nil }
|
95
|
+
subject.stub('edicao') { nil }
|
96
|
+
subject.stub('local_publicacao') { 'São Paulo' }
|
97
|
+
subject.stub('editora') { 'Iglu' }
|
98
|
+
subject.stub('ano_publicacao') { '2001' }
|
99
|
+
subject.stub('numero_paginas') { '386' }
|
100
|
+
|
101
|
+
subject.referencia_abnt.should == (
|
102
|
+
'AZEVEDO, M. A.; GUERRA, V. N. A. '\
|
103
|
+
'Mania de bater: a punição corporal doméstica de crianças e '\
|
104
|
+
'adolescentes no Brasil. São Paulo: Iglu, 2001. 386 p.')
|
105
|
+
end
|
106
|
+
|
107
|
+
it "gerando referencia de relatorio tecnico cientifico" do
|
108
|
+
subject.stub('tipo') { 'relatorio tecnico cientifico' }
|
109
|
+
subject.stub('autores') { 'Ubiraci Espinelli Souza; '\
|
110
|
+
'Silvio Burratino Melhado' }
|
111
|
+
subject.stub('titulo') { 'Subsídios para a avaliação'\
|
112
|
+
' do custo de mão-de-obra na'\
|
113
|
+
' construção civil' }
|
114
|
+
subject.stub('local_publicacao') { 'São Paulo' }
|
115
|
+
subject.stub('instituicao') { 'EPUSP' }
|
116
|
+
subject.stub('ano_publicacao') { '1991' }
|
117
|
+
subject.stub('numero_paginas') { '38' }
|
118
|
+
|
119
|
+
subject.referencia_abnt.should == (
|
120
|
+
'SOUZA, U. E.; MELHADO, S. B. Subsídios para a avaliação do '\
|
121
|
+
'custo de mão-de-obra na construção civil. São Paulo: EPUSP, 1991. '\
|
122
|
+
'38 p.')
|
123
|
+
end
|
124
|
+
|
125
|
+
it "gerando referencia de imagem" do
|
126
|
+
subject.stub('tipo') { 'imagem' }
|
127
|
+
subject.stub('autores') { 'Alberto Gomes Pereira; Ricardo Silva' }
|
128
|
+
subject.stub('titulo') { 'As crianças da indonésia' }
|
129
|
+
subject.stub('instituicao') { 'Instituto Federal Fluminense' }
|
130
|
+
subject.stub('local') { 'Campos dos Goytacazes' }
|
131
|
+
|
132
|
+
subject.referencia_abnt.should == ('PEREIRA, A. G.; SILVA, R. As '\
|
133
|
+
'crianças da indonésia. Instituto Federal '\
|
134
|
+
'Fluminense, Campos dos Goytacazes.')
|
135
|
+
end
|
136
|
+
|
137
|
+
it "gerando referencia de objetos de aprendizagem" do
|
138
|
+
subject.stub('tipo') { 'objetos de aprendizagem' }
|
139
|
+
subject.stub('autores') { 'Ariosvaldo Gomes' }
|
140
|
+
subject.stub('titulo') { 'Viver é aprender' }
|
141
|
+
subject.stub('instituicao') { 'Instituto Federal Fluminense' }
|
142
|
+
|
143
|
+
subject.referencia_abnt.should == ('GOMES, A. Viver é aprender. '\
|
144
|
+
'Instituto Federal Fluminense.')
|
145
|
+
end
|
146
|
+
|
147
|
+
it "gerando referencia de outros conteudos" do
|
148
|
+
subject.stub('tipo') { 'outros conteúdos' }
|
149
|
+
subject.stub('autores') { 'Adalberto Pereira Silva' }
|
150
|
+
subject.stub('titulo') { 'Tenho joanetes' }
|
151
|
+
subject.stub('instituicao') { 'Instituto Federal Fluminense' }
|
152
|
+
|
153
|
+
subject.referencia_abnt.should eql ('SILVA, A. P. Tenho joanetes. '\
|
154
|
+
'Instituto Federal Fluminense.')
|
155
|
+
end
|
156
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nsi-abntformat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: bundler
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>'
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: 1.0.0
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>'
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.0
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: jeweler
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: 1.8.3
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.8.3
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: unicode
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: rake
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: diff-lcs
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,7 +101,12 @@ dependencies:
|
|
76
101
|
version: 1.1.3
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.1.3
|
80
110
|
description: Transforms objects containing documentation metadata in bibliographic
|
81
111
|
references on ABNT format
|
82
112
|
email: oswluizf@gmail.com
|
@@ -89,13 +119,15 @@ files:
|
|
89
119
|
- .document
|
90
120
|
- CONTRIBUTORS
|
91
121
|
- Gemfile
|
122
|
+
- Gemfile.lock
|
92
123
|
- LICENSE.txt
|
93
124
|
- README.rdoc
|
94
125
|
- Rakefile
|
95
126
|
- VERSION
|
96
127
|
- lib/referencia_bibliografica.rb
|
97
|
-
-
|
98
|
-
-
|
128
|
+
- nsi-abntformat.gemspec
|
129
|
+
- spec/referencia_bibliografica_spec.rb
|
130
|
+
- spec/spec_helper.rb
|
99
131
|
homepage: http://github.com/oswluiz/nsi-abntformat
|
100
132
|
licenses:
|
101
133
|
- MIT
|
@@ -109,6 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
141
|
- - ! '>='
|
110
142
|
- !ruby/object:Gem::Version
|
111
143
|
version: '0'
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
hash: -3753683140695218369
|
112
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
148
|
none: false
|
114
149
|
requirements:
|
@@ -117,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
152
|
version: '0'
|
118
153
|
requirements: []
|
119
154
|
rubyforge_project:
|
120
|
-
rubygems_version: 1.8.
|
155
|
+
rubygems_version: 1.8.21
|
121
156
|
signing_key:
|
122
157
|
specification_version: 3
|
123
158
|
summary: ABNT Format
|
@@ -1,195 +0,0 @@
|
|
1
|
-
#coding: utf-8
|
2
|
-
require_relative "spec_helper"
|
3
|
-
|
4
|
-
describe "Spec de ReferenciaBibliografica" do
|
5
|
-
it "converte nome completo em citação" do
|
6
|
-
referencia = ReferenciaBibliografica.new
|
7
|
-
referencia._monta_nome('Ruhan Ferreira Almeida; Carlos Souza Teste').should \
|
8
|
-
eql ("ALMEIDA, R. F.; TESTE, C. S.")
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
describe "Gerador de referencias" do
|
14
|
-
|
15
|
-
it "gerando referencia para trabalho de conclusão" do
|
16
|
-
referencia = ReferenciaBibliografica.new
|
17
|
-
trabalho_conclusao = mock(:trabalho_conclusao)
|
18
|
-
trabalho_conclusao.stub('tipo') { 'trabalho de conclusão' }
|
19
|
-
trabalho_conclusao.stub('autores') { 'Ian Fantucci' }
|
20
|
-
trabalho_conclusao.stub('titulo') { 'Contribuição do alerta, da atenção, ' \
|
21
|
-
'da intenção e da expectativa temporal para o desempenho de '\
|
22
|
-
'humanos em tarefas de tempo de reação' }
|
23
|
-
trabalho_conclusao.stub('subtitulo') { nil }
|
24
|
-
trabalho_conclusao.stub('data_defesa') { '2001' }
|
25
|
-
trabalho_conclusao.stub('total_folhas') { '130' }
|
26
|
-
trabalho_conclusao.stub('tipo_trabalho') { 'Tese (Doutorado em Psicologia)' }
|
27
|
-
trabalho_conclusao.stub('instituicao') { 'Instituto de Psicologia, '\
|
28
|
-
'Universidade de São Paulo' }
|
29
|
-
trabalho_conclusao.stub!('local_defesa') { 'São Paulo' }
|
30
|
-
|
31
|
-
|
32
|
-
referencia_abnt = referencia.gerar(trabalho_conclusao)
|
33
|
-
|
34
|
-
referencia_abnt.should == (
|
35
|
-
'FANTUCCI, I. Contribuição do alerta, da atenção, da intenção e da' \
|
36
|
-
' expectativa temporal para o desempenho de humanos em tarefas de ' \
|
37
|
-
'tempo de reação. 2001. 130 f. Tese (Doutorado em Psicologia) - ' \
|
38
|
-
'Instituto de Psicologia, Universidade de São Paulo, São Paulo.')
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
it "gerando referencia para artigos de anais de eventos" do
|
43
|
-
referencia = ReferenciaBibliografica.new
|
44
|
-
artigo_anais_evento = mock(:trabalho_conclusao)
|
45
|
-
artigo_anais_evento.stub('tipo') { 'artigo de anais de eventos' }
|
46
|
-
artigo_anais_evento.stub('autores') { 'Antônio Fernandes Bueno Moreira' }
|
47
|
-
artigo_anais_evento.stub('titulo') { 'Multiculturalismo, Currículo e '\
|
48
|
-
'Formação de Professores' }
|
49
|
-
artigo_anais_evento.stub('subtitulo') { nil }
|
50
|
-
artigo_anais_evento.stub('nome_evento') { 'SEMINÁRIO DE EDUCAÇÃO BÁSICA' }
|
51
|
-
artigo_anais_evento.stub('numero_evento') { '2' }
|
52
|
-
artigo_anais_evento.stub('ano_evento') { '1998' }
|
53
|
-
artigo_anais_evento.stub('local_evento') { 'Santa Cruz do Sul' }
|
54
|
-
artigo_anais_evento.stub('titulo_anais') { 'Anais' }
|
55
|
-
artigo_anais_evento.stub('local_publicacao') { 'Santa Cruz do Sul' }
|
56
|
-
artigo_anais_evento.stub('editora') { 'EDUNISC' }
|
57
|
-
artigo_anais_evento.stub('ano_publicacao') { '1998' }
|
58
|
-
artigo_anais_evento.stub('pagina_inicial') { '15' }
|
59
|
-
artigo_anais_evento.stub('pagina_final') { '30' }
|
60
|
-
|
61
|
-
referencia_anais_evento = referencia.gerar(artigo_anais_evento)
|
62
|
-
referencia_anais_evento.should == (
|
63
|
-
'MOREIRA, A. F. B. Multiculturalismo, Currículo e Formação de ' \
|
64
|
-
'Professores. In: SEMINÁRIO DE EDUCAÇÃO BÁSICA, 2., 1998, Santa ' \
|
65
|
-
'Cruz do Sul. Anais. Santa Cruz do Sul: EDUNISC, 1998. P. 15-30.')
|
66
|
-
end
|
67
|
-
|
68
|
-
it "gerando referencia de artigo de periodico" do
|
69
|
-
referencia = ReferenciaBibliografica.new
|
70
|
-
artigo_periodico = mock(:artigo_periodico)
|
71
|
-
|
72
|
-
artigo_periodico.stub('tipo') { 'artigo de periodico' }
|
73
|
-
artigo_periodico.stub('autores') { 'Demerval Saviani' }
|
74
|
-
artigo_periodico.stub('titulo') { 'A Universidade e a Problemática da Educação e Cultura' }
|
75
|
-
artigo_periodico.stub('subtitulo') { nil }
|
76
|
-
artigo_periodico.stub('nome_periodico') { 'Educação Brasileira' }
|
77
|
-
artigo_periodico.stub('local_publicacao') { 'Brasília' }
|
78
|
-
artigo_periodico.stub('volume') { '1' }
|
79
|
-
artigo_periodico.stub('fasciculo') { '3' }
|
80
|
-
artigo_periodico.stub('pagina_inicial') { '35' }
|
81
|
-
artigo_periodico.stub('pagina_final') { '58' }
|
82
|
-
artigo_periodico.stub('data_publicacao') { '1979' }
|
83
|
-
|
84
|
-
referencia_artigo_periodico = referencia.gerar(artigo_periodico)
|
85
|
-
referencia_artigo_periodico.should == (
|
86
|
-
"SAVIANI, D. A Universidade e a Problemática da Educação e Cultura."\
|
87
|
-
" Educação Brasileira, Brasília, v. 1, n. 3, p. 35-58, 1979.")
|
88
|
-
end
|
89
|
-
|
90
|
-
it "gerando referencia de periodico tecnico cientifico" do
|
91
|
-
referencia = ReferenciaBibliografica.new
|
92
|
-
periodico_tecnico_cientifico = mock(:periodico_tecnico_cientifico)
|
93
|
-
|
94
|
-
periodico_tecnico_cientifico.stub('tipo') { 'periodico tecnico cientifico' }
|
95
|
-
periodico_tecnico_cientifico.stub('titulo') { 'EDUCAÇÃO & REALIDADE' }
|
96
|
-
periodico_tecnico_cientifico.stub('local_publicacao') { 'Porto Alegre' }
|
97
|
-
periodico_tecnico_cientifico.stub('editora') { 'UFRGS/FACED' }
|
98
|
-
periodico_tecnico_cientifico.stub('ano_primeiro_volume') { '1975' }
|
99
|
-
periodico_tecnico_cientifico.stub('ano_ultimo_volume') { nil }
|
100
|
-
|
101
|
-
referencia_tecnico_cientifico = referencia.gerar(periodico_tecnico_cientifico)
|
102
|
-
referencia_tecnico_cientifico.should == ('EDUCAÇÃO & REALIDADE. Porto Alegre:'\
|
103
|
-
' UFRGS/FACED, 1975-')
|
104
|
-
end
|
105
|
-
|
106
|
-
it "gerando referencia de livro" do
|
107
|
-
referencia = ReferenciaBibliografica.new
|
108
|
-
livro = mock(:livro)
|
109
|
-
|
110
|
-
livro.stub('tipo') { 'livro' }
|
111
|
-
livro.stub('autores') { 'Marcos Antônio Azevedo; '\
|
112
|
-
'Vinícios Nogueira Almeida Guerra' }
|
113
|
-
livro.stub('titulo') { 'Mania de bater' }
|
114
|
-
livro.stub('subtitulo') { 'a punição corporal doméstica de crianças '\
|
115
|
-
'e adolescentes no Brasil' }
|
116
|
-
livro.stub('traducao') { nil }
|
117
|
-
livro.stub('edicao') { nil }
|
118
|
-
livro.stub('local_publicacao') { 'São Paulo' }
|
119
|
-
livro.stub('editora') { 'Iglu' }
|
120
|
-
livro.stub('ano_publicacao') { '2001' }
|
121
|
-
livro.stub('numero_paginas') { '386' }
|
122
|
-
|
123
|
-
referencia_livro = referencia.gerar(livro)
|
124
|
-
referencia_livro.should == ('AZEVEDO, M. A.; GUERRA, V. N. A. ' \
|
125
|
-
'Mania de bater: a punição corporal doméstica de crianças e ' \
|
126
|
-
'adolescentes no Brasil. São Paulo: Iglu, 2001. 386 p.')
|
127
|
-
end
|
128
|
-
|
129
|
-
it "gerando referencia de relatorio tecnico cientifico" do
|
130
|
-
referencia = ReferenciaBibliografica.new
|
131
|
-
relatorio_tecnico_cientifico = mock(:relatorio_tecnico_cientifico)
|
132
|
-
|
133
|
-
relatorio_tecnico_cientifico.stub('tipo') { 'relatorio tecnico cientifico' }
|
134
|
-
relatorio_tecnico_cientifico.stub('autores') { 'Ubiraci Espinelli Souza; '\
|
135
|
-
'Silvio Burratino Melhado' }
|
136
|
-
relatorio_tecnico_cientifico.stub('titulo') { 'Subsídios para a avaliação' \
|
137
|
-
' do custo de mão-de-obra na construção civil' }
|
138
|
-
relatorio_tecnico_cientifico.stub('local_publicacao') { 'São Paulo' }
|
139
|
-
relatorio_tecnico_cientifico.stub('instituicao') { 'EPUSP' }
|
140
|
-
relatorio_tecnico_cientifico.stub('ano_publicacao') { '1991' }
|
141
|
-
relatorio_tecnico_cientifico.stub('numero_paginas') { '38' }
|
142
|
-
|
143
|
-
referencia_relatorio_cientifico = referencia.gerar(relatorio_tecnico_cientifico)
|
144
|
-
referencia_relatorio_cientifico.should == (
|
145
|
-
'SOUZA, U. E.; MELHADO, S. B. Subsídios para a avaliação do ' \
|
146
|
-
'custo de mão-de-obra na construção civil. São Paulo: EPUSP, 1991. ' \
|
147
|
-
'38 p.')
|
148
|
-
end
|
149
|
-
|
150
|
-
it "gerando referencia de imagem" do
|
151
|
-
referencia = ReferenciaBibliografica.new
|
152
|
-
imagem = mock(:imagem)
|
153
|
-
|
154
|
-
imagem.stub('tipo') { 'imagem' }
|
155
|
-
imagem.stub('autores') { 'Alberto Gomes Pereira; Ricardo Silva' }
|
156
|
-
imagem.stub('titulo') { 'As crianças da indonésia' }
|
157
|
-
imagem.stub('instituicao') { 'Instituto Federal Fluminense' }
|
158
|
-
imagem.stub('local') { 'Campos dos Goytacazes' }
|
159
|
-
|
160
|
-
referencia_imagem = referencia.gerar(imagem)
|
161
|
-
referencia_imagem.should == ('PEREIRA, A. G.; SILVA, R. As ' \
|
162
|
-
'crianças da indonésia. Instituto Federal Fluminense, Campos dos ' \
|
163
|
-
'Goytacazes.')
|
164
|
-
end
|
165
|
-
|
166
|
-
it "gerando referencia de objetos de aprendizagem" do
|
167
|
-
referencia = ReferenciaBibliografica.new
|
168
|
-
objetos_de_aprendizagem = mock(:objetos_de_aprendizagem)
|
169
|
-
|
170
|
-
objetos_de_aprendizagem.stub('tipo') { 'objetos de aprendizagem' }
|
171
|
-
objetos_de_aprendizagem.stub('autores') { 'Ariosvaldo Gomes' }
|
172
|
-
objetos_de_aprendizagem.stub('titulo') { 'Viver é aprender' }
|
173
|
-
objetos_de_aprendizagem.stub('instituicao') { 'Instituto Federal Fluminense' }
|
174
|
-
|
175
|
-
referencia_aprendizagem = referencia.gerar(objetos_de_aprendizagem)
|
176
|
-
referencia_aprendizagem.should == ('GOMES, A. Viver é aprender. ' \
|
177
|
-
'Instituto Federal Fluminense.')
|
178
|
-
end
|
179
|
-
|
180
|
-
it "gerando referencia de outros conteudos" do
|
181
|
-
referencia = ReferenciaBibliografica.new
|
182
|
-
outros_conteudos = mock(:outros_conteudos)
|
183
|
-
|
184
|
-
outros_conteudos.stub('tipo') { 'outros conteúdos' }
|
185
|
-
outros_conteudos.stub('autores') { 'Adalberto Pereira Silva' }
|
186
|
-
outros_conteudos.stub('titulo') { 'Tenho joanetes' }
|
187
|
-
outros_conteudos.stub('instituicao') { 'Instituto Federal Fluminense' }
|
188
|
-
|
189
|
-
referencia_outros = referencia.gerar(outros_conteudos)
|
190
|
-
referencia_outros.should eql ('SILVA, A. P. Tenho joanetes. ' \
|
191
|
-
'Instituto Federal Fluminense.')
|
192
|
-
end
|
193
|
-
|
194
|
-
end
|
195
|
-
|