jobby_job 0.0.1.alpha2 → 0.0.1.alpha3

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: 382a17c9f31f07c16b8b979776d944510ae3d4c2
4
- data.tar.gz: 2690539a4f9aaae225b0b3757ca11eba954aa565
3
+ metadata.gz: d8d3909139bc197d54d427d54dabd44696212265
4
+ data.tar.gz: 7964a61d10fe5dd0fd3a32d45c451b4a3bac30b2
5
5
  SHA512:
6
- metadata.gz: 285655fcfc3761414121d23e672ea0b35871fae898881efe44d11e669c48710e3c680a0ce77fd743bc13860651cd6616bf32c988b28da02bb467c25b2a3816d1
7
- data.tar.gz: 998e390490787aa123b60e037d8b8f3e13b602236e5d034add25687ff7ba949b793bade52118805687db39eecbf340b585d75fbe8b125270ab9a36a636ddbd27
6
+ metadata.gz: 42a88252f7e3f2aae8878a6c4b50c8f2c1a113cb3586faa406b5bc45abb0e63c45bb15f30dec120e62183ed4af3903d18dd0af6ef187ea6c26c8d2595fc2f536
7
+ data.tar.gz: 47e6f9c6c04b81a0fa7644e53185a2c76291b7d2227d5cdf084eb1139393df38de128444b9db6943db1225e05617d188a9862f632290d1e979651ca0b1bdb096
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ tags
data/README.md CHANGED
@@ -24,7 +24,7 @@ Just run the following in your terminal:
24
24
 
25
25
  ## Usage
26
26
 
27
- $ jobby_job ruby ios
27
+ $ jobbyjob ruby ios
28
28
 
29
29
  This will open up some job sites with ruby and ios in the search fields.
30
30
 
Binary file
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'jobby_job'
4
+
5
+ JobbyJob::Cli.new(ARGV).open
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
- spec.executables = ['jobby_job']
17
+ spec.executables = ['jobbyjob']
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
@@ -1,33 +1,3 @@
1
- require "jobby_job/version"
2
- require "jobby_job/sites"
3
-
4
- module JobbyJob
5
- class Cli
6
-
7
- attr_reader :input, :zipcode, :keywords
8
-
9
- def initialize(input)
10
- @input = input
11
- parse
12
- @dev_job_sites = JobbyJob::Sites.new(inputs)
13
- end
14
-
15
- def get
16
- @dev_job_sites.get
17
- end
18
-
19
- def parse
20
- @zipcode = input.select do |k|
21
- k if k.to_i > 0 && k.length == 5
22
- end.first
23
-
24
- input.delete(zipcode)
25
- @keywords = input
26
- end
27
-
28
- def inputs
29
- {keywords: keywords, zipcode: zipcode}
30
- end
31
- end
32
- end
33
-
1
+ require 'jobby_job/version'
2
+ require 'jobby_job/sites'
3
+ require 'jobby_job/cli'
@@ -0,0 +1,47 @@
1
+ module JobbyJob
2
+ class Cli
3
+
4
+ attr_reader :input, :zipcode, :keywords
5
+
6
+ def initialize(input)
7
+ @input = input
8
+ parse
9
+ @dev_job_sites = JobbyJob::Sites.new(inputs)
10
+ end
11
+
12
+ def open
13
+ @dev_job_sites.urls.each do |url|
14
+ p url
15
+ sleep 1.2
16
+ open_on_os(url)
17
+ end
18
+ end
19
+
20
+ def parse
21
+ @zipcode = input.select do |element|
22
+ element if element.to_i > 0 && element.length == 5
23
+ end.first
24
+
25
+ input.delete(zipcode)
26
+ @keywords = input
27
+ end
28
+
29
+ def inputs
30
+ { keywords: keywords, zipcode: zipcode }
31
+ end
32
+
33
+ def open_on_os(url)
34
+ if host_os =~ /mswin|mingw|cygwin/
35
+ system "start #{url}"
36
+ elsif host_os =~ /darwin/
37
+ system "open -a firefox #{url}"
38
+ elsif host_os =~ /linux|bsd/
39
+ system "xdg-open #{url}"
40
+ end
41
+ end
42
+
43
+ def host_os
44
+ RbConfig::CONFIG['host_os']
45
+ end
46
+ end
47
+ end
@@ -4,12 +4,13 @@ module JobbyJob
4
4
  attr_reader :input, :zipcode, :keywords
