sourcing 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3785a9f0fd6214f4a3535e032ea04cd36ac60607
4
- data.tar.gz: d202f812e8eb2c0da9f5b84a3dceeec622fa2d31
3
+ metadata.gz: 63dde80d8e0efe1ae59afd55cd44a227bf96894b
4
+ data.tar.gz: 7dce3f42abd8575770d36287b4ec2c38ee841022
5
5
  SHA512:
6
- metadata.gz: 42e561305dbf629536da40286094f73a5bdcdc91226628b632ea688c82a2a66918829e7fadc171061f0b74c63f44f14a0cd2b18776b95a7f86f520862516161e
7
- data.tar.gz: e556988f7875abcc8f6466ebf3d38a41848e66887d8c18e68aebad9889ec147100186b31223fa726aabd1a9b5c22c9d245bd6a6467cff7e428a28f993f6a1fd0
6
+ metadata.gz: 92e230371b1bdec85547b5506c524250a2eb21b342a75ba465f2191bbfe6e9db95cea1a4027bfd2046ac5b0eb454f4831f5c093066c4e8131ee3a41b1effe596
7
+ data.tar.gz: 76adfa01d547b74d890e6c06ddcd99b0f527c89120da6dfc50f57a16676c735055e5624765f0287073f210a3989259bd745e47a13b19f151779394d7b1c7cb8a
data/README.md CHANGED
@@ -26,6 +26,22 @@ Then you can lookup people by email address:
26
26
 
27
27
  person = Sourcing::Person[email: 'info@eribium.org']
28
28
 
29
- pp person if person
29
+ If the person can't be found, then `nil` will be returned.
30
30
 
31
- If the person can't be found, then `nil` will be returned.
31
+ You can also look people up by GitHub and Twitter handle:
32
+
33
+ person = Sourcing::Person[github: 'maccman']
34
+ person = Sourcing::Person[twitter: 'maccaw']
35
+
36
+ ## CLI
37
+
38
+ The gem also includes a `sourcing` executable, which you can use like this:
39
+
40
+ $ sourcing --twitter DanielZarick
41
+
42
+ {
43
+ "id" => "7baccc21-36a7-436c-8d55-e3d15b61dbdf",
44
+ "name" => "Daniel Zarick",
45
+ "headline" => "Developer at 33cc77",
46
+ "url" => "http://danielzarick.com",
47
+ ...
@@ -37,8 +37,8 @@ end
37
37
 
38
38
  parser.parse!
39
39
 
40
- if email = ARGV[0]
41
- values[:email] ||= email
40
+ if id = ARGV[0]
41
+ values[:id] ||= id
42
42
  end
43
43
 
44
44
  if key = ENV['SOURCING_KEY']
@@ -15,7 +15,10 @@ module Sourcing
15
15
 
16
16
  class Base < Nestful::Resource
17
17
  endpoint 'https://api.sourcing.io'
18
+ options :format => :json
18
19
  end
19
20
 
21
+ autoload :Account, 'sourcing/account'
20
22
  autoload :Person, 'sourcing/person'
23
+ autoload :User, 'sourcing/user'
21
24
  end
@@ -0,0 +1,9 @@
1
+ module Sourcing
2
+ class Account < Base
3
+ path '/v1/account'
4
+
5
+ def self.current
6
+ self.new(get)
7
+ end
8
+ end
9
+ end
@@ -10,13 +10,6 @@ module Sourcing
10
10
  options = options.dup
11
11
  params = options.delete(:params) || {}
12
12
 
13
- if key = options.delete(:api_key)
14
- options.merge!(
15
- auth_type: :bearer,
16
- password: key
17
- )
18
- end
19
-
20
13
  if email = values[:email]
21
14
  self.new(get(uri(:email, email), params, options))
22
15
 
@@ -36,8 +29,32 @@ module Sourcing
36
29
  rescue Nestful::ResourceNotFound
37
30
  end
38
31
 
32
+ def self.search(filters, params = {})
33
+ post :search, params.merge(filters: filters)
34
+ end
35
+
39
36
  class << self
40
37
  alias_method :[], :find
41
38
  end
39
+
40
+ def tweets
41
+ get :tweets
42
+ end
43
+
44
+ def notes
45
+ get :notes
46
+ end
47
+
48
+ def create_note!(body)
49
+ post :notes, body: body
50
+ end
51
+
52
+ def favorite!
53
+ post :favorite
54
+ end
55
+
56
+ def unfavorite!
57
+ delete :favorite
58
+ end
42
59
  end
43
60
  end
@@ -0,0 +1,9 @@
1
+ module Sourcing
2
+ class User < Base
3
+ path '/v1/user'
4
+
5
+ def self.current
6
+ self.new(get)
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Sourcing
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sourcing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-28 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,9 @@ files:
68
68
  - bin/sourcing
69
69
  - examples/email.rb
70
70
  - lib/sourcing.rb
71
+ - lib/sourcing/account.rb
71
72
  - lib/sourcing/person.rb
73
+ - lib/sourcing/user.rb
72
74
  - lib/sourcing/version.rb
73
75
  - sourcing.gemspec
74
76
  homepage: https://github.com/maccman/sourcing-ruby