Permalink
Browse files

preparation for first release

  • Loading branch information...
1 parent b73db07 commit 1776c764f28b18ec5c97af3f989b885e0edf080c @darwin committed Dec 5, 2009
Showing with 18 additions and 6 deletions.
  1. +11 −0 README.md
  2. +4 −2 Rakefile
  3. +0 −1 VERSION
  4. +2 −2 bin/csv2json
  5. +1 −0 lib/csv2json.rb
  6. +0 −1 test/test_csv2json.rb
View
@@ -48,8 +48,19 @@ gets turned into this JSON:
`sudo gem install csv2json --source gemcutter.org`
+=== Usage
+
+ Usage: csv2json [INPUT] [OPTIONS]
+
+ Specific options:
+ -o, --output FILE Write output to a file
+ -h, --help Show this message
+ -v, --version Show version
+
=== Alternative usage
+common usage is `csv2json file.csv > file.json`
+
csv2json should behave like proper unix command-line utility working with pipes, redirects, etc.
`cat file.csv | csv2json | gzip > file.json.gz`
View
@@ -1,12 +1,14 @@
require 'rubygems'
require 'rake'
+require File.join(File.expand_path(File.dirname(__FILE__)), 'lib', 'csv2json.rb')
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
+ gem.version = CSV2JSON::VERSION
gem.name = "csv2json"
- gem.summary = %Q{TODO: one-line summary of your gem}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.summary = %Q{.csv to .json converter}
+ gem.description = %Q{handy for converting xls files to json}
gem.email = "antonin@hildebrand.cz"
gem.homepage = "http://github.com/darwin/csv2json"
gem.authors = ["Antonin Hildebrand"]
View
@@ -1 +0,0 @@
-0.1.0
View
@@ -9,7 +9,7 @@ module CSV2JSONRunner
# command-line parsing
COMMAND = File.basename($0)
- USAGE = "Usage: #{COMMAND} [OPTIONS]"
+ USAGE = "Usage: #{COMMAND} [INPUT] [OPTIONS]"
options = OpenStruct.new
options.output = "-"
@@ -29,7 +29,7 @@ module CSV2JSONRunner
end
o.on_tail("-v", "--version", "Show version") do
- puts "0.1.0" # TODO
+ puts CSV2JSON::VERSION
exit
end
end
View
@@ -2,6 +2,7 @@
require 'json'
module CSV2JSON
+ VERSION = "0.1.0"
# convert an input string value to integer or float if applicable
def convert(val)
View
@@ -7,7 +7,6 @@ class TestCsv2json < Test::Unit::TestCase
Dir.chdir(fixtures_dir) do
Dir.glob('*.csv') do |filename|
json_template = File.basename(filename, ".csv")+'.json'
- print json_template
File.open(filename, "r") do |input|
output = StringIO.new()
CSV2JSON.parse(input, output)

0 comments on commit 1776c76

Please sign in to comment.