bumeran 0.0.2 → 0.1.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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +14 -0
  5. data/Gemfile.lock +121 -0
  6. data/LICENSE +22 -0
  7. data/README.md +80 -0
  8. data/Rakefile +8 -13
  9. data/bumeran.gemspec +32 -0
  10. data/lib/bumeran.rb +322 -247
  11. data/lib/bumeran/publication.rb +91 -0
  12. data/lib/bumeran/version.rb +1 -1
  13. data/spec/bumeran_initializer_helper_example.rb +7 -0
  14. data/spec/fixtures/bumeran_fixture.rb +69 -0
  15. data/spec/lib/bumeran_spec.rb +144 -0
  16. data/spec/spec_helper.rb +29 -0
  17. metadata +60 -74
  18. data/test/bumeran_test.rb +0 -7
  19. data/test/dummy/README.rdoc +0 -28
  20. data/test/dummy/Rakefile +0 -6
  21. data/test/dummy/app/assets/javascripts/application.js +0 -13
  22. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  23. data/test/dummy/app/controllers/application_controller.rb +0 -5
  24. data/test/dummy/app/helpers/application_helper.rb +0 -2
  25. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  26. data/test/dummy/bin/bundle +0 -3
  27. data/test/dummy/bin/rails +0 -4
  28. data/test/dummy/bin/rake +0 -4
  29. data/test/dummy/bin/setup +0 -29
  30. data/test/dummy/config.ru +0 -4
  31. data/test/dummy/config/application.rb +0 -26
  32. data/test/dummy/config/boot.rb +0 -5
  33. data/test/dummy/config/database.yml +0 -25
  34. data/test/dummy/config/environment.rb +0 -5
  35. data/test/dummy/config/environments/development.rb +0 -41
  36. data/test/dummy/config/environments/production.rb +0 -79
  37. data/test/dummy/config/environments/test.rb +0 -42
  38. data/test/dummy/config/initializers/assets.rb +0 -11
  39. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  40. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  41. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  42. data/test/dummy/config/initializers/inflections.rb +0 -16
  43. data/test/dummy/config/initializers/mime_types.rb +0 -4
  44. data/test/dummy/config/initializers/session_store.rb +0 -3
  45. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  46. data/test/dummy/config/locales/en.yml +0 -23
  47. data/test/dummy/config/routes.rb +0 -56
  48. data/test/dummy/config/secrets.yml +0 -22
  49. data/test/dummy/public/404.html +0 -67
  50. data/test/dummy/public/422.html +0 -67
  51. data/test/dummy/public/500.html +0 -66
  52. data/test/dummy/public/favicon.ico +0 -0
  53. data/test/test_helper.rb +0 -18
