job_function 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 625de55d9a1f3cb124aef58d9c2a713990b6b076
4
+ data.tar.gz: 52a2422976a90e13edf6cedd10d3f62dfbd0dddb
5
+ SHA512:
6
+ metadata.gz: e076d9ed42d75cc3055f95e4fa38e52131d084ccb4d0782eace999d7e05841a9af5b0f4425267fb5f47810becde791fe035ad74038849ea9919056e72f54c034
7
+ data.tar.gz: c2f94182ee6567e4d31bd1aae30be154a75c937fe4561c406b6f8db9aff3132f7d390be62e77e86b910e3872c900c43fc899c86bc8bb667c288adfb254c0d419
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,17 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ job_function (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.1.0)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.3)
16
+ job_function!
17
+ rake
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # JobFunction
2
+
3
+ Gem que carrega uma lista de profissões
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'job_function'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install job_function
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'job_function/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "job_function"
8
+ s.version = JobFunction::VERSION
9
+ s.authors = ["ruan brandao", "bruno costa"]
10
+ s.email = ["ruan.bernardo@gmail.com", "brunoadacosta@gmail.com"]
11
+ s.description = %q{Lista de cargos}
12
+ s.summary = %q{Carrega lista de cargos}
13
+ s.homepage = "https://github.com/BankFacil/job_function"
14
+ s.license = "MIT"
15
+
16
+ s.files = `git ls-files`.split($/)
17
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency "bundler", "~> 1.3"
22
+ s.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,71 @@
1
+ require "job_function/version"
2
+ require "job_function/jobs"
3
+
4
+
5
+ module ActionView
6
+ module Helpers
7
+ module FormOptionsHelper
8
+ #
9
+ # Return select and option tags
10
+ # for the given object and method,
11
+ # using job_functions_for_select to
12
+ # generate the list of option tags.
13
+ #
14
+ def job_function(object, method, options = {},
15
+ html_options = {})
16
+
17
+ tag = if defined?(ActionView::Helpers::InstanceTag) &&
18
+ ActionView::Helpers::InstanceTag.instance_method(:initialize).arity != 0
19
+
20
+ InstanceTag.new(object, method, self, options.delete(:object))
21
+ else
22
+ JobFunction.new(object, method, self, options)
23
+ end
24
+
25
+ tag.to_job_function_tag(options, html_options)
26
+ end
27
+
28
+ def job_functions_for_select(selected = nil)
29
+ values = ::JobFunction::LIST
30
+
31
+
32
+ return options_for_select(values, selected)
33
+ end
34
+
35
+ end
36
+
37
+ module ToJobFunctionTag
38
+ def to_job_function_tag(options, html_options)
39
+ html_options = html_options.stringify_keys
40
+ add_default_name_and_id(html_options)
41
+ value = value(object)
42
+ content_tag("select",
43
+ add_options(
44
+ job_functions_for_select(value),
45
+ options, value
46
+ ), html_options
47
+ )
48
+ end
49
+ end
50
+
51
+ if defined?(ActionView::Helpers::InstanceTag) &&
52
+ ActionView::Helpers::InstanceTag.instance_method(:initialize).arity != 0
53
+ class InstanceTag
54
+ include ToJobFunctionTag
55
+ end
56
+ else
57
+ class JobFunction < Tags::Base
58
+ include ToJobFunctionTag
59
+ end
60
+ end
61
+
62
+ class FormBuilder
63
+ def job_function(method, options = {},
64
+ html_options = {})
65
+
66
+ @template.job_function(@object_name, method, options.merge(:object => @object),
67
+ html_options)
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,335 @@
1
+ # encoding: utf-8
2
+ module JobFunction
3
+ LIST = [
4
+ "Açougueiro",
5
+ "Administrator",
6
+ "Advogado",
7
+ "Aeroviária",
8
+ "Ag Administrativo",
9
+ "Ag Policia",
10
+ "Ag Saúde",
11
+ "Ag Viagens",
12
+ "Agente",
13
+ "Agricultor",
14
+ "Agrônomo",
15
+ "Agropecuarista",
16
+ "Ajudante",
17
+ "Ajustador",
18
+ "Almoxarife",
19
+ "Aluguel",
20
+ "Amador",
21
+ "Analista",
22
+ "Analista De Sistemas",
23
+ "Anestesista",
24
+ "Apoio",
25
+ "Apontador",
26
+ "Aposentado",
27
+ "Apresentador",
28
+ "Arquiteto",
29
+ "Arquivista",
30
+ "Arrendatário",
31
+ "Artesã",
32
+ "Artifice",
33
+ "Artista",
34
+ "Assess Adm",
35
+ "Assess Tecnico",
36
+ "Assessor",
37
+ "Assist Social",
38
+ "Assist Adm",
39
+ "Assist Asses",
40
+ "Assist Comercial",
41
+ "Assist Financ",
42
+ "Assist Tecnico",
43
+ "Assistente",
44
+ "Atendente",
45
+ "Atleta",
46
+ "Ator/atriz",
47
+ "Auditor",
48
+ "Aux Adm",
49
+ "Aux Contábil",
50
+ "Aux Enfermagem",
51
+ "Aux Escritório",
52
+ "Aux Laboratório",
53
+ "Aux Técnico",
54
+ "Auxiliar",
55
+ "Baba",
56
+ "Balconista",
57
+ "Bancário",
58
+ "Biblioteca",
59
+ "Biólogo",
60
+ "Biomédico",
61
+ "Bioquimico",
62
+ "Bombeiro",
63
+ "Borracheiro",
64
+ "Cabelereiro",
65
+ "Cabista",
66
+ "Caixa",
67
+ "Caldereiro",
68
+ "Caminhoneiro",
69
+ "Carpinteiro",
70
+ "Carreteiro",
71
+ "Carteiro",
72
+ "Chaveiro",
73
+ "Chefe",
74
+ "Chefe De Seção",
75
+ "Chefe Divisão",
76
+ "Chefe Escritório",
77
+ "Cinegrafista",
78
+ "Cobrador",
79
+ "Colorista",
80
+ "Comandante",
81
+ "Comerciante",
82
+ "Comerciaria",
83
+ "Comiss Bordo",
84
+ "Compensador",
85
+ "Comprador",
86
+ "Condutor",
87
+ "Conferente",
88
+ "Conselheiro",
89
+ "Construtor",
90
+ "Consultor",
91
+ "Contador",
92
+ "Contato Publicitar",
93
+ "Continuo",
94
+ "Contra Mestre",
95
+ "Controlador",
96
+ "Coordenador",
97
+ "Copeira",
98
+ "Coronel",
99
+ "Corretor",
100
+ "Costureira",
101
+ "Cozinheiro",
102
+ "Cuidador De Idosos",
103
+ "Datilografa",
104
+ "Decorador(a)",
105
+ "Defensor Público",
106
+ "Delegado",
107
+ "Demonstrador",
108
+ "Dentista",
109
+ "Deputado",
110
+ "Desenhista",
111
+ "Despachante",
112
+ "Detetive",
113
+ "Diarista",
114
+ "Digitador",
115
+ "Dir Administr",
116
+ "Dir Comercial",
117
+ "Dir Financeiro",
118
+ "Dir Industria",
119
+ "Dir Presidente",
120
+ "Dir Técnico",
121
+ "Diretor",
122
+ "Divulgador",
123
+ "Doméstica",
124
+ "Economista",
125
+ "Editor",
126
+ "Eletrecista",
127
+ "Emissor",
128
+ "Empresario",
129
+ "Empreteiro",
130
+ "Encanador",
131
+ "Encarregado",
132
+ "Enfermagem",
133
+ "Eng Agrônomo",
134
+ "Eng Civil",
135
+ "Engenheiro",
136
+ "Escrituraria",
137
+ "Escrivão",
138
+ "Especialista",
139
+ "Estagiário",
140
+ "Estatístico",
141
+ "Esteticista",
142
+ "Estilista",
143
+ "Estoquista",
144
+ "Estudante",
145
+ "Examinador",
146
+ "Executivo",
147
+ "Extens Rural",
148
+ "Farmacêutico",
149
+ "Faturista",
150
+ "Feirante",
151
+ "Ferramenteiro",
152
+ "Financeiro",
153
+ "Fiscal",
154
+ "Fotógrafo",
155
+ "Frentista",
156
+ "Frezador",
157
+ "Funileiro",
158
+ "Garçon",
159
+ "Gari",
160
+ "Geólogo",
161
+ "Ger Administr",
162
+ "Ger Comercial",
163
+ "Ger Financeiro",
164
+ "Ger Geral",
165
+ "Ger Operac",
166
+ "Ger Produção",
167
+ "Ger Projeto",
168
+ "Ger Regional",
169
+ "Ger Vendas",
170
+ "Gerente",
171
+ "Governanta",
172
+ "Gráfico",
173
+ "Guarda",
174
+ "Guia",
175
+ "Impressor",
176
+ "Industriário",
177
+ "Inspetor",
178
+ "Instalador",
179
+ "Instrum Cirurg",
180
+ "Instrutor",
181
+ "Investigador",
182
+ "Jogador",
183
+ "Jornaleiro",
184
+ "Jornalista",
185
+ "Juiz",
186
+ "Kardexista",
187
+ "Laboratorista",
188
+ "Leiturista",
189
+ "Lider",
190
+ "Locutor",
191
+ "Lubrificador",
192
+ "Maitre",
193
+ "Manicure",
194
+ "Manobrista",
195
+ "Manutenção",
196
+ "Maquinista",
197
+ "Marceneiro",
198
+ "Marinheiro",
199
+ "Massagista",
200
+ "Mecanico",
201
+ "Med Psicologo",
202
+ "Med Psiq",
203
+ "Medico",
204
+ "Mensageiro",
205
+ "Mestre",
206
+ "Metalurgico",
207
+ "Milit Ten",
208
+ "Militar",
209
+ "Militar 1sarg",
210
+ "Militar 1ten",
211
+ "Militar 2sarg",
212
+ "Militar 2ten",
213
+ "Militar 3sarg",
214
+ "Militar Aluno",
215
+ "Militar Aspof",
216
+ "Militar Cabo",
217
+ "Militar Cadet",
218
+ "Militar Capit",
219
+ "Militar Major",
220
+ "Militar Mof",
221
+ "Militar Sarg",
222
+ "Militar Sold",
223
+ "Militar-3ten",
224
+ "Militar-sub Ten",
225
+ "Modelista",
226
+ "Monitor",
227
+ "Montador",
228
+ "Motorista",
229
+ "Musico",
230
+ "Nutricionista",
231
+ "Oficial",
232
+ "Op Maquina",
233
+ "Operador",
234
+ "Orçamentista",
235
+ "Orientador Ed",
236
+ "Ourives",
237
+ "Padeiro",
238
+ "Pastor Padre",
239
+ "Pedagoga",
240
+ "Pedreiro",
241
+ "Pensionista",
242
+ "Perito",
243
+ "Pescador",
244
+ "Pesquisador",
245
+ "Piloto",
246
+ "Pintor (obra)",
247
+ "Planejador",
248
+ "Plantonista",
249
+ "Policial",
250
+ "Porteiro",
251
+ "Posto Efetivo",
252
+ "Prefeito",
253
+ "Prensista",
254
+ "Preparador",
255
+ "Presidente",
256
+ "Procurador",
257
+ "Produtor",
258
+ "Prof Liberal",
259
+ "Professor",
260
+ "Programador",
261
+ "Projetista",
262
+ "Promotor",
263
+ "Propagandista",
264
+ "Protético",
265
+ "Psicólogo",
266
+ "Publicitário",
267
+ "Químico",
268
+ "Radialista",
269
+ "Radiologista",
270
+ "Recepcionista",
271
+ "Redator",
272
+ "Regente",
273
+ "Relações Publ",
274
+ "Relojoeiro",
275
+ "Rep Comercial",
276
+ "Repórter",
277
+ "Representante",
278
+ "Responsável",
279
+ "Retificador",
280
+ "Revisor",
281
+ "Sec Executiva",
282
+ "Secretaria",
283
+ "Securitario",
284
+ "Segurança",
285
+ "Serralheiro",
286
+ "Servente",
287
+ "Serventuária",
288
+ "Sócio",
289
+ "Sociólogo",
290
+ "Sondador",
291
+ "Sub Chefe",
292
+ "Sub Contador",
293
+ "Sub Gerente",
294
+ "Sub Oficial",
295
+ "Sup Vendas",
296
+ "Superintendente",
297
+ "Supervisor",
298
+ "Tabelião",
299
+ "Tapeceiro",
300
+ "Taquigrafo",
301
+ "Taxista",
302
+ "Tec Administrativo",
303
+ "Tec Agrícola",
304
+ "Tec Contábil",
305
+ "Tec Eletronic",
306
+ "Tec Enfermagem",
307
+ "Tec Especial",
308
+ "Tec Judiciario",
309
+ "Tec Laboratorio",
310
+ "Tec Mecanico",
311
+ "Tec Químico",
312
+ "Tec Segurança",
313
+ "Tec Telecomunicação",
314
+ "Tec Tributário",
315
+ "Técnico",
316
+ "Tele Vendedor",
317
+ "Teledigifonista",
318
+ "Telefonista",
319
+ "Telemarketing",
320
+ "Terapeuta",
321
+ "Tesoureiro",
322
+ "Topógrafo",
323
+ "Torneiro",
324
+ "Trainee",
325
+ "Tranportador",
326
+ "Vendedor",
327
+ "Vereador",
328
+ "Veterinário",
329
+ "Vice Diretor",
330
+ "Vice Prefeito",
331
+ "Vice Presidente",
332
+ "Vigilante",
333
+ "Zelador"
334
+ ]
335
+ end
@@ -0,0 +1,3 @@
1
+ module JobFunction
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ require 'action_view'
4
+ require 'job_function'
5
+
6
+ module ActionView
7
+ module Helpers
8
+
9
+ describe JobFunction do
10
+ include TagHelper
11
+
12
+ class Emprego
13
+ attr_accessor :job_function_name
14
+ end
15
+
16
+ let(:emprego) { Emprego.new }
17
+
18
+ let!(:template) { ActionView::Base.new }
19
+
20
+ let(:builder) do
21
+ if defined?(Tags::Base)
22
+ FormBuilder.new(:emprego, emprego, template, {})
23
+ else
24
+ FormBuilder.new(:emprego, emprego, template, {}, Proc.new { })
25
+ end
26
+ end
27
+
28
+ describe "#country_select" do
29
+
30
+ it "creates a select tag" do
31
+ tag = builder.job_function(:job_function_name)
32
+ expect(tag).to include("<select id=\"emprego_job_function_name\" name=\"emprego[job_function_name]\">")
33
+ end
34
+
35
+ it "selected job" do
36
+ emprego.job_function_name = "Analista De Sistemas"
37
+ tag = builder.job_function(:job_function_name)
38
+ expect(tag).to include("<option selected=\"selected\" value=\"Analista De Sistemas\">Analista De Sistemas</option>")
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,17 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ RSpec.configure do |config|
8
+ config.treat_symbols_as_metadata_keys_with_true_values = true
9
+ config.run_all_when_everything_filtered = true
10
+ config.filter_run :focus
11
+
12
+ # Run specs in random order to surface order dependencies. If you find an
13
+ # order dependency and want to debug it, you can fix the order by providing
14
+ # the seed, which is printed after each run.
15
+ # --seed 1234
16
+ config.order = 'random'
17
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: job_function
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - ruan brandao
8
+ - bruno costa
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-08-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ description: Lista de cargos
43
+ email:
44
+ - ruan.bernardo@gmail.com
45
+ - brunoadacosta@gmail.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - .rspec
51
+ - Gemfile
52
+ - Gemfile.lock
53
+ - README.md
54
+ - Rakefile
55
+ - job_function.gemspec
56
+ - lib/job_function.rb
57
+ - lib/job_function/jobs.rb
58
+ - lib/job_function/version.rb
59
+ - spec/job_functions_spec.rb
60
+ - spec/spec_helper.rb
61
+ homepage: https://github.com/BankFacil/job_function
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.0.7
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Carrega lista de cargos
85
+ test_files:
86
+ - spec/job_functions_spec.rb
87
+ - spec/spec_helper.rb