Skip to content

Commit

Permalink
Cleaning up before gem release
Browse files Browse the repository at this point in the history
  • Loading branch information
tommorris committed Dec 2, 2008
1 parent cf1332a commit 4ac08f4
Show file tree
Hide file tree
Showing 23 changed files with 307 additions and 143 deletions.
85 changes: 85 additions & 0 deletions Manifest.txt
@@ -0,0 +1,85 @@
HACKNOTES
History.txt
lib
lib/reddy
lib/reddy/libxml_hacks.rb
lib/reddy/rexml_hacks.rb
lib/reddy/n3_grammar.treetop
lib/reddy/uriref.rb
lib/reddy/rdfxmlparser.rb
lib/reddy/n3parser.rb
lib/reddy/exceptions
lib/reddy/exceptions/about_each_exception.rb
lib/reddy/exceptions/uri_relative_exception.rb
lib/reddy/namespace.rb
lib/reddy/graph.rb
lib/reddy/bnode.rb
lib/reddy/triple.rb
lib/reddy/rdfaparser.rb
lib/reddy/literal.rb
lib/reddy.rb
Manifest.fnl
Manifest.txt
Rakefile
README.rdoc
README.txt
reddy.gemspec
script
script/generate
script/destroy
script/console
spec
spec/uriref_spec.rb
spec/rdfa_parser_spec.rb
spec/n3parser_spec.rb
spec/graph_spec.rb
spec/literal_spec.rb
spec/bnode_spec.rb
spec/triple_spec.rb
spec/parser_spec.rb
spec/rexml_hacks_spec.rb
spec/namespaces_spec.rb
tasks
test
test/xml.rdf
test/n3_tests
test/n3_tests/misc
test/n3_tests/misc/on_now-01.nt
test/n3_tests/misc/on_now-01.n3
test/n3_tests/n3p
test/n3_tests/n3p/simple-07.nt
test/n3_tests/n3p/simple-05.n3
test/n3_tests/n3p/simple-06.n3
test/n3_tests/n3p/simple-07.n3
test/n3_tests/n3p/simple-06.nt
test/n3_tests/n3p/simple-02.nt
test/n3_tests/n3p/simple-04.nt
test/n3_tests/n3p/simple-02.n3
test/n3_tests/n3p/simple-03.nt
test/n3_tests/n3p/simple-01.nt
test/n3_tests/n3p/simple-01.n3
test/n3_tests/n3p/simple-04.n3
test/n3_tests/n3p/simple-03.n3
test/n3_tests/n3p/simple-05.nt
test/n3_tests/lcsh
test/n3_tests/lcsh/sh85082139.nt
test/n3_tests/lcsh/sh85118553.nt
test/n3_tests/lcsh/sh85118553.n3
test/n3_tests/lcsh/sh85062913.n3
test/n3_tests/lcsh/sh85082139.n3
test/n3_tests/lcsh/sh85062913.nt
test/perf_test
test/perf_test/tommorris.rdf
test/perf_test/test.rb
test/rdf_tests
test/rdf_tests/xml-literal-mixed.rdf
test/rdf_tests/xml-literal-mixed.nt
test/rdf_tests/tm_001.nt
test/rdf_tests/cc197bad-dc9c-440d-a5b5-d52ba2e14234.rdf
test/rdf_tests/tm_001.rdf
test/rdf_tests/cc197bad-dc9c-440d-a5b5-d52ba2e14234.nt
test/test_helper.rb
test/test_uris.rb
test/test_reddy.rb
test/longtests_spec.rb
test/ruby_fundamentals.spec.rb
48 changes: 48 additions & 0 deletions README.rdoc
@@ -0,0 +1,48 @@
= reddy

* FIX (url)

== DESCRIPTION:

FIX (describe your package)

== FEATURES/PROBLEMS:

* FIX (list of features or problems)

== SYNOPSIS:

FIX (code sample of usage)

== REQUIREMENTS:

* FIX (list of requirements)

== INSTALL:

* FIX (sudo gem install, anything else)

== LICENSE:

(The MIT License)

Copyright (c) 2008 FIXME full name

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
117 changes: 68 additions & 49 deletions Rakefile
@@ -1,49 +1,68 @@
# -*- ruby -*-
require 'rubygems'
require 'rake'
require 'spec/rake/spectask'
require 'hoe'
require './lib/reddy.rb'

Hoe.new('reddy', '0.1.1') do |p|
p.rubyforge_name = 'reddy'
p.developer('Tom Morris', 'tom@tommorris.org')
end

task :default => [:spec]

desc "Pushes to git"
task :push do
sh "git push --all"
sh "growlnotify -m \"Updates pushed\" \"Git\""
end

task :spec do
sh "spec --colour spec"
end

desc "Turns spec results into HTML and publish to web (Tom only!)"
task :spec_html do
sh "spec --format html:reddy_new_spec.html spec"
sh "scp reddy_new_spec.html bbcityco@bbcity.co.uk:www/tom/files/rena_new_spec.html"
sh "rm reddy_new_spec.html"
end

desc "Turns spec results into local HTML"
task :spec_local do
sh "spec --format html:reddy_new_spec.html spec/"
# sh "open reddy_new_spec.html"
end