@@ -0,0 +1,91 @@
1
+ module Bumeran
2
+ class Publication
3
+ attr_accessor :body
4
+
5
+ def initialize
6
+ self.body = default_publication_json()
7
+ end
8
+
9
+ private
10
+ def default_publication_json
11
+ return {
12
+ descripcion: "", # required
13
+ titulo: "", # required
14
+ referencia: "", # optional
15
+ tipoTrabajoId: 0,
16
+ denominacion: {
17
+ # you can use an id
18
+ id: 0
19
+ # or create a new one
20
+ #nombre: "",
21
+ #logo: ""
22
+ },
23
+ preguntas: [ # optional
24
+ {
25
+ simple: {
26
+ texto: "" # required
27
+ }
28
+ }
29
+ ],
30
+ postulantesDiscapacitados: false, #optional
31
+ lugarTrabajo: {
32
+ #id: 0, # TODO: found in the developers site but not found in the documentation
33
+ paisId: 0,
34
+ zonaId: 0,
35
+ localidadId: 0,
36
+ direccion: "",
37
+ mostrarDireccionEnAviso: false
38
+ },
39
+ recepcionCandidato: {
40
+ electronica: {
41
+ email: "" # required
42
+ }
43
+ },
44
+ areaId: 0,
45
+ subAreaId: 0,
46
+ requisitos: { # optional
47
+ experiencia: {
48
+ minimo: 0,
49
+ excluyente: false
50
+ },
51
+ edad: {
52
+ edadMinima: 0,
53
+ edadMaxima: 0,
54
+ excluyente: false
55
+ },
56
+ educacion: {
57
+ estadoEstudioId: 0,
58
+ tipoEstudioId: 0,
59
+ excluyente: false
60
+ },
61
+ idiomas: [
62
+ {
63
+ nivelId: 0,
64
+ idiomaId: 0,
65
+ excluyente: false
66
+ }
67
+ ],
68
+ residencia: {
69
+ cercania: "",
70
+ cantidadKm: 0,
71
+ excluyente: false
72
+ },
73
+ salario: {
74
+ tipo: "",
75
+ salarioMinimo: 0,
76
+ salarioMaximo: 0,
77
+ frecuenciaPagoId: 0,
78
+ mostrarAviso: false,
79
+ solicitarCandidato: false,
80
+ excluyente: false
81
+ },
82
+ genero: {
83
+ nombre: "",
84
+ excluyente: false
85
+ }
86
+ }
87
+ }
88
+ end
89
+
90
+ end
91
+ end
@@ -1,3 +1,3 @@
1
1
  module Bumeran
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,7 @@
1
+ Bumeran.setup do |config|
2
+ config.grant_type = "password" # Default value
3
+ config.client_id = ""
4
+ config.username = ""
5
+ config.email = ""
6
+ config.password = ""
7
+ end
@@ -0,0 +1,69 @@
1
+ class BumeranFixture
2
+ def self.publication
3
+ publication = Bumeran::Publication.new
4
+ publication.body[:descripcion] = "Descripcion de la publicacion de prueba" # required
5
+ publication.body[:titulo] = "Publicacion de prueba" # required
6
+ #publication.body[:referencia] = "" #optional
7
+
8
+ # We can use an id for denominacion
9
+ publication.body[:denominacion][:id] = 0 # required
10
+ # or we can create a new one
11
+ #publication.body[:denominacion][:nombre] = ""
12
+ #publication.body[:denominacion][:logo] = ""
13
+
14
+ #publication.body[:preguntas] # optional
15
+ publication.body[:preguntas][0][:simple][:texto] = "Pregunta de prueba" # optional
16
+ publication.body[:preguntas] << {choice: {texto: "Pregunta de alternativas", indiceCorrecta: 2, opciones: [{opcion: "respuesta 1"}, {opcion: "respuesta 2"}, {opcion: "respuesta 3"}, {opcion: "respuesta 4"}]}} # optional
17
+
18
+ #publication.body["postulantesDiscapacitados"] false, #optional
19
+
20
+ #publication.body["lugarTrabajo"]
21
+ #publication.body[:lugarTrabajo][:id] = 0 # TODO: found in the developers site but not in the documentation
22
+ publication.body[:lugarTrabajo][:paisId] = 1 # required
23
+ publication.body[:lugarTrabajo][:zonaId] = 18 # required
24
+ publication.body[:lugarTrabajo][:localidadId] = 6050 # required
25
+ publication.body[:lugarTrabajo][:direccion] = "San Martin 256" # required
26
+ publication.body[:lugarTrabajo][:mostrarDireccionEnAviso] = false # required
27
+
28
+ publication.body[:recepcionCandidato][:electronica][:email] = "test@domain.com" # required
29
+ # recepcionCandidato can aslo be with dias, rangoHorario and direccion
30
+ publication.body[:areaId] = 19 # required
31
+ publication.body[:subAreaId] = 26 # required
32
+ ####publication.body[:requisitos] # optional
33
+ ###publication.body[:requisitos][:experiencia]
34
+ publication.body[:requisitos][:experiencia][:minimo] = 60 # required
35
+ publication.body[:requisitos][:experiencia][:excluyente] = false # required
36
+ ###publication.body[:requisitos][:edad]
37
+ publication.body[:requisitos][:edad][:edadMinima] = 18 # required
38
+ publication.body[:requisitos][:edad][:edadMaxima] = 40 # required
39
+ publication.body[:requisitos][:edad][:excluyente] = false # required
40
+ ###publication.body["requisitos"]["educacion"]
41
+ publication.body[:requisitos][:educacion][:estadoEstudioId] = 2 # required
42
+ publication.body[:requisitos][:educacion][:tipoEstudioId] = 3 # required
43
+ publication.body[:requisitos][:educacion][:excluyente] = false # required
44
+ ###publication.body["requisitos"]["idiomas"]
45
+ publication.body[:requisitos][:idiomas][0][:nivelId] = 10 # required
46
+ publication.body[:requisitos][:idiomas][0][:idiomaId] = 1 # required
47
+ publication.body[:requisitos][:idiomas][0][:excluyente] = false # required
48
+ ###publication.body["requisitos"]["residencia"]
49
+ publication.body[:requisitos][:residencia][:cercania] = "provincia" # required
50
+ #publication.body[:requisitos][:residencia][:cantidadKm] = 0 # optional
51
+ publication.body[:requisitos][:residencia][:excluyente] = false # required
52
+ ###publication.body["requisitos"]["salario"]
53
+ publication.body[:requisitos][:salario][:tipo] = "bruto" # required
54
+ publication.body[:requisitos][:salario][:salarioMinimo] = 200000 # required
55
+ publication.body[:requisitos][:salario][:salarioMaximo] = 1000000 # required
56
+ publication.body[:requisitos][:salario][:frecuenciaPagoId] = 4 # required
57
+ publication.body[:requisitos][:salario][:mostrarAviso] = true # required
58
+ publication.body[:requisitos][:salario][:solicitarCandidato] = true # required
59
+ publication.body[:requisitos][:salario][:excluyente] = false # optional
60
+ ###publication.body[:requisitos][:genero]
61
+ publication.body[:requisitos][:genero][:nombre] = "masculino" # required
62
+ publication.body[:requisitos][:genero][:excluyente] = false # required
63
+ publication.body[:tipoTrabajoId] = 4 # required
64
+
65
+ return publication
66
+
67
+ # publish(publication.body.to_publication.body)
68
+ end
69
+ end
@@ -0,0 +1,144 @@
1
+ require 'spec_helper'
2
+
3
+ describe Bumeran do
4
+ it 'is a sanity test' do
5
+ end
6
+
7
+ it 'has a valid model' do
8
+ Bumeran.has_valid_access_token?.should be_true
9
+ end
10
+
11
+ it 'can publish', publish: true do
12
+ publication = BumeranFixture.publication
13
+ result = Bumeran.publish(publication.body.to_json)
14
+ pp result
15
+ result.to_i.should > 0
16
+ end
17
+
18
+ it 'can get publication', publish: true do
19
+ publication = BumeranFixture.publication
20
+ publication_id = Bumeran.publish(publication.body.to_json)
21
+ pp publication_id
22
+ #binding.pry
23
+
24
+ publication_id.should > 0
25
+ publication = Bumeran.get_publication(publication_id)
26
+ #binding.pry
27
+ pp publication
28
+ end
29
+
30
+ it 'can get areas', getters: true do
31
+ pp Bumeran.areas
32
+ Bumeran.areas.count.should > 0
33
+ end
34
+
35
+ it 'can get subareas', getters: true do
36
+ pp Bumeran.subareas
37
+ Bumeran.subareas.count.should > 0
38
+ end
39
+
40
+ it 'can get frecuencias_pago', getters: true do
41
+ pp Bumeran.frecuencias_pago
42
+ Bumeran.frecuencias_pago.count.should > 0
43
+ end
44
+
45
+ it 'can get paises, zonas, localidades, and plan plublicaciones', getters: true do
46
+ pp Bumeran.paises
47
+ Bumeran.paises.count.should > 0
48
+ Bumeran.zonas.count.should > 0
49
+ Bumeran.localidades.count.should > 0
50
+ Bumeran.plan_publicaciones.count.should > 0
51
+ end
52
+
53
+ it 'can get denominaciones', getters: true do
54
+ pp Bumeran.denominaciones
55
+ Bumeran.denominaciones.count.should > 0
56
+ end
57
+
58
+ it 'can get direcciones', getters: true do
59
+ pp Bumeran.direcciones
60
+ Bumeran.direcciones.count.should > 0
61
+ end
62
+
63
+ it 'can get frecuencias_pago', getters: true do
64
+ pp Bumeran.frecuencias_pago
65
+ Bumeran.frecuencias_pago.count.should > 0
66
+ end
67
+
68
+ it 'can get idiomas', getters: true do
69
+ pp Bumeran.idiomas
70
+ Bumeran.idiomas.count.should > 0
71
+ end
72
+
73
+ it 'can get industrias', getters: true do
74
+ pp Bumeran.industrias
75
+ Bumeran.industrias.count.should > 0
76
+ end
77
+
78
+ it 'can get niveles_idiomas', getters: true do
79
+ pp Bumeran.niveles_idiomas
80
+ Bumeran.niveles_idiomas.count.should > 0
81
+ end
82
+
83
+ it 'can get tipos_trabajo', getters: true do
84
+ pp Bumeran.tipos_trabajo
85
+ Bumeran.tipos_trabajo.count.should > 0
86
+ end
87
+
88
+ it 'can get areas_estudio', getters: true do
89
+ pp Bumeran.areas_estudio
90
+ Bumeran.areas_estudio.count.should > 0
91
+ end
92
+
93
+ it 'can get estados_estudio', getters: true do
94
+ pp Bumeran.estados_estudio
95
+ Bumeran.estados_estudio.count.should > 0
96
+ end
97
+
98
+ it 'can get tipos_estudio', getters: true do
99
+ pp Bumeran.tipos_estudio
100
+ Bumeran.tipos_estudio.count.should > 0
101
+ end
102
+
103
+ it 'can get tipos_estudio', getters: true do
104
+ pp Bumeran.tipos_estudio
105
+ Bumeran.tipos_estudio.count.should > 0
106
+ end
107
+
108
+ it 'can get estudio', getters: true do
109
+ estudio = Bumeran.get_estudio(1285190)
110
+ pp estudio
111
+ estudio["titulo"].class.should be String
112
+ end
113
+
114
+ it 'can get conocimiento', getters: true do
115
+ conocimiento = Bumeran.get_conocimiento(140)
116
+ pp conocimiento
117
+ conocimiento["nombre"].class.should be String
118
+ end
119
+
120
+ it 'can get conocimiento_custom', getters: true do
121
+ conocimiento_custom = Bumeran.get_conocimiento_custom(623710)
122
+ pp conocimiento_custom
123
+ conocimiento_custom["nombre"].class.should be String
124
+ end
125
+
126
+ it 'can get experiencia_laboral', getters: true do
127
+ experiencia_laboral = Bumeran.get_experiencia_laboral(1651500)
128
+ pp experiencia_laboral
129
+ experiencia_laboral["puesto"].class.should be String
130
+ end
131
+
132
+ it 'can get postulacion', getters: true do
133
+ postulacion = Bumeran.get_postulacion(1000)
134
+ pp postulacion
135
+ postulacion["estado"].class.should be String
136
+ end
137
+
138
+ it 'can get curriculum', getters: true do
139
+ curriculum = Bumeran.get_curriculum(1000)
140
+ pp curriculum
141
+ curriculum["nombre"].class.should be String
142
+ end
143
+
144
+ end
@@ -0,0 +1,29 @@
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
+ #
7
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
8
+ RSpec.configure do |config|
9
+ config.treat_symbols_as_metadata_keys_with_true_values = true
10
+ config.run_all_when_everything_filtered = true
11
+ config.filter_run :focus
12
+
13
+ Dir["./spec/fixtures/*.rb"].sort.each { |f| require f }
14
+
15
+ # Run specs in random order to surface order dependencies. If you find an
16
+ # order dependency and want to debug it, you can fix the order by providing
17
+ # the seed, which is printed after each run.
18
+ # --seed 1234
19
+ config.order = 'random'
20
+ end
21
+
22
+ require 'bumeran'
23
+ require 'bumeran/publication'
24
+ begin
25
+ require 'bumeran_initializer_helper'
26
+ rescue Exception => e
27
+ raise "bumeran_initializer_helper does't exist, follow the instructions in the README"
28
+ end
29
+ require 'pry-byebug'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumeran
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Fernandez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-18 00:00:00.000000000 Z
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,6 +38,48 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.13.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry-byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  description: 'A gem to access the Bumeran api: https://developers.bumeran.com'
42
84
  email:
