ocsv 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 53fd1ddbcf4dc5451fffbad2b42052d005e892e2
4
+ data.tar.gz: 58275ac479ea2c70ea4aa963b28bf46046103da7
5
+ SHA512:
6
+ metadata.gz: 84a7b09e7861b9a548e8986779b9a54ca3af4b85e6d4e1e0bcb1f0c331efbd5150a41bde06c20295d40943750ae0fadd9b5ff0847e5c228d538942ddc4b552df
7
+ data.tar.gz: 1f34b2f9713bb7cbe422c01cdf7988e220d32f0bd3d030ca468bb90aca3537107e586a51bdf3e04247faca102674ec9146b04725c46f735cea9fd0fe187bace7
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ocsv.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Ryan Stenhouse
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # Ocsv - Oxford Comma Seperated Values
2
+
3
+ Inspired by a Tweet, this is a Ruby library for reading and writing files with fields
4
+ delimited by the Oxford Comma.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'ocsv'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install ocsv
21
+
22
+ ## Usage
23
+
24
+ It's intended to work a lot like the standard `CSV` library, but it's just not as well
25
+ tested or useful. Please don't use this for anything too serious.
26
+
27
+ ```ruby
28
+ [1,2,3,4,5].to_ocsv
29
+ # returns
30
+ "1,2,3,4, and 5\n"
31
+ ```
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it ( https://github.com/[my-github-username]/ocsv/fork )
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,10 @@
1
+ require "ocsv/version"
2
+ require "csv"
3
+
4
+ module Ocsv
5
+ # Your code goes here...
6
+ end
7
+
8
+ # Gives us Enumerable#to_ocsv
9
+ #
10
+ Enumerable.send(:include, Ocsv::EnumerableExtensions)
@@ -0,0 +1,9 @@
1
+ module Ocsv
2
+ module EnumerableExtensions
3
+ def to_ocsv
4
+ parts = self.to_csv.split(',')
5
+ last = parts.delete( parts[-1] )
6
+ "#{parts.join(",")}, and #{last}"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Ocsv
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ocsv/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ocsv"
8
+ spec.version = Ocsv::VERSION
9
+ spec.authors = ["Ryan Stenhouse"]
10
+ spec.email = ["ryan@ryanstenhouse.jp"]
11
+ spec.summary = %q{Ruby library for reading and writing files with fields delimited by the Oxford Comma.}
12
+ spec.description = %q{Inspired by a Tweet, generates and reads files with fields delimited by the Oxford Comma.}
13
+ spec.homepage = "http://ryanstenhouse.jp"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ocsv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Stenhouse
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ description: Inspired by a Tweet, generates and reads files with fields delimited
28
+ by the Oxford Comma.
29
+ email:
30
+ - ryan@ryanstenhouse.jp
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".gitignore"
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - lib/ocsv.rb
41
+ - lib/ocsv/enumerable_extensions.rb
42
+ - lib/ocsv/version.rb
43
+ - ocsv.gemspec
44
+ homepage: http://ryanstenhouse.jp
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.2.2
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Ruby library for reading and writing files with fields delimited by the Oxford
68
+ Comma.
69
+ test_files: []