zip_recruiter 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -47,14 +47,14 @@ module ZipRecruiter
47
47
  end
48
48
 
49
49
  ##
50
- # A Subscribe action is used to upload a collection of job seekers to subscribe to our job alerts program.
50
+ # A Subscribe action is used to upload a collection of job seekers to subscribe to the job alerts program.
51
51
  #
52
52
  def self.subscribe(path)
53
53
  ZipRecruiter::JobAlerts::API.perform_action :subscribe, path
54
54
  end
55
55
 
56
56
  ##
57
- # An Unsubscribe action is used to upload a collection of job seekers to unsubscribe from our job alerts program.
57
+ # An Unsubscribe action is used to upload a collection of job seekers to unsubscribe from the job alerts program.
58
58
  #
59
59
  def self.unsubscribe(path)
60
60
  ZipRecruiter::JobAlerts::API.perform_action :unsubscribe, path
@@ -1,3 +1,4 @@
1
+ require 'json'
1
2
  require 'thor'
2
3
  require 'thor/group'
3
4
  require 'zip_recruiter/api'
@@ -6,13 +7,20 @@ require 'zip_recruiter/job_alerts/api'
6
7
  module ZipRecruiter
7
8
  module JobAlerts
8
9
  class CLI < Thor
10
+ # Hack to override the help message produced by Thor.
11
+ # https://github.com/wycats/thor/issues/261#issuecomment-16880836
12
+ def self.banner(command, namespace = nil, subcommand = nil)
13
+ "#{basename} jobalerts #{command.usage}"
14
+ end
15
+
9
16
  class_option :api_key, :aliases => "-k", :desc => "Specify your ZipRecruiter Job Alerts API key."
10
17
 
11
18
  desc "subscribe [PATH]", "A Subscribe action is used to upload a collection of job seekers to subscribe to the ZipRecruiter job alerts program."
12
19
  def subscribe(path)
13
20
  ZipRecruiter::API.api_key = options[:api_key] unless options[:api_key].nil?
14
21
  if File.exists?(path)
15
- p ZipRecruiter::JobAlerts::API.subscribe(path)
22
+ response = ZipRecruiter::JobAlerts::API.subscribe(path)
23
+ puts JSON.pretty_generate(JSON.parse(response)) unless response.nil?
16
24
  else
17
25
  puts "File \"#{path}\" does not exist."
18
26
  end
@@ -22,7 +30,8 @@ module ZipRecruiter
22
30
  def unsubscribe(path)
23
31
  ZipRecruiter::API.api_key = options[:api_key] unless options[:api_key].nil?
24
32
  if File.exists?(path)
25
- p ZipRecruiter::JobAlerts::API.unsubscribe(path)
33
+ response = ZipRecruiter::JobAlerts::API.unsubscribe(path)
34
+ puts JSON.pretty_generate(JSON.parse(response)) unless response.nil?
26
35
  else
27
36
  puts "File \"#{path}\" does not exist."
28
37
  end
@@ -31,7 +40,8 @@ module ZipRecruiter
31
40
  desc "status [TASK_ID]", "A Status action returns the current status of a previously-submitted request."
32
41
  def status(task_id)
33
42
  ZipRecruiter::API.api_key = options[:api_key] unless options[:api_key].nil?
34
- p ZipRecruiter::JobAlerts::API.status(task_id)
43
+ response = ZipRecruiter::JobAlerts::API.status(task_id)
44
+ puts JSON.pretty_generate(JSON.parse(response)) unless response.nil?
35
45
  end
36
46
  end
37
47
  end
@@ -1,3 +1,3 @@
1
1
  module ZipRecruiter
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.version = ZipRecruiter::VERSION
9
9
  gem.authors = ["Adam Dunson"]
10
10
  gem.email = ["adam@cloudspace.com"]
11
- gem.description = %q{Provides a ruby interface to the ZipRecruiter Job Alerts API.}
11
+ gem.description = %q{Provides a CLI and ruby interface to the ZipRecruiter Job Alerts API.}
12
12
  gem.summary = %q{Ruby ZipRecruiter Job Alerts API interface}
13
13
  gem.homepage = "https://github.com/adamdunson/zip_recruiter/"
14
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zip_recruiter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2013-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- description: Provides a ruby interface to the ZipRecruiter Job Alerts API.
62
+ description: Provides a CLI and ruby interface to the ZipRecruiter Job Alerts API.
63
63
  email:
64
64
  - adam@cloudspace.com
65
65
  executables:
@@ -70,7 +70,7 @@ files:
70
70
  - .gitignore
71
71
  - .rspec
72
72
  - Gemfile
73
- - LICENSE.txt
73
+ - LICENSE
74
74
  - README.md
75
75
  - Rakefile
76
76
  - bin/ziprecruiter
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 1.8.24
108
+ rubygems_version: 1.8.25
109
109
  signing_key:
110
110
  specification_version: 3
111
111
  summary: Ruby ZipRecruiter Job Alerts API interface