triannon 0.1.0 → 0.2.0

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: 9ae63ca110852324bb003e0a856033579b02cb62
4
- data.tar.gz: ee6310ea307c6c25b33b5ddaa93f9f7a2a21aef6
3
+ metadata.gz: 6f1dc35cca4a3483f2cf722ab165da8c0b6fb38c
4
+ data.tar.gz: 956ca6ac61d830d938420687efe744aa0156ddf2
5
5
  SHA512:
6
- metadata.gz: 831eed11793f83aca689bde7eca9ef841615028b04cfa6806393390d072e31392a1d4c1af94a010b210e5f580c11564e4e070eb83261112db6098f329e6e3899
7
- data.tar.gz: 3cb48b9ac9990ba2650b5753d6c9d6db9659c7409b3d5c8ee890b8ca14d61eeee2c44448c1d09396b3d254a204c5a9b3708a5f154433cc0260552b2b6a25e75c
6
+ metadata.gz: 2ddab1a5203861a6ed730111295c3587c8043627263f9d52a4ed59ca1d7904050e2d77508be117ff9708ab5634334e7d9e35df9a0045d9021af707ef79c808e9
7
+ data.tar.gz: 811ec9c95c928d34ef9420331a4266357f1ba21ba58de1117f21e2947334ea9ae039a785f145224ea74dd3d0147eb532f94a22f2a481aa17384cd676fff1039b
data/README.md CHANGED
@@ -34,9 +34,15 @@ $ rails g triannon:install
34
34
 
35
35
  Edit the `config/triannon.yml` file:
36
36
 
37
- * `ldp_url:` Points to the root annotations container in your LDP server
37
+ * `ldp_url:` Points to the root annotations container on your LDP server
38
38
  * `triannon_base_url:` Used as the base url for all annotations hosted by your Triannon server. Identifiers from the LDP server will be appended to this base-url.
39
39
 
40
+ Generate the root annotations container on the LDP server
41
+
42
+ ```console
43
+ $ rake triannon:create_root_container
44
+ ```
45
+
40
46
  ## Running the application in development
41
47
 
42
48
  There is a bundled rake task for running the test app:
@@ -47,6 +53,12 @@ $ rake jetty:download
47
53
  $ rake jetty:unzip
48
54
  $ rake engine_cart:generate # (first run only)
49
55
 
56
+ # Configure config/triannon.yml as specified above
57
+ $ vi config/triannon.yml
58
+
59
+ # Generate root annotations container
60
+ $ rake triannon:create_root_container
61
+
50
62
  # Run the test app
51
63
  $ rake triannon:server
52
64
  ```
@@ -9,7 +9,7 @@ module Triannon
9
9
  conn = Faraday.new :url => Triannon.config[:ldp_url]
10
10
  resp = conn.head
11
11
  unless resp.status == 404 || resp.status == 410
12
- Rails.logger.info "Root annotation resource already created."
12
+ puts "Root annotation resource already exists."
13
13
  return false
14
14
  end
15
15
 
@@ -23,10 +23,10 @@ module Triannon
23
23
  end
24
24
 
25
25
  if resp.status == 201
26
- Rails.logger.info "Created root annotation container #{Triannon.config[:ldp_url]}"
26
+ puts "Created root annotation container #{Triannon.config[:ldp_url]}"
27
27
  return true
28
28
  else
29
- Rails.logger.warn "Unable to create root annotation container #{Triannon.config[:ldp_url]}"
29
+ puts "Unable to create root annotation container #{Triannon.config[:ldp_url]}"
30
30
  return false
31
31
  # TODO raise an exception if we get here?
32
32
  end
@@ -1,6 +1,11 @@
1
+ require_relative '../../app/services/triannon/root_annotation_creator'
2
+
1
3
  namespace :triannon do
2
- # desc "Explaining what the task does"
3
- # task :Triannon do
4
- # # Task goes here
5
- # end
4
+ desc "Create the root annotation container"
5
+ task :create_root_container do
6
+ unless File.exists? Triannon.triannon_file
7
+ puts "Triannon config file missing: #{Triannon.triannon_file}"
8
+ end
9
+ Triannon::RootAnnotationCreator.create
10
+ end
6
11
  end
@@ -1,3 +1,3 @@
1
1
  module Triannon
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triannon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -267,7 +267,6 @@ files:
267
267
  - app/views/triannon/annotations/new.html.erb
268
268
  - app/views/triannon/annotations/show.html.erb
269
269
  - config/initializers/mime_types.rb
270
- - config/initializers/root_annotation_container.rb
271
270
  - config/routes.rb
272
271
  - config/triannon.yml
273
272
  - lib/generators/triannon/install_generator.rb
@@ -1,8 +0,0 @@
1
-
2
- def root_container_create
3
- return if(ENV['CI'] && !ENV['RSPEC_RUNNING'])
4
-
5
- Triannon::RootAnnotationCreator.create if File.exists? Triannon.triannon_file
6
- end
7
-
8
- # root_container_create