Skip to content

Commit

Permalink
Finish 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Apr 11, 2016
2 parents a6300b0 + cdab71a commit 1078d99
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 18 deletions.
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# How to contribute

Community contributions are essential for keeping Ruby RDF great. We want to keep it as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

## Development

This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.

* create or respond to an issue on the [Github Repository](http://github.com/ruby-rdf/rdf-tabular/issues)
* Fork and clone the repo:
`git clone [email protected]:your-username/rdf-tabular.git`
* Install bundle:
`bundle install`
* Create tests in RSpec and make sure you achieve at least 90% code coverage for the feature your adding or behavior being modified.
* Push to your fork and [submit a pull request][pr].

## Do's and Dont's
* Do your best to adhere to the existing coding conventions and idioms.
* Don't use hard tabs, and don't leave trailing whitespace on any line.
Before committing, run `git diff --check` to make sure of this.
* Do document every method you add using [YARD][] annotations. Read the
[tutorial][YARD-GS] or just look at the existing code for examples.
* Don't touch the `.gemspec` or `VERSION` files. If you need to change them,
do so on your private branch only.
* Do feel free to add yourself to the `CREDITS` file and the
corresponding list in the the `README`. Alphabetical order applies.
* Don't touch the `AUTHORS` file. If your contributions are significant
enough, be assured we will eventually add you in there.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
explicit [public domain dedication][PDD] on record from you.

[YARD]: http://yardoc.org/
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
[pr]: https://github.com/ruby-rdf/rdf-tabular/compare/
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ group :development do
gem 'rdf-vocab', github: "ruby-rdf/rdf-vocab", branch: "develop"
gem 'sparql', github: "ruby-rdf/sparql", branch: "develop"
gem 'sparql-client', github: "ruby-rdf/sparql-client", branch: "develop"
gem 'sxp', github: "gkellogg/sxp-ruby"
gem 'sxp', github: "gkellogg/sxp-ruby", branch: "develop"
end

group :debug do
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0.beta2
0.4.0
19 changes: 12 additions & 7 deletions lib/rdf/tabular/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ def self.detect(sample)
# @return [Hash{Symbol => Lambda(Array, Hash)}]
def self.cli_commands
{
:"tabular-json" => ->(argv, opts) do
raise ArgumentError, "Outputting Tabular JSON only allowed when input format is tabular." unless opts[:format] == :tabular
out = opts[:output] || $stdout
out.set_encoding(Encoding::UTF_8) if RUBY_PLATFORM == "java"
RDF::CLI.parse(argv, opts) do |reader|
out.puts reader.to_json
:"tabular-json" => {
description: "Generate tabular json output, rather than RDF for Tabular data",
help: "tabulary-json --input-format tabular files ...",
prase: false,
lambda: ->(argv, opts) do
raise ArgumentError, "Outputting Tabular JSON only allowed when input format is tabular." unless opts[:format] == :tabular
out = opts[:output] || $stdout
out.set_encoding(Encoding::UTF_8) if RUBY_PLATFORM == "java"
RDF::CLI.parse(argv, opts) do |reader|
out.puts reader.to_json
end
end
end
}
}
end
end
Expand Down
16 changes: 8 additions & 8 deletions rdf-tabular.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ Gem::Specification.new do |gem|
gem.required_ruby_version = '>= 2.0'
gem.requirements = []
gem.add_runtime_dependency 'bcp47', '~> 0.3', '>= 0.3.3'
gem.add_runtime_dependency 'rdf', '>= 2.0.0.beta', '< 3'
gem.add_runtime_dependency 'rdf-vocab', '>= 2.0.0.beta', '< 3'
gem.add_runtime_dependency 'rdf-xsd', '>= 2.0.0.beta', '< 3'
gem.add_runtime_dependency 'json-ld', '>= 2.0.0.beta', '< 3'
gem.add_runtime_dependency 'rdf', '~> 2.0'
gem.add_runtime_dependency 'rdf-vocab', '~> 2.0'
gem.add_runtime_dependency 'rdf-xsd', '~> 2.0'
gem.add_runtime_dependency 'json-ld', '~> 2.0'
gem.add_runtime_dependency 'addressable', '~> 2.3'
gem.add_development_dependency 'nokogiri', '~> 1.6'
gem.add_development_dependency 'rspec', '~> 3.4'
gem.add_development_dependency 'rspec-its', '~> 1.2'
gem.add_development_dependency 'rdf-isomorphic', '>= 2.0.0.beta', '< 3'
gem.add_development_dependency 'rdf-spec', '>= 2.0.0.beta', '< 3'
gem.add_development_dependency 'rdf-turtle', '>= 2.0.0.beta', '< 3'
gem.add_development_dependency 'sparql', '>= 2.0.0.beta', '< 3'
gem.add_development_dependency 'rdf-isomorphic', '~> 2.0'
gem.add_development_dependency 'rdf-spec', '~> 2.0'
gem.add_development_dependency 'rdf-turtle', '~> 2.0'
gem.add_development_dependency 'sparql', '~> 2.0'
gem.add_development_dependency 'webmock', '~> 1.17'
gem.add_development_dependency 'yard' , '~> 0.8'

Expand Down
2 changes: 1 addition & 1 deletion spec/format_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
let(:input) {File.expand_path("../data/countries.json", __FILE__)}
describe "#tabular-json" do
it "serializes to JSON" do
expect {RDF::CLI.exec_command("tabular-json", [input], format: :tabular)}.to write.to(:output)
expect {RDF::CLI.exec(["tabular-json", input], format: :tabular)}.to write.to(:output)
end
end
end
Expand Down

0 comments on commit 1078d99

Please sign in to comment.