desc "Run specs through RCov"
Spec::Rake::SpecTask.new('coverage') do |t|
t.spec_files = FileList['spec']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec,test,\/Library\/Ruby\/Gems\/1.8\/gems']
end

desc "Runs specs on JRuby"
task :jspec do
sh "jruby -S `whereis spec` --colour spec"
end
# vim: syntax=Ruby
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
require 'spec/rake/spectask'
require File.dirname(__FILE__) + '/lib/reddy'

# Generate all the Rake tasks
# Run 'rake -T' to see list of generated tasks (from gem root directory)
$hoe = Hoe.new('reddy', Reddy::VERSION) do |p|
p.developer('Tom Morris', 'tom@tommorris.org')
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
#p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
p.rubyforge_name = p.name # TODO this is default value
p.extra_deps = [
['addressable', '>= 2.0.0'],
['treetop', '>= 1.2.4'],
['libxml-ruby', '>= 0.8.3'],
['whatlanguage', '>= 1.0.0']
]
p.extra_dev_deps = [
['newgem', ">= #{::Newgem::VERSION}"]
]

p.clean_globs |= %w[**/.DS_Store .git tmp *.log]
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
p.rsync_args = '-av --delete --ignore-errors'
end

require 'newgem/tasks' # load /tasks/*.rake
Dir['tasks/**/*.rake'].each { |t| load t }

# TODO - want other tests/tasks run by default? Add them to the list
#task :default => [:spec, :features]

desc "Pushes to git"
task :push do
sh "git push --all"
sh "growlnotify -m \"Updates pushed\" \"Git\""
end

task :spec do
sh "spec --colour spec"
end

desc "Turns spec results into HTML and publish to web (Tom only!)"
task :spec_html do
sh "spec --format html:reddy_new_spec.html spec"
sh "scp reddy_new_spec.html bbcityco@bbcity.co.uk:www/tom/files/rena_new_spec.html"
sh "rm reddy_new_spec.html"
end

desc "Turns spec results into local HTML"
task :spec_local do
sh "spec --format html:reddy_new_spec.html spec/"
# sh "open reddy_new_spec.html"
end

desc "Run specs through RCov"
Spec::Rake::SpecTask.new('coverage') do |t|
t.spec_files = FileList['spec']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec,test,\/Library\/Ruby\/Gems\/1.8\/gems']
end

desc "Runs specs on JRuby"
task :jspec do
sh "jruby -S `whereis spec` --colour spec"
end
# vim: syntax=Ruby
5 changes: 4 additions & 1 deletion lib/reddy.rb
@@ -1,5 +1,8 @@
$:.unshift File.dirname(__FILE__)
#$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

$:.unshift(File.dirname('reddy'))
Dir.glob(File.join(File.dirname(__FILE__), 'reddy/**.rb')).each { |f| require f }

module Reddy
VERSION = '0.0.2'
end
2 changes: 1 addition & 1 deletion lib/reddy/bnode.rb
@@ -1,4 +1,4 @@
module Rena
module Reddy
class BNode
attr_accessor :identifier
def initialize(identifier = nil)
Expand Down
12 changes: 6 additions & 6 deletions lib/reddy/graph.rb
@@ -1,17 +1,17 @@
require 'reddy/namespace'
require 'reddy/bnode'
require 'reddy/uriref'
require 'reddy/literal'
require 'reddy/triple'
require 'open-uri'

module Rena
module Reddy
class Graph
attr_accessor :triples, :nsbinding

def initialize
@triples = []
@nsbinding = {}
end

def self.load (uri)
RdfXmlParser.new(open(uri)).graph
end

def size
@triples.size
Expand Down
4 changes: 2 additions & 2 deletions lib/reddy/literal.rb
@@ -1,4 +1,4 @@
module Rena
module Reddy
class Literal
class Encoding
def self.integer
Expand Down Expand Up @@ -39,7 +39,7 @@ def format_as_trix(content)
end

def inspect
"<theRena::TypeLiteral::Encoding::Null>"
"<theReddy::TypeLiteral::Encoding::Null>"
end

def xmlliteral?
Expand Down
4 changes: 2 additions & 2 deletions lib/reddy/n3parser.rb
@@ -1,9 +1,9 @@
require 'reddy/graph'
require 'treetop'
include Reddy

Treetop.load(File.join(File.dirname(__FILE__), "n3_grammar"))

module Rena
module Reddy
class N3Parser
attr_accessor :graph

Expand Down
7 changes: 2 additions & 5 deletions lib/reddy/namespace.rb
@@ -1,7 +1,4 @@
require 'reddy/uriref'
require 'reddy/graph'

module Rena
module Reddy
class Namespace
attr_accessor :short, :uri, :fragment

Expand Down Expand Up @@ -73,4 +70,4 @@ def shortname_valid?(shortname)
end
end
end
end
end
8 changes: 3 additions & 5 deletions lib/reddy/rdfaparser.rb
@@ -1,7 +1,5 @@
# require 'lib/reddy'

module Rena
class Rena::RdfaParser
module Reddy
class Reddy::RdfaParser
attr_accessor :xml, :uri, :graph

def initialize (str, uri)
Expand Down Expand Up @@ -62,4 +60,4 @@ def iterate (el)
end

end
end
end

0 comments on commit 4ac08f4

Please sign in to comment.