43
85
  - chaotiklv@gmail.com
@@ -45,47 +87,23 @@ executables: []
45
87
  extensions: []
46
88
  extra_rdoc_files: []
47
89
  files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - LICENSE
48
95
  - MIT-LICENSE
96
+ - README.md
49
97
  - Rakefile
98
+ - bumeran.gemspec
50
99
  - lib/bumeran.rb
100
+ - lib/bumeran/publication.rb
51
101
  - lib/bumeran/version.rb
52
102
  - lib/tasks/bumeran_tasks.rake
53
- - test/bumeran_test.rb
54
- - test/dummy/README.rdoc
55
- - test/dummy/Rakefile
56
- - test/dummy/app/assets/javascripts/application.js
57
- - test/dummy/app/assets/stylesheets/application.css
58
- - test/dummy/app/controllers/application_controller.rb
59
- - test/dummy/app/helpers/application_helper.rb
60
- - test/dummy/app/views/layouts/application.html.erb
61
- - test/dummy/bin/bundle
62
- - test/dummy/bin/rails
63
- - test/dummy/bin/rake
64
- - test/dummy/bin/setup
65
- - test/dummy/config.ru
66
- - test/dummy/config/application.rb
67
- - test/dummy/config/boot.rb
68
- - test/dummy/config/database.yml
69
- - test/dummy/config/environment.rb
70
- - test/dummy/config/environments/development.rb
71
- - test/dummy/config/environments/production.rb
72
- - test/dummy/config/environments/test.rb
73
- - test/dummy/config/initializers/assets.rb
74
- - test/dummy/config/initializers/backtrace_silencers.rb
75
- - test/dummy/config/initializers/cookies_serializer.rb
76
- - test/dummy/config/initializers/filter_parameter_logging.rb
77
- - test/dummy/config/initializers/inflections.rb
78
- - test/dummy/config/initializers/mime_types.rb
79
- - test/dummy/config/initializers/session_store.rb
80
- - test/dummy/config/initializers/wrap_parameters.rb
81
- - test/dummy/config/locales/en.yml
82
- - test/dummy/config/routes.rb
83
- - test/dummy/config/secrets.yml
84
- - test/dummy/public/404.html
85
- - test/dummy/public/422.html
86
- - test/dummy/public/500.html
87
- - test/dummy/public/favicon.ico
88
- - test/test_helper.rb
103
+ - spec/bumeran_initializer_helper_example.rb
104
+ - spec/fixtures/bumeran_fixture.rb
105
+ - spec/lib/bumeran_spec.rb
106
+ - spec/spec_helper.rb
89
107
  homepage: https://github.com/rfernand/bumeran
