firstjob 1.0.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8ee6ac850448f739ce39bfa359084b6e3659310
4
- data.tar.gz: 017fdb8ff9deeb4f2c7f31295933b8284bd8e5f4
3
+ metadata.gz: 5c3d4f275961fb7ffd3cda46804a1a3a285eed9f
4
+ data.tar.gz: bff0ef7963d29d6b531db692235776735922e677
5
5
  SHA512:
6
- metadata.gz: 09c25667ac35874884a7500c26278790bd8aa31a563226108f13f14f986ac146119a7590d78f77f77967a7c6d23df4b2365bd0c6827d998be3b4b56abdb5d117
7
- data.tar.gz: 12a5e11543fba6d91c5765b5446e1594de4a4b15fdb4e1c7bdd196ebcba82a59e84fdac7765a0ac4248a0ed95b08297dea5811c1ec98bee5719360fea2c047f9
6
+ metadata.gz: 71581fd9a34eaebe8e607f6a11081eb62b737832cd0e4e62dbe5d27aa805563e9bced081c5af6767acae491ff4d83437b3b40a6176369d79f77dcea0198850f4
7
+ data.tar.gz: 7e766a25b188ea937ecc4145c468838a08d28b343ae59b571a413398eec995acf0306b42d8aec5ab990696d4b9c376d92625e2d68e81a0ad53bfde9b68d51bf7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- firstjob (1.0.0)
4
+ firstjob (1.0.1)
5
5
  httparty (>= 0.13.3)
6
6
  rails (>= 3.2)
7
7
 
data/README.md CHANGED
@@ -30,17 +30,37 @@ end
30
30
 
31
31
 
32
32
  And more that don't need an ID. All return a json object, and raise an error (401, 404, 500) if there was one:
33
- ### Create and publish a new publication
33
+ ### Create and publish a publication
34
34
  ```ruby
35
35
  publication = Firstjob::Publication.new(title: "Publicacion de prueba", description: "Test", looking_for_id: 1, career_status_id: 1, excel_level_id: 2, english_level_id: 2, universities_ids: [1,2], careers_ids: [1, 6])
36
36
  publication.publish()
37
37
  ```
38
+ Returns Firstjob::Publication object with the publication.id and publication.slug issued by Firstjob.
38
39
 
39
40
  ### Get postulants of a publication
41
+ ```ruby
42
+ publication = Firstjob::Publication.new
43
+ publication.id = 800 # ID of an existing publication
44
+ publication.postulants
45
+ ```
46
+ Returns hash with postulants data. Example:
47
+ ```ruby
48
+ => [{"id"=>nil, "email"=>"postulant@gmail.com", "university_id"=>8,
49
+ "principal_career_id"=>1057, "career_status"=>3, "english_level"=>2,
50
+ "years_experience"=>1}, ...}]
51
+ ```
52
+ ### Unpublish a publication
53
+ ```ruby
54
+ publication = Firstjob::Publication.new
55
+ publication.id = 800 # ID of an existing publication
56
+ publication.destroy
57
+ ```
58
+ If succeded, returns the body of Firstjob response:
59
+ ```ruby
60
+ => "{\"mensaje\":\"Trabajo dado de baja\"}"
61
+ ```
40
62
 
41
- Work in progress...
42
-
43
- ### Development
63
+ ### Development & Testing
44
64
  You can start the gem in a standalone ruby console with:
45
65
  ```
46
66
  $ rake console
@@ -1,6 +1,6 @@
1
1
  module Firstjob
2
2
  class Career
3
- CAREERS = YAML.load_file("lib/data/careers.yaml")["careers"].symbolize_keys!
3
+ CAREERS = YAML.load_file(File.join(File.dirname(__FILE__),"../data/careers.yaml"))["careers"].symbolize_keys!
4
4
 
5
5
  # Poor's man all
6
6
  def self.all
@@ -1,6 +1,6 @@
1
1
  module Firstjob
2
2
  class CareerStatus
3
- CAREER_STATUSES = YAML.load_file("lib/data/career_statuses.yaml")["career_statuses"].symbolize_keys!
3
+ CAREER_STATUSES = YAML.load_file(File.join(File.dirname(__FILE__),"../data/career_statuses.yaml"))["career_statuses"].symbolize_keys!
4
4
 
5
5
  # Poor's man all
6
6
  def self.all
@@ -1,6 +1,6 @@
1
1
  module Firstjob
2
2
  class EnglishLevel
3
- ENGLISH_LEVELS = YAML.load_file("lib/data/english_levels.yaml")["english_levels"].symbolize_keys!
3
+ ENGLISH_LEVELS = YAML.load_file(File.join(File.dirname(__FILE__),"../data/english_levels.yaml"))["english_levels"].symbolize_keys!
4
4
 
5
5
  # Poor's man all
6
6
  def self.all
@@ -1,6 +1,6 @@
1
1
  module Firstjob
2
2
  class ExcelLevel
3
- EXCEL_LEVELS = YAML.load_file("lib/data/excel_levels.yaml")["excel_levels"].symbolize_keys!
3
+ EXCEL_LEVELS = YAML.load_file(File.join(File.dirname(__FILE__),"../data/excel_levels.yaml"))["excel_levels"].symbolize_keys!
4
4
 
5
5
  # Poor's man all
6
6
  def self.all
@@ -1,6 +1,6 @@
1
1
  module Firstjob
2
2
  class LookingFor
3
- LOOKING_FORS = YAML.load_file("lib/data/looking_fors.yaml")["looking_fors"].symbolize_keys!
3
+ LOOKING_FORS = YAML.load_file(File.join(File.dirname(__FILE__),"../data/looking_fors.yaml"))["looking_fors"].symbolize_keys!
4
4
 
5
5
  # Poor's man all
6
6
  def self.all
@@ -1,6 +1,6 @@
1
1
  module Firstjob
2
2
  class University
3
- UNIVERSITIES = YAML.load_file("lib/data/universities.yaml")["universities"].symbolize_keys!
3
+ UNIVERSITIES = YAML.load_file(File.join(File.dirname(__FILE__),"../data/universities.yaml"))["universities"].symbolize_keys!
4
4
 
5
5
  # Poor's man all
6
6
  def self.all
@@ -1,3 +1,3 @@
1
1
  module Firstjob
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firstjob
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Fernandez