rusty_csv 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.rustfmt.toml ADDED
@@ -0,0 +1,24 @@
1
+ # Style ***
2
+
3
+ control_style = "Legacy"
4
+ chain_indent = "Visual"
5
+ fn_brace_style = "PreferSameLine"
6
+ fn_args_layout = "Visual"
7
+ fn_args_density = "CompressedIfEmpty"
8
+ where_layout = "HorizontalVertical"
9
+ where_pred_indent = "Visual"
10
+ where_style = "Legacy"
11
+ use_try_shorthand = true
12
+
13
+ # Tabs ***
14
+ tab_spaces = 2
15
+ hard_tabs = false
16
+
17
+ # Spaces ***
18
+
19
+ space_before_bound = false
20
+ space_after_bound_colon = true
21
+ space_before_type_annotation = false
22
+ space_after_type_annotation_colon = true
23
+ space_after_struct_lit_field_colon = true
24
+ space_before_struct_lit_field_colon = false
data/CHANGELOG.md ADDED
File without changes
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at nick.flueckiger@renuo.ch. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Cargo.toml ADDED
@@ -0,0 +1,17 @@
1
+ [package]
2
+ name = "rusty_csv"
3
+ version = "0.1.0"
4
+ authors = ["Nick Flueckiger <nick.flueckiger@renuo.ch>"]
5
+ edition = "2018"
6
+
7
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8
+
9
+ [lib]
10
+ name = 'rusty_csv'
11
+ crate-type = ["dylib"]
12
+
13
+ [dependencies]
14
+ rutie = "0.8.2"
15
+ rayon = "1.5"
16
+ lazy_static = "1.3"
17
+ csv = "1.1.5"
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in rusty_csv.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+
10
+ gem 'rubocop', '~> 1.7'
data/Gemfile.lock ADDED
@@ -0,0 +1,68 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rusty_csv (0.1.0)
5
+ bundler (>= 1.12)
6
+ rake
7
+ rutie (~> 0.0.3)
8
+ thermite (~> 0.13.0)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ ansi (1.5.0)
14
+ ast (2.4.2)
15
+ builder (3.2.4)
16
+ color_pound_spec_reporter (0.0.9)
17
+ bundler
18
+ minitest
19
+ minitest-reporters (>= 0.14.24)
20
+ rake
21
+ minitar (0.9)
22
+ minitest (5.14.3)
23
+ minitest-reporters (1.4.3)
24
+ ansi
25
+ builder
26
+ minitest (>= 5.0)
27
+ ruby-progressbar
28
+ parallel (1.20.1)
29
+ parser (3.0.0.0)
30
+ ast (~> 2.4.1)
31
+ rainbow (3.0.0)
32
+ rake (13.0.3)
33
+ regexp_parser (2.0.3)
34
+ rexml (3.2.4)
35
+ rubocop (1.9.1)
36
+ parallel (~> 1.10)
37
+ parser (>= 3.0.0.0)
38
+ rainbow (>= 2.2.2, < 4.0)
39
+ regexp_parser (>= 1.8, < 3.0)
40
+ rexml
41
+ rubocop-ast (>= 1.2.0, < 2.0)
42
+ ruby-progressbar (~> 1.7)
43
+ unicode-display_width (>= 1.4.0, < 3.0)
44
+ rubocop-ast (1.4.1)
45
+ parser (>= 2.7.1.5)
46
+ ruby-progressbar (1.11.0)
47
+ rutie (0.0.4)
48
+ thermite (0.13.0)
49
+ minitar (~> 0.5)
50
+ rake (>= 10)
51
+ tomlrb (~> 1.2)
52
+ tomlrb (1.3.0)
53
+ unicode-display_width (2.0.0)
54
+
55
+ PLATFORMS
56
+ x86_64-darwin-19
57
+ x86_64-linux
58
+
59
+ DEPENDENCIES
60
+ color_pound_spec_reporter
61
+ minitest
62
+ minitest-reporters
63
+ rake (~> 13.0)
64
+ rubocop (~> 1.7)
65
+ rusty_csv!
66
+
67
+ BUNDLED WITH
68
+ 2.2.7
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Nick Flueckiger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # RustyCSV
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'rusty_csv'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ $ bundle install
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install rusty_csv
18
+
19
+ ## Usage
20
+
21
+ // TODO
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Liberatys/rusty_csv. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Liberatys/rusty_csv/blob/master/CODE_OF_CONDUCT.md).
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
+
37
+ ## Code of Conduct
38
+
39
+ Everyone interacting in the RustyCSV project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Liberatys/rusty_csv/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rbconfig'
4
+ require 'bundler/gem_tasks'
5
+ require 'rake/testtask'
6
+ require 'rubocop/rake_task'
7
+
8
+ # Mac OS with rbenv users keep leaving behind build artifacts from
9
+ # when they tried to build against a statically linked Ruby and then
10
+ # try against a dynamically linked one causing errors in the build result.
11
+ desc 'Preventative work'
12
+ task :tidy_up do
13
+ sh 'cargo clean'
14
+ end
15
+
16
+ desc 'Build Rust extension'
17
+ task :build_lib do
18
+ case RbConfig::CONFIG['host_os']
19
+ when /darwin|mac os/
20
+ sh 'cargo rustc --release -- -C link-args=-Wl,-undefined,dynamic_lookup'
21
+ else
22
+ sh 'cargo build --release'
23
+ end
24
+ end
25
+
26
+ desc 'bundle install'
27
+ task :bundle_install do
28
+ sh 'bundle install'
29
+ end
30
+
31
+ Rake::TestTask.new(test: %i[tidy_up bundle_install build_lib]) do |t|
32
+ t.libs << 'test'
33
+ t.libs << 'lib'
34
+ t.test_files = FileList['test/**/*_test.rb']
35
+ end
36
+
37
+ task default: :test
38
+
39
+ task :only_test do
40
+ Rake::TestTask.new(only_test: [:bundle_install]) do |t|
41
+ t.libs << 'test'
42
+ t.libs << 'lib'
43
+ t.test_files = FileList['test/**/*_test.rb']
44
+ end
45
+ end
46
+
47
+ RuboCop::RakeTask.new
48
+
49
+ task default: :rubocop
data/TODO.md ADDED
@@ -0,0 +1,10 @@
1
+ # Rusty CSV
2
+
3
+
4
+ ## Ruby
5
+
6
+
7
+ ## Rust
8
+
9
+
10
+ ## Docs
data/bin/check_linters ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ rubocop -A
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rusty_csv"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+ cargo build
8
+
data/ext/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thermite/tasks'
4
+ require_relative '../lib/rusty_swiss_village_directory/thermite_initialize'
5
+
6
+ project_toplevel_dir = File.dirname(__dir__)
7
+ Thermite::Tasks.new(cargo_project_path: project_toplevel_dir,
8
+ ruby_project_path: project_toplevel_dir)
9
+
10
+ task default: 'thermite:build'
data/lib/rusty_csv.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+ require 'rutie'
3
+ require_relative 'rusty_csv/version'
4
+
5
+ module RustyCSV
6
+ class Error < StandardError; end
7
+
8
+ Rutie.new(:rusty_csv).init 'Init_rusty_csv', __dir__
9
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubygems'
4
+ require 'rake/tasklib'
5
+ require_relative './version'
6
+
7
+ # @private :nodoc:
8
+ module Thermite
9
+ # @private :nodoc:
10
+ class Config
11
+ # @private :nodoc:
12
+ def ruby_version
13
+ "ruby#{RUBY_VERSION}"
14
+ end
15
+ end
16
+
17
+ # @private :nodoc:
18
+ class Tasks < Rake::TaskLib
19
+ # @private :nodoc:
20
+ def github_download_uri(_tag, version)
21
+ "#{github_uri}/releases/download/v#{RustyCsv::VERSION}/#{config.tarball_filename(version)}"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RustyCsv
4
+ VERSION = '0.0.1'
5
+ end
Binary file
data/rusty_csv.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/rusty_csv/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'rusty_csv'
7
+ spec.version = RustyCsv::VERSION
8
+ spec.authors = ['Nick Flueckiger']
9
+ spec.email = ['nick.flueckiger@renuo.ch']
10
+
11
+ spec.summary = 'A rust based csv gem for ruby'
12
+ spec.description = 'A rust based csv gem for ruby'
13
+ spec.homepage = 'https://github.com/Liberatys/rusty_csv'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
16
+
17
+ # spec.metadata['allowed_push_host'] = ""
18
+
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/Liberatys/rusty_csv'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/Liberatys/rusty_csv'
22
+
23
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
+ end
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib/rusty_csv.rb']
29
+
30
+ spec.extensions = ['ext/Rakefile']
31
+
32
+ spec.add_dependency 'bundler', '>= 1.12'
33
+ spec.add_dependency 'rake'
34
+ spec.add_dependency 'rutie', '~> 0.0.3'
35
+ spec.add_dependency 'thermite', '~> 0.13.0'
36
+ spec.add_development_dependency 'minitest'
37
+ spec.add_development_dependency 'minitest-reporters'
38
+ spec.add_development_dependency 'color_pound_spec_reporter'
39
+ spec.add_development_dependency 'rubocop', '0.53'
40
+ end