srchio 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjRiM2Q0M2Q1MTRkNmM1MWVkM2M1MWQ4MDZjNjMzMWU3ZjI1MzIyNg==
5
- data.tar.gz: !binary |-
6
- MDk2MTRlMzJkNmVkZTU2ZTM1MDM5NTUyYWMxYzg0ZTg2M2FiMmRiMA==
2
+ SHA1:
3
+ metadata.gz: da16267cc0eeceb48080fa528e0afdd008b47793
4
+ data.tar.gz: fe323e96c2a7afe5e70648e227f36ecac20711b5
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmQ2MjY1MWQyODIxZjZhZmFjNjA1NTEwZjlkNjcxMjk4ODVkZDE3NzIzZTQ5
10
- MmY4M2VkMzA4YmQ4NmY1ZTU3MmM1NzA3N2ViMmY5MzAzM2NjZWI3OWQxNGUy
11
- ZmFkOGI4ZWUxMTg5OTIyMWRiYjFlOTk5ZWIxMGM2NTdlYWIwMDc=
12
- data.tar.gz: !binary |-
13
- ZDM4Mzk4ZWM2NjBkYjg2MDhkNTdjMjY3MWE5ZDUwZTJlZTNlMWU4YmNmMmJj
14
- NzY5NDU5OGY4NDIzNzhkYTJlOTMyMzIyYjhhMDYzMjE2ZmNhYjA1NjQyOGQ0
15
- NzE5YTRkYTM5N2IzNTIzZjQzZWIzOGZkM2U3YzE3YjY4MDQ2Y2U=
6
+ metadata.gz: dc18a73a340ba7376bd2837f0052a299160826a7f1ad0ecb36209855b6ce4b1866851f708b7bba051de8254571c4578d42a323ab44bc32f3fb2905ea5efcacb3
7
+ data.tar.gz: 829ef003935190ae6b84b09f335914636683e078ea95a05919b8156b94f725d24db1efe8960889a3e16e73491b6979ce0afc3a31784bb0a35a5ca556fd40956d
data/lib/srchio/client.rb CHANGED
@@ -4,7 +4,7 @@ module Srchio
4
4
 
5
5
  attr_accessor :searcher_id, :api_token, :api_domain, :api_protocol
6
6
 
7
- base_uri "https://srch.io/"
7
+ base_uri "https://api.srch.io/api/v1/"
8
8
 
9
9
  def self.api_protocol
10
10
  @@api_protocol ||= "https"
@@ -44,7 +44,7 @@ module Srchio
44
44
  end
45
45
 
46
46
  def self.update_base_uri
47
- base_uri "#{self.api_protocol}://#{self.api_domain}/"
47
+ base_uri "#{self.api_protocol}://#{self.api_domain}/api/v1/"
48
48
  true
49
49
  end
50
50
 
@@ -73,7 +73,7 @@ options:
73
73
  Sends a test request, making sure you're sending the api token correctly
74
74
  =end
75
75
  def test
76
- Srchio::Response.new(self.class.get("/api/test"))
76
+ Srchio::Response.new(self.class.get("/test"))
77
77
  end
78
78
 
79
79
  =begin rdoc
@@ -95,7 +95,9 @@ options:
95
95
  opts[:tags] = opts[:tags].join(",")
96
96
  end
97
97
 
98
- Srchio::Response.new(self.class.post("/api/searchers/#{searcher_id}/documents", :query => opts))
98
+ doc = opts.to_json
99
+
100
+ Srchio::Response.new(self.class.post("/searchers/#{searcher_id}/documents", :body => doc))
99
101
  end
100
102
 
101
103
  =begin rdoc
@@ -107,7 +109,7 @@ options: One of the following is required.
107
109
  def destroy_document(opts={})
108
110
  raise ArgumentError if opts[:remote_id].nil? && opts[:index_id].nil?
109
111
 
110
- Srchio::Response.new(self.class.delete("/api/searchers/#{searcher_id}/documents", :query => opts))
112
+ Srchio::Response.new(self.class.delete("/searchers/#{searcher_id}/documents", :query => opts))
111
113
  end
112
114
 
113
115
  =begin rdoc
@@ -131,7 +133,7 @@ options:
131
133
  opts[:tags] = opts[:tags].join(",")
132
134
  end
133
135
 
134
- Srchio::Response.new(self.class.get("/api/searchers/#{searcher_id}/search", :query => opts))
136
+ Srchio::Response.new(self.class.get("/searchers/#{searcher_id}/search", :query => opts))
135
137
  end
136
138
 
137
139
  =begin rdoc
@@ -140,7 +142,7 @@ options:
140
142
  * :n: The number of tags to return. Defaults to 1,000.
141
143
  =end
142
144
  def tag_cloud(opts={})
143
- Srchio::Response.new(self.class.get("/api/searchers/#{searcher_id}/tag_cloud", :query => opts))
145
+ Srchio::Response.new(self.class.get("/searchers/#{searcher_id}/tag_cloud", :query => opts))
144
146
  end
145
147
  end
146
148
  end
@@ -1,3 +1,3 @@
1
1
  module Srchio
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: srchio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Lawver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.12.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.12.0
27
27
  description: The official gem and wrapper for the srch.io API. More info @ http://srch.io
@@ -51,17 +51,17 @@ require_paths:
51
51
  - lib
52
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - '>='
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.9.3
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.1.9
64
+ rubygems_version: 2.2.2
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: The official gem for srch.io! Makes searching fun and easy.