90
108
  licenses:
91
109
  - MIT
@@ -111,39 +129,7 @@ signing_key:
111
129
  specification_version: 4
112
130
  summary: A gem to access the Bumeran api
113
131
  test_files:
114
- - test/dummy/app/views/layouts/application.html.erb
115
- - test/dummy/app/helpers/application_helper.rb
116
- - test/dummy/app/controllers/application_controller.rb
117
- - test/dummy/app/assets/stylesheets/application.css
118
- - test/dummy/app/assets/javascripts/application.js
119
- - test/dummy/config/database.yml
120
- - test/dummy/config/locales/en.yml
121
- - test/dummy/config/environment.rb
122
- - test/dummy/config/initializers/backtrace_silencers.rb
123
- - test/dummy/config/initializers/session_store.rb
124
- - test/dummy/config/initializers/inflections.rb
125
- - test/dummy/config/initializers/wrap_parameters.rb
126
- - test/dummy/config/initializers/filter_parameter_logging.rb
127
- - test/dummy/config/initializers/cookies_serializer.rb
128
- - test/dummy/config/initializers/mime_types.rb
129
- - test/dummy/config/initializers/assets.rb
130
- - test/dummy/config/routes.rb
131
- - test/dummy/config/environments/test.rb
132
- - test/dummy/config/environments/production.rb
133
- - test/dummy/config/environments/development.rb
134
- - test/dummy/config/secrets.yml
135
- - test/dummy/config/application.rb
136
- - test/dummy/config/boot.rb
137
- - test/dummy/public/422.html
138
- - test/dummy/public/favicon.ico
139
- - test/dummy/public/500.html
140
- - test/dummy/public/404.html
141
- - test/dummy/bin/bundle
142
- - test/dummy/bin/setup
143
- - test/dummy/bin/rake
144
- - test/dummy/bin/rails
145
- - test/dummy/README.rdoc
146
- - test/dummy/Rakefile
147
- - test/dummy/config.ru
148
- - test/test_helper.rb
149
- - test/bumeran_test.rb
132
+ - spec/bumeran_initializer_helper_example.rb
133
+ - spec/fixtures/bumeran_fixture.rb
134
+ - spec/lib/bumeran_spec.rb
135
+ - spec/spec_helper.rb