appbaseio 0.0.1 → 0.0.2

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: d711e934d6c9c63c8577df2ac0f581aecf12443e
4
- data.tar.gz: 909612931ff35743e98c671715596626631721cc
3
+ metadata.gz: 8d6ce66665f56b8ee3f30b7ac29c3b8923e26eb5
4
+ data.tar.gz: bf67752d05ce65f5b7813c5eb2fac2a5720bba16
5
5
  SHA512:
6
- metadata.gz: 3434d9fa9a90903b6e41db7f91fd2220132ef71b847e1a13fc8320def8b54f4f265a8492937bc005816f079a8b7bbbaed404e8e4b70c172272bf7ffc8f43a97b
7
- data.tar.gz: 4b605530f2a255516da632b3cb865141a0460c7dea573e50d73d55e997d358fddf872412c5b2e58af45c1d15395fbf5715fcc397d7ddfc9798de117a34ca438c
6
+ metadata.gz: 16618936dcfe794fd82e1154811df965bf6f6af89198ec866b08138cc006ae52673277ff2507990fa3e09e07cac890ea4bf29dd7c66d5f86e959e79f28a48fd9
7
+ data.tar.gz: 73fb69a61133ca4ba1845d8b392b3606096c6e47f813b12887244f19632215ef4f7751a8090c9e2d4acf43fab1facdbe9a8e8975e0beedd77f355b0819903d8e
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Appbaseio
2
2
 
3
- TODO: Write a gem description
3
+ [![Build
4
+ Status](https://travis-ci.org/ruanwz/appbaseio.svg)](https://travis-ci.org/ruanwz/appbaseio)
5
+
6
+ AppBase.io Ruby Rest Client
4
7
 
5
8
  ## Installation
6
9
 
@@ -20,7 +23,20 @@ Or install it yourself as:
20
23
 
21
24
  ## Usage
22
25
 
23
- TODO: Write usage instructions here
26
+ Read /spec/appbaseio/client\_spec.rb
27
+
28
+ ```
29
+ require 'Appbaseio'
30
+ options = {
31
+ server_host: 'api.appbase.io',
32
+ app_name: 'testapp',
33
+ api_version: 'v2',
34
+ namespace: 'test_api',
35
+ app_secret: 'your secret'
36
+ }
37
+ client = Appbaseio::Client.new(options)
38
+ client.create_properties vertex: 'abc', data: {foo: 'bar'}
39
+ ```
24
40
 
25
41
  ## Contributing
26
42
 
@@ -15,7 +15,7 @@ module Appbaseio
15
15
  'delete' => :delete,
16
16
  'properties' => :patch
17
17
  }
18
- TARGETS = %w{list properties edges}
18
+ TARGETS = %w{list properties edges search}
19
19
  class Client
20
20
  include Virtus.model
21
21
  attribute :server_host, String, default: 'api.appbase.io'
@@ -56,6 +56,7 @@ module Appbaseio
56
56
  data = {data: options[:data]}
57
57
  data = {all: true} if operation == 'read' and target == 'properties'
58
58
  data = {filters: {}} if operation == 'read' and target == 'edges'
59
+ data = options[:data] if target == 'search'
59
60
 
60
61
  method = HTTP_METHOD_MAP[operation]
61
62
  if data
@@ -1,3 +1,3 @@
1
1
  module Appbaseio
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -35,6 +35,14 @@ describe Appbaseio::Client do
35
35
 
36
36
  end
37
37
 
38
+ it "search vertex" do
39
+ VCR.use_cassette('search vertex') do
40
+ subject.create_properties vertex: 'notebook', data: {foo: 'some joke'}
41
+ resp = subject.read_search data: {query: {text: 'some joke', properties: ["foo"]}}
42
+
43
+ expect(resp.status).to be 204
44
+ end
45
+ end
38
46
  it "create vertex" do
39
47
  VCR.use_cassette('create vertex') do
40
48
  resp = subject.create_properties vertex: 'abc', data: {foo: 'bar'}
@@ -95,4 +103,5 @@ describe Appbaseio::Client do
95
103
  expect(resp.status).to be 200
96
104
  end
97
105
  end
106
+
98
107
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appbaseio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ruan