sword2ruby 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +30 -0
- data/LICENCE +35 -0
- data/README.md +43 -0
- data/Rakefile +53 -0
- data/doc/Atom/Collection.html +837 -0
- data/doc/Atom/Element.html +197 -0
- data/doc/Atom/Entry.html +1795 -0
- data/doc/Atom/Feed.html +297 -0
- data/doc/Atom/Service.html +363 -0
- data/doc/Atom.html +158 -0
- data/doc/Gemfile.html +125 -0
- data/doc/Object.html +165 -0
- data/doc/REXML/Element.html +493 -0
- data/doc/REXML.html +158 -0
- data/doc/Rakefile.html +123 -0
- data/doc/Sword2Ruby/Atom.html +169 -0
- data/doc/Sword2Ruby/AutoDiscover.html +327 -0
- data/doc/Sword2Ruby/Connection.html +274 -0
- data/doc/Sword2Ruby/DepositReceipt.html +331 -0
- data/doc/Sword2Ruby/Exception.html +168 -0
- data/doc/Sword2Ruby/SwordAccept.html +169 -0
- data/doc/Sword2Ruby/SwordStatementOAIORE.html +277 -0
- data/doc/Sword2Ruby/User.html +272 -0
- data/doc/Sword2Ruby/Utility.html +1101 -0
- data/doc/Sword2Ruby.html +213 -0
- data/doc/created.rid +29 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +118 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/spec/fixtures/example_txt.html +125 -0
- data/doc/table_of_contents.html +267 -0
- data/lib/sword2ruby/auto_discover.rb +71 -0
- data/lib/sword2ruby/collection.rb +261 -0
- data/lib/sword2ruby/connection.rb +37 -0
- data/lib/sword2ruby/constant.rb +35 -0
- data/lib/sword2ruby/deposit_receipt.rb +52 -0
- data/lib/sword2ruby/element.rb +12 -0
- data/lib/sword2ruby/entry.rb +602 -0
- data/lib/sword2ruby/exception.rb +7 -0
- data/lib/sword2ruby/feed.rb +34 -0
- data/lib/sword2ruby/rexml_element.rb +79 -0
- data/lib/sword2ruby/service.rb +79 -0
- data/lib/sword2ruby/sword_accept.rb +10 -0
- data/lib/sword2ruby/sword_statement_oai_ore.rb +38 -0
- data/lib/sword2ruby/user.rb +25 -0
- data/lib/sword2ruby/utility.rb +232 -0
- data/lib/sword2ruby/version.rb +4 -0
- data/lib/sword2ruby.rb +32 -0
- data/spec/auto_discover_spec.rb +30 -0
- data/spec/collection_spec.rb +33 -0
- data/spec/connection_spec.rb +21 -0
- data/spec/end_to_end_spec.rb +235 -0
- data/spec/fixtures/example.txt +3 -0
- data/spec/fixtures/snowflake.png +0 -0
- data/spec/fixtures/zip-test.zip +0 -0
- data/spec/service_spec.rb +38 -0
- data/spec/statement_spec.rb +53 -0
- data/spec/test_constants.rb +32 -0
- data/sword2ruby.gemspec +42 -0
- data/sword2ruby.tmproj +27 -0
- metadata +197 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sword2ruby (1.0.0)
|
5
|
+
atom-tools (~> 2.0.5)
|
6
|
+
hpricot (~> 0.8.3)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
atom-tools (2.0.5)
|
12
|
+
diff-lcs (1.1.3)
|
13
|
+
hpricot (0.8.6)
|
14
|
+
rake (0.9.2.2)
|
15
|
+
rspec (2.9.0)
|
16
|
+
rspec-core (~> 2.9.0)
|
17
|
+
rspec-expectations (~> 2.9.0)
|
18
|
+
rspec-mocks (~> 2.9.0)
|
19
|
+
rspec-core (2.9.0)
|
20
|
+
rspec-expectations (2.9.1)
|
21
|
+
diff-lcs (~> 1.1.3)
|
22
|
+
rspec-mocks (2.9.0)
|
23
|
+
|
24
|
+
PLATFORMS
|
25
|
+
ruby
|
26
|
+
|
27
|
+
DEPENDENCIES
|
28
|
+
rake
|
29
|
+
rspec (~> 2.8)
|
30
|
+
sword2ruby!
|
data/LICENCE
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
BSD LICENCE
|
2
|
+
|
3
|
+
Copyright (c) 2011, 2012, Mark MacGillivray, Martyn Whitwell
|
4
|
+
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without
|
8
|
+
modification, are permitted provided that the following conditions
|
9
|
+
are met:
|
10
|
+
|
11
|
+
- Redistributions of source code must retain the above
|
12
|
+
copyright notice, this list of conditions and the
|
13
|
+
following disclaimer.
|
14
|
+
|
15
|
+
- Redistributions in binary form must reproduce the above copyright
|
16
|
+
notice, this list of conditions and the following disclaimer in
|
17
|
+
the documentation and/or other materials provided with the
|
18
|
+
distribution.
|
19
|
+
|
20
|
+
- Neither the name of the Author, copyright holder, nor the names of
|
21
|
+
its contributors may be used to endorse or promote products derived
|
22
|
+
from this software without specific prior written permission.
|
23
|
+
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
25
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
26
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
27
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
28
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
29
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
30
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
31
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
32
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
33
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
34
|
+
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
35
|
+
SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
Sword2Ruby gem
|
2
|
+
==================
|
3
|
+
|
4
|
+
Introduction
|
5
|
+
------------
|
6
|
+
The Sword2Ruby gem provides Sword client functionality when run against a Sword 2.0 compliant server.
|
7
|
+
It eases integration of Ruby applications with Sword servers, taking care of things like authentication,
|
8
|
+
deposit-receipts and the parsing of Sword tags.
|
9
|
+
|
10
|
+
It was developed as part of the JISC Sword 2.0 project. For more information on Sword, see:
|
11
|
+
http://www.swordapp.org/. The Sword 2 specification can be found at:
|
12
|
+
http://sword-app.svn.sourceforge.net/viewvc/sword-app/spec/tags/sword-2.0/SWORDProfile.html?revision=377
|
13
|
+
|
14
|
+
This code lives at https://github.com/CottageLabs/sword2ruby.
|
15
|
+
|
16
|
+
|
17
|
+
Requirements
|
18
|
+
------------
|
19
|
+
In order to use the Sword2Ruby gem, you will require:-
|
20
|
+
|
21
|
+
* A Sword 2.0 compliant server, such as Simple Sword Server 2 by Richard Jones:
|
22
|
+
https://sword-app.svn.sourceforge.net/svnroot/sword-app/sss/branches/sss-2/
|
23
|
+
* The atom-tools gem (version 2.0.5): https://github.com/bct/atom-tools/
|
24
|
+
* The hpricot gem (version 0.8.6): https://github.com/hpricot/hpricot
|
25
|
+
* Ruby 1.9.3
|
26
|
+
* Bundler 1.0.21
|
27
|
+
|
28
|
+
Installation
|
29
|
+
------------
|
30
|
+
To install Sword2Ruby and its associated dependencies, make sure you have Bundler installed, then from
|
31
|
+
the command line, run:
|
32
|
+
|
33
|
+
bundle install sword2ruby
|
34
|
+
|
35
|
+
Now you can use the Sword2Ruby library with:
|
36
|
+
|
37
|
+
require 'sword2ruby'
|
38
|
+
|
39
|
+
at the top of your Ruby code.
|
40
|
+
|
41
|
+
Usage
|
42
|
+
-----
|
43
|
+
Refer to the Rdoc for full details of all the classes and their methods.
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new
|
6
|
+
|
7
|
+
task :default => :spec
|
8
|
+
task :test => :spec
|
9
|
+
|
10
|
+
|
11
|
+
=begin
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'rake'
|
15
|
+
require 'rake/testtask'
|
16
|
+
require File.expand_path('../lib/mongomapper_id2/version', __FILE__)
|
17
|
+
|
18
|
+
Rake::TestTask.new(:test) do |test|
|
19
|
+
test.libs << 'lib' << 'test'
|
20
|
+
test.pattern = 'test/{functional,unit}/**/test_*.rb'
|
21
|
+
end
|
22
|
+
|
23
|
+
namespace :test do
|
24
|
+
Rake::TestTask.new(:lint) do |test|
|
25
|
+
test.libs << 'lib' << 'test'
|
26
|
+
test.pattern = 'test/test_active_model_lint.rb'
|
27
|
+
end
|
28
|
+
|
29
|
+
task :all => ['test', 'test:lint']
|
30
|
+
end
|
31
|
+
|
32
|
+
task :default => 'test:all'
|
33
|
+
|
34
|
+
desc 'Builds the gem'
|
35
|
+
task :build do
|
36
|
+
sh "gem build mongomapper_id2.gemspec"
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'Builds and installs the gem'
|
40
|
+
task :install => :build do
|
41
|
+
sh "gem install mongomapper_id2-#{MongomapperId2::VERSION}"
|
42
|
+
end
|
43
|
+
|
44
|
+
desc 'Tags version, pushes to remote, and pushes gem'
|
45
|
+
task :release => :build do
|
46
|
+
sh "git tag v#{MongomapperId2::VERSION}"
|
47
|
+
sh "git push origin master"
|
48
|
+
sh "git push origin v#{MongomapperId2::VERSION}"
|
49
|
+
sh "gem push mongomapper_id2-#{MongomapperId2::VERSION}.gem"
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
=end
|