triannon-client 0.0.0 → 0.1.0

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: 6311cba677a659f924697ca9eea30c52455b4583
4
- data.tar.gz: 57c001638b992be5f97d526bda85ddaea20b79c6
3
+ metadata.gz: 07b7dcae42e6b63eced37e16ee442d2db563eaa0
4
+ data.tar.gz: 0e24d31959302b0722a1f72e735a0d3b06902814
5
5
  SHA512:
6
- metadata.gz: cf40229f17bde5ca917b659325540c04cb09ce72da0a80b88c200720833d857291446cd0ab44305963e671d53b9aea45d873cec3f76f54b8c051798a1a96c844
7
- data.tar.gz: a7c2edbc95b69ca045df19336ef62a7e30c1ff3a6fd4a6a0961c708300143380591ad878c83561c97bd9975ba0d122bcf32e793ad840177529aa1ec6f5d740f4
6
+ metadata.gz: d0423905c2873604f3fc43a18c93b57f998065b0720f7f02fc215af31b7ffcdfd7cfa6617d99bd4d77b12ac1a383a3880b502b63966a081ee7ff55a275a57dad
7
+ data.tar.gz: df43ac27b95f8427ff9d21083235a219687a19affd3c9ab99081ec559f6dddb41e9a9e2a1c52bb75beeb15236125649b7891e7e68b3628b2ebc2a6842cedbf25
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- triannon-client (0.0.0)
4
+ triannon-client (0.1.0)
5
5
  dotenv
6
6
  linkeddata (~> 1.0)
7
7
  pry
8
8
  pry-doc
9
- rest-client (~> 1.0)
9
+ rest-client (~> 1.7)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
@@ -74,8 +74,8 @@ GEM
74
74
  rdf-turtle (~> 1.1, >= 1.1.5)
75
75
  sparql (~> 1.1, >= 1.1.4)
76
76
  sparql-client (~> 1.1, >= 1.1.3)
77
- listen (2.9.0)
78
- celluloid (>= 0.15.2)
77
+ listen (2.10.0)
78
+ celluloid (~> 0.16.0)
79
79
  rb-fsevent (>= 0.9.3)
80
80
  rb-inotify (>= 0.9)
81
81
  lumberjack (1.0.9)
data/bin/console ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'triannon-client'
3
+ CONFIG = TriannonClient.configuration
4
+ binding.pry
5
+
data/bin/setup.sh ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ rm -f .binstubs/*
6
+ bundle install --binstubs .binstubs
7
+ bundle package --all --quiet
8
+
9
+ # see commentary on this practice at
10
+ # http://blog.howareyou.com/post/66375371138/ruby-apps-best-practices
data/bin/test.sh ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ if [ -s .env ]; then
6
+ mv .env .env_bak
7
+ fi
8
+
9
+ cp .env_example .env
10
+ .binstubs/rspec
11
+ #.binstubs/cucumber --strict
12
+
13
+ if [ -s .env_bak ]; then
14
+ mv .env_bak .env
15
+ fi
16
+
@@ -1,15 +1,12 @@
1
1
  require 'dotenv'
2
2
  Dotenv.load
3
-
4
3
  require 'pry'
5
4
  require 'pry-doc'
6
-
7
5
  # require rest client prior to linkeddata, so the latter can use it.
8
6
  require 'rest-client'
9
- require 'linkeddata'
10
7
  RestClient.proxy = ENV['http_proxy'] unless ENV['http_proxy'].nil?
11
8
  RestClient.proxy = ENV['HTTP_PROXY'] unless ENV['HTTP_PROXY'].nil?
12
-
9
+ require 'linkeddata'
13
10
  require_relative 'triannon-client/configuration'
14
11
  require_relative 'triannon-client/triannon-client'
15
12
 
@@ -19,6 +19,15 @@ module TriannonClient
19
19
  )
20
20
  end
21
21
 
22
+ # Delete an annotation
23
+ # @param iri [String] HTTP URL for a triannon annotation
24
+ # @response [true|false] true when successful
25
+ def delete_annotation(iri)
26
+ uri = RDF::URI.parse(iri)
27
+ response = @site[uri.path].delete
28
+ [200, 202, 204].include? response.code
29
+ end
30
+
22
31
  # @param oa [JSON-LD] a json-ld object with an open annotation context
23
32
  # @return response [RestClient::Response|nil]
24
33
  def post_annotation(oa)
@@ -4,6 +4,12 @@ require 'spec_helper'
4
4
 
5
5
  describe TriannonClient do
6
6
 
7
+ describe "#delete_annotation" do
8
+ it 'should DELETE an open annotation' do
9
+ #TODO
10
+ end
11
+ end
12
+
7
13
  describe "#get_annotations" do
8
14
  it 'should get a list of open annotations' do
9
15
  #TODO
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'triannon-client'
5
- s.version = '0.0.0'
5
+ s.version = '0.1.0'
6
6
  s.licenses = ['Apache-2.0']
7
7
  s.platform = Gem::Platform::RUBY
8
8
 
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  # Use ENV for config
21
21
  s.add_dependency 'dotenv'
22
22
  # HTTP and RDF clients
23
- s.add_dependency 'rest-client', '~> 1.0'
23
+ s.add_dependency 'rest-client', '~> 1.7'
24
24
  s.add_dependency 'linkeddata', '~> 1.0'
25
25
  # Use pry for console and debugging
26
26
  s.add_dependency 'pry'
@@ -33,11 +33,11 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency 'rspec'
34
34
 
35
35
  s.files = `git ls-files`.split($/)
36
- dev_files = %w(.gitignore bin/console bin/setup.sh bin/test.sh)
37
- dev_files.each {|f| s.files.delete f }
38
-
39
36
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
40
37
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
41
38
 
39
+ dev_files = %w(.gitignore bin/console bin/ctags.rb bin/setup.sh bin/test.sh)
40
+ dev_files.each {|f| s.files.delete f; s.executables.delete f; }
41
+
42
42
  end
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triannon-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Weber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-25 00:00:00.000000000 Z
11
+ date: 2015-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '1.7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: linkeddata
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +154,10 @@ description: A client for RESTful transactions with a triannon annotation server
154
154
  email:
155
155
  - darren.weber@stanford.edu
156
156
  executables:
157
+ - console
157
158
  - ctags.rb
159
+ - setup.sh
160
+ - test.sh
158
161
  extensions: []
159
162
  extra_rdoc_files:
160
163
  - README.md
@@ -167,7 +170,10 @@ files:
167
170
  - LICENSE
168
171
  - README.md
169
172
  - Rakefile
173
+ - bin/console
170
174
  - bin/ctags.rb
175
+ - bin/setup.sh
176
+ - bin/test.sh
171
177
  - lib/triannon-client.rb
172
178
  - lib/triannon-client/configuration.rb
173
179
  - lib/triannon-client/triannon-client.rb