5
5
 
6
6
  def initialize(inputs)
7
- @keywords = inputs[:keywords].join('+') || ""
8
- @zipcode = inputs[:zipcode] || ""
7
+ @keywords = inputs[:keywords].join('+') || ''
8
+ @zipcode = inputs[:zipcode] || ''
9
9
  end
10
10
 
11
- def get
12
- [stackoverflow, github, ycombinator, thirtyseven_signals, indeed, we_work_remotely]
11
+ def urls
12
+ [stackoverflow, github, ycombinator, thirtyseven_signals,
13
+ indeed, we_work_remotely]
13
14
  end
14
15
 
15
16
  private
@@ -23,7 +24,7 @@ module JobbyJob
23
24
  end
24
25
 
25
26
  def ycombinator
26
- "http://news.ycombinator.com/jobs"
27
+ 'http://news.ycombinator.com/jobs'
27
28
  end
28
29
 
29
30
  def thirtyseven_signals
@@ -39,4 +40,3 @@ module JobbyJob
39
40
  end
40
41
  end
41
42
  end
42
-
@@ -1,3 +1,3 @@
1
1
  module JobbyJob
2
- VERSION = "0.0.1.alpha2"
2
+ VERSION = '0.0.1.alpha3'
3
3
  end
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobby_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha2
4
+ version: 0.0.1.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - AdamT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-05 00:00:00.000000000 Z
11
+ date: 2013-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,7 +42,7 @@ description: Search for jobs from the command-line
42
42
  email:
43
43
  - atal421@yahoo.com
44
44
  executables:
45
- - jobby_job
45
+ - jobbyjob
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
@@ -52,12 +52,17 @@ files:
52
52
  - README.md
53
53
  - Rakefile
54
54
  - bin/.jobby_job.un~
55
- - bin/jobby_job
55
+ - bin/jobbyjob
56
56
  - jobby_job.gemspec
57
57
  - lib/jobby_job.rb
58
58
  - lib/jobby_job/.version.rb.un~
59
+ - lib/jobby_job/cli.rb
59
60
  - lib/jobby_job/sites.rb
60
61
  - lib/jobby_job/version.rb
62
+ - test/lib/jobby_job/jobby_job_test.rb
63
+ - test/lib/jobby_job/sites_test.rb
64
+ - test/lib/jobby_job/version_test.rb
65
+ - test/test_helper.rb
61
66
  homepage: https://github.com/AdamT/JobbyJob
62
67
  licenses:
63
68
  - MIT
@@ -78,8 +83,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
83
  version: 1.3.1
79
84
  requirements: []
80
85
  rubyforge_project:
81
- rubygems_version: 2.0.3
86
+ rubygems_version: 2.1.3
82
87
  signing_key:
83
88
  specification_version: 4
84
89
  summary: JobbyJob opens a few job sites in Firefox with your search terms included.
85
- test_files: []
90
+ test_files:
91
+ - test/lib/jobby_job/jobby_job_test.rb
92
+ - test/lib/jobby_job/sites_test.rb
93
+ - test/lib/jobby_job/version_test.rb
94
+ - test/test_helper.rb
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- #require './lib/jobby_job'
4
- require 'jobby_job'
5
-
6
- cli = JobbyJob::Cli.new(ARGV)
7
- urls = cli.get
8
-
9
- urls.each do |url|
10
- p url
11
- sleep 1.2
12
- system("open -a firefox #{url.to_s}")
13
- end
14
-