see_as_vee 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 587a33262b93097f6e1648e7f2796ded10b8d391
4
+ data.tar.gz: 309e71c47996925800350cf465156ecb8341db41
5
+ SHA512:
6
+ metadata.gz: 7abb802f68d37605c415ca0316e03e5b14cbbe0f8edf21fba1952c64f084c68e1be7828b024b88b6ff2444eb1fe450fcf9e1f324fa1c43d4883bc96515602c1e
7
+ data.tar.gz: 89f383c68cecfde8d61adeaf2ed6da7a82ccbe7eb344c57e852f41195e38f86ec8745214e327fb982658baabe0dbd4504c4276f730deae1aeb39c0be63f3add8
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,18 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ Style/Documentation:
4
+ Exclude:
5
+ - 'spec/**/*'
6
+ - 'lib/**/*'
7
+
8
+ Style/RaiseArgs:
9
+ Exclude:
10
+ - 'spec/**/*'
11
+ - 'lib/**/*'
12
+
13
+ Style/MethodDefParentheses:
14
+ EnforcedStyle: require_no_parentheses
15
+
16
+ Style/MultilineBlockChain:
17
+ Exclude:
18
+ - 'spec/**/*'
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,74 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-03-11 10:58:55 +0100 using RuboCop version 0.37.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: IgnoreEmptyBlocks.
12
+ Lint/UnusedBlockArgument:
13
+ Exclude:
14
+ - 'lib/see_as_vee.rb'
15
+
16
+ # Offense count: 3
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
19
+ Lint/UnusedMethodArgument:
20
+ Exclude:
21
+ - 'lib/see_as_vee.rb'
22
+
23
+ # Offense count: 2
24
+ Lint/UselessAssignment:
25
+ Exclude:
26
+ - 'lib/see_as_vee.rb'
27
+
28
+ # Offense count: 11
29
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
30
+ # URISchemes: http, https
31
+ Metrics/LineLength:
32
+ Max: 180
33
+
34
+ # Offense count: 1
35
+ # Cop supports --auto-correct.
36
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
37
+ # SupportedStyles: with_first_parameter, with_fixed_indentation
38
+ Style/AlignParameters:
39
+ Exclude:
40
+ - 'spec/see_as_vee_spec.rb'
41
+
42
+ # Offense count: 1
43
+ # Cop supports --auto-correct.
44
+ Style/EmptyLines:
45
+ Exclude:
46
+ - 'lib/see_as_vee.rb'
47
+
48
+ # Offense count: 1
49
+ # Cop supports --auto-correct.
50
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
51
+ # SupportedStyles: empty_lines, no_empty_lines
52
+ Style/EmptyLinesAroundBlockBody:
53
+ Exclude:
54
+ - 'lib/see_as_vee.rb'
55
+
56
+ # Offense count: 1
57
+ # Cop supports --auto-correct.
58
+ # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
59
+ # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
60
+ Style/HashSyntax:
61
+ Enabled: false
62
+
63
+ # Offense count: 1
64
+ # Cop supports --auto-correct.
65
+ Style/MutableConstant:
66
+ Exclude:
67
+ - 'lib/see_as_vee/version.rb'
68
+
69
+ # Offense count: 133
70
+ # Cop supports --auto-correct.
71
+ # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
72
+ # SupportedStyles: single_quotes, double_quotes
73
+ Style/StringLiterals:
74
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.8
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers 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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in see_as_vee.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Aleksei Matiushkin
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,67 @@
1
+ # SeeAsVee
2
+
3
+ Easy dealing with CSV import, including, but not limited to:
4
+
5
+ ✓ import in any format: `String`, `csv`, `xlsx`;
6
+
7
+ ✓ additional input formatting;
8
+
9
+ ✓ input checkers;
10
+
11
+ ✓ callbacks on errors;
12
+
13
+ ✓ producing of “suggested edits” version of input (both `csv` and `xlsx` formats).
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'see_as_vee'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself as:
28
+
29
+ $ gem install see_as_vee
30
+
31
+ ## Usage
32
+
33
+ ```ruby
34
+ sheet = SeeAsVee.harvest(
35
+ 'spec/fixtures/velocity.xlsx', # file exists ⇒ will be loaded
36
+ formatters: { reference: ->(v) { v.round.to_s } }, # safe reference input
37
+ checkers: { reference: ->(v) { v.nil? } } # must be present
38
+ ) do |idx, errors, hash| # row index, errors, row as hash { header: value }
39
+ # Errors: {"Reference"=>"☣2̶4̶3̶7̶2̶3̶1̶1̶4̶"}
40
+ expect(errors["Reference"]).to eq "#{SeeAsVee::Sheet::CELL_ERROR_MARKER}2̶4̶3̶7̶2̶3̶1̶1̶4̶"
41
+ # Hash: {"Reference"=>"☣2̶4̶3̶7̶2̶3̶1̶1̶4̶", ... }
42
+ expect(hash["Reference"]).to eq "#{SeeAsVee::Sheet::CELL_ERROR_MARKER}2̶4̶3̶7̶2̶3̶1̶1̶4̶"
43
+ end
44
+ csv, xlsx = sheet.produce csv: true, xlsx: true
45
+ # in CSV cells, that did not pass validation, are striked out
46
+ expect(File.exist?(csv.path)).to eq true
47
+ expect(csv.length > 0).to eq true
48
+ # in XLSX cells, that did not pass validation, are marked with red background
49
+ expect(File.exist?(xlsx.path)).to eq true
50
+ expect(xlsx.length > 0).to eq true
51
+ ```
52
+
53
+
54
+ ## Development
55
+
56
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
57
+
58
+ 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
59
+
60
+ ## Contributing
61
+
62
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/see_as_vee. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
63
+
64
+
65
+ ## License
66
+
67
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+
4
+ require 'bundler'
5
+ require 'bundler/setup'
6
+ require 'bundler/gem_tasks'
7
+
8
+ require 'rspec/core/rake_task'
9
+
10
+ begin
11
+ Bundler.setup(:default, :development, :test)
12
+ rescue Bundler::BundlerError => e
13
+ $stderr.puts e.message
14
+ $stderr.puts 'Run `bundle install` to install missing gems'
15
+ exit e.status_code
16
+ end
17
+
18
+ desc 'Tests'
19
+ RSpec::Core::RakeTask.new(:spec) do |spec|
20
+ spec.rspec_opts = '-Ispec'
21
+ # spec.rcov = true
22
+ end
23
+
24
+ task default: [:spec]
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "see_as_vee"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,19 @@
1
+ module SeeAsVee
2
+ module Exceptions
3
+ class SeeAsVeeError < ::StandardError
4
+ end
5
+
6
+ class FileFormatError < SeeAsVeeError
7
+ def initialize file
8
+ file = file.path if file.is_a?(IO)
9
+ super "File [#{file}] does not seem to be valid spreadsheet"
10
+ end
11
+ end
12
+
13
+ class BadInputError < SeeAsVeeError
14
+ def initialize object
15
+ super "Do not know what to do with an instance of #{object.class}: #{object.inspect}"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,52 @@
1
+ SimpleXlsxReader.configuration.catch_cell_load_errors ||= true
2
+
3
+ module SeeAsVee
4
+ module Helpers
5
+ def file_with_type whatever
6
+ file = case whatever
7
+ when IO then whatever
8
+ when String
9
+ File.exist?(whatever) ? File.new(whatever) : Privates.tempfile(whatever)
10
+ else
11
+ raise SeeAsVee::Exceptions::BadInputError.new(whatever)
12
+ end
13
+ [file, Privates.handler_name(FileMagic.new.file(file.path))].tap do |_, handle|
14
+ raise SeeAsVee::Exceptions::FileFormatError.new(file.path) if handle.nil?
15
+ end
16
+ end
17
+ module_function :file_with_type
18
+
19
+ def harvest_csv whatever
20
+ file, type = file_with_type whatever
21
+ Privates.public_send("#{type}_to_array", file.path)
22
+ end
23
+ module_function :harvest_csv
24
+
25
+ module Privates
26
+ FILE_TYPE = {
27
+ /\A(Microsoft OOXML)/ => :xlsx,
28
+ /\A(UTF-8 Unicode|ASCII) text/ => :csv
29
+ }.freeze
30
+
31
+ def tempfile bytes
32
+ Tempfile.new('see_as_vee').tap { |f| f.syswrite(bytes) if bytes }
33
+ end
34
+ module_function :tempfile
35
+
36
+ def handler_name file_type
37
+ (FILE_TYPE.detect { |k, _| k =~ file_type } || []).last
38
+ end
39
+ module_function :handler_name
40
+
41
+ def xlsx_to_array path
42
+ SimpleXlsxReader.open(path).sheets.first.rows
43
+ end
44
+ module_function :xlsx_to_array
45
+ def csv_to_array path
46
+ CSV.read path
47
+ end
48
+ module_function :csv_to_array
49
+ end
50
+ private_constant :Privates
51
+ end
52
+ end
@@ -0,0 +1,79 @@
1
+ module SeeAsVee
2
+ module Producers
3
+ class Hashes
4
+ NORMALIZER = ->(symbol, hash) { hash.map { |k, v| [k.public_send(symbol ? :to_sym : :to_s), v] }.to_h }.freeze
5
+ HUMANIZER = lambda do |hash|
6
+ hash.map do |k, v|
7
+ [k.respond_to?(:humanize) ? k.humanize : k.to_s.sub(/\A_+/, '').tr('_', ' ').downcase, v]
8
+ end.to_h
9
+ end.freeze
10
+
11
+ def initialize *args, **params
12
+ @hashes = []
13
+ add(*args, **params)
14
+ end
15
+
16
+ def add *args, **params
17
+ @keys, @joined = [nil] * 2
18
+
19
+ @hashes << params unless params.size.zero?
20
+ @hashes |= args.flatten.select(&Hash.method(:===))
21
+ normalize!(false)
22
+ end
23
+
24
+ def normalize symbol = true # to_s otherwise
25
+ @hashes.map(&NORMALIZER.curry[symbol])
26
+ end
27
+
28
+ def normalize! symbol = true # to_s otherwise
29
+ @hashes.map!(&NORMALIZER.curry[symbol])
30
+ self
31
+ end
32
+
33
+ def humanize
34
+ @hashes.map(&HUMANIZER)
35
+ end
36
+
37
+ def humanize!
38
+ @hashes.map!(&HUMANIZER)
39
+ self
40
+ end
41
+
42
+ def join
43
+ return @joined if @joined
44
+
45
+ @joined = @hashes.map { |hash| keys.zip([nil] * keys.size).to_h.merge hash }
46
+ end
47
+
48
+ def keys
49
+ @keys ||= @hashes.map(&:keys).reduce(&:|)
50
+ end
51
+
52
+ def to_sheet
53
+ SeeAsVee::Sheet.new(humanize!.join.map(&:values).unshift(keys))
54
+ end
55
+
56
+ class << self
57
+ def join *args, normalize: :human
58
+ Hashes.new(*args).join.tap do |result|
59
+ case normalize
60
+ when :humanize, :human, :pretty then result.map!(&HUMANIZER)
61
+ when :string, :str, :to_s then result.map!(&NORMALIZER.curry[false])
62
+ when :symbol, :sym, :to_sym then result.map!(&NORMALIZER.curry[true])
63
+ end
64
+ end
65
+ end
66
+
67
+ def csv *args
68
+ result, = Hashes.new(*args).to_sheet.produce
69
+ result
70
+ end
71
+
72
+ def xlsx *args
73
+ _, result = Hashes.new(*args).to_sheet.produce csv: false, xlsx: true
74
+ result
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,113 @@
1
+ require_relative 'helpers'
2
+
3
+ module SeeAsVee
4
+ class Sheet
5
+ CELL_ERROR_MARKER = '☣'.freeze
6
+ CELL_ERROR_STYLE = {
7
+ bg_color: "FF880000",
8
+ fg_color: "FFFFFFFF",
9
+ sz: 14,
10
+ border: { style: :thin, color: "FFFF0000" }
11
+ }.freeze
12
+
13
+ attr_reader :rows, :formatters, :checkers
14
+ def initialize whatever, formatters: {}, checkers: {}
15
+ @formatters = formatters.map { |k, v| [str_to_sym(k), v] }.to_h
16
+ @checkers = checkers.map { |k, v| [str_to_sym(k), v] }.to_h
17
+ @rows = whatever.is_a?(Array) ? whatever : Helpers.harvest_csv(whatever)
18
+
19
+ @rows = @rows.map.with_index do |row, idx|
20
+ idx.zero? ? row : plough_row(row)
21
+ end
22
+ end
23
+
24
+ def values
25
+ @rows[1..-1]
26
+ end
27
+
28
+ def headers symbolic = false
29
+ symbolic ? @rows.first.map { |s| str_to_sym s } : @rows.first
30
+ end
31
+
32
+ def [] index, key = nil
33
+ key.nil? ? values[index] : values[index][header_index(key)]
34
+ end
35
+
36
+ def each
37
+ return enum_for unless block_given?
38
+
39
+ values.each_with_index do |row, idx|
40
+ result = headers.zip(row).to_h
41
+ errors = result.select { |_, v| malformed?(v) }
42
+ yield idx, errors, result
43
+ end
44
+ end
45
+
46
+ def produce csv: true, xlsx: nil
47
+ [csv && produce_csv, xlsx && produce_xlsx]
48
+ end
49
+
50
+ private
51
+
52
+ def malformed? str
53
+ str.to_s =~ /\A#{CELL_ERROR_MARKER}/
54
+ end
55
+
56
+ def produce_csv
57
+ Tempfile.new(['see_as_vee', '.csv']).tap do |f|
58
+ CSV.open(f.path, "wb") do |content|
59
+ @rows.each { |row| content << row }
60
+ end
61
+ end
62
+ end
63
+
64
+ def produce_xlsx
65
+ Tempfile.new(['see_as_vee', '.xlsx']).tap do |f|
66
+ Axlsx::Package.new do |p|
67
+ red = p.workbook.styles.add_style(**CELL_ERROR_STYLE)
68
+ p.workbook.add_worksheet(name: 'Processing errors shown in red') do |sheet|
69
+ @rows.each { |row| sheet.add_row row, style: row.map { |cell| malformed?(cell) ? red : nil } }
70
+ end
71
+ p.serialize(f.path)
72
+ end
73
+ end
74
+ end
75
+
76
+ def header_index key
77
+ headers(true).index(str_to_sym(key))
78
+ end
79
+
80
+ def str_to_sym str
81
+ str.is_a?(Symbol) ? str : str.downcase.gsub(/\W/, '_').to_sym
82
+ end
83
+
84
+ def plough_row row
85
+ return row if @formatters.empty? && @checkers.empty? # performance
86
+
87
+ row.map.with_index do |cell, i|
88
+ cell = format_cell(cell, i) unless @formatters.empty?
89
+ cell = check_cell(cell, i) unless @checkers.empty?
90
+ cell
91
+ end
92
+ end
93
+
94
+ def format_cell cell, i
95
+ case f = @formatters[headers(true)[i]]
96
+ when Proc then f.call(cell)
97
+ when Symbol then cell.public_send f
98
+ else cell
99
+ end
100
+ end
101
+
102
+ # rubocop:disable Style/MultilineTernaryOperator
103
+ def check_cell cell, i
104
+ f = @checkers[headers(true)[i]]
105
+ case f
106
+ when Proc then f.call(cell)
107
+ when Symbol then cell.public_send(f)
108
+ else true
109
+ end ? cell : CELL_ERROR_MARKER + cell.to_s.split('').map { |c| "#{c}\u0336" }.join
110
+ end
111
+ # rubocop:enable Style/MultilineTernaryOperator
112
+ end
113
+ end
@@ -0,0 +1,3 @@
1
+ module SeeAsVee
2
+ VERSION = "0.2.0"
3
+ end
data/lib/see_as_vee.rb ADDED
@@ -0,0 +1,39 @@
1
+ require 'filemagic'
2
+ require 'axlsx'
3
+ require 'simple_xlsx_reader'
4
+ require 'csv'
5
+
6
+ require "see_as_vee/version"
7
+ require "see_as_vee/exceptions"
8
+
9
+ require "see_as_vee/helpers"
10
+ require "see_as_vee/sheet"
11
+
12
+ require "see_as_vee/producers/hashes"
13
+
14
+ module SeeAsVee
15
+ def harvest whatever, formatters: {}, checkers: {}
16
+ sheet = SeeAsVee::Sheet.new whatever, formatters: formatters, checkers: checkers
17
+ return sheet.each unless block_given?
18
+
19
+ sheet.each(&Proc.new)
20
+ sheet
21
+ end
22
+ module_function :harvest
23
+
24
+ def csv *args
25
+ SeeAsVee::Producers::Hashes.csv(*args)
26
+ end
27
+ module_function :csv
28
+
29
+ def xlsx *args
30
+ SeeAsVee::Producers::Hashes.xlsx(*args)
31
+ end
32
+ module_function :xlsx
33
+ end
34
+
35
+ class String
36
+ def harvest_csv formatters: {}, checkers: {}
37
+ SeeAsVee.harvest self, formatters: formatters, checkers: checkers
38
+ end
39
+ end
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'see_as_vee/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'see_as_vee'
8
+ spec.version = SeeAsVee::VERSION
9
+ spec.authors = ['Aleksei Matiushkin']
10
+ spec.email = ['aleksei.matiushkin@kantox.com']
11
+
12
+ spec.summary = 'Really easy CSV/XLSX reader/writer.'
13
+ spec.description = 'Load CSV/XLSX, check it, format it and spit it back to the user with a single command.'
14
+ spec.homepage = 'https://kantox.com'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
20
+
21
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ spec.bindir = 'bin'
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ['lib']
27
+
28
+ spec.add_dependency 'simple_xlsx_reader'
29
+ spec.add_dependency 'axlsx'
30
+ spec.add_dependency 'ruby-filemagic'
31
+ spec.add_dependency 'mutations', '~> 0.7'
32
+
33
+ spec.add_development_dependency 'bundler', '~> 1.10'
34
+ spec.add_development_dependency 'rake', '~> 10.0'
35
+ spec.add_development_dependency 'rspec'
36
+ spec.add_development_dependency 'pry'
37
+ spec.add_development_dependency 'awesome_print'
38
+ end
metadata ADDED
@@ -0,0 +1,191 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: see_as_vee
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Aleksei Matiushkin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: simple_xlsx_reader
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: axlsx
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-filemagic
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mutations
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.7'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: awesome_print
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: Load CSV/XLSX, check it, format it and spit it back to the user with
140
+ a single command.
141
+ email:
142
+ - aleksei.matiushkin@kantox.com
143
+ executables: []
144
+ extensions: []
145
+ extra_rdoc_files: []
146
+ files:
147
+ - ".gitignore"
148
+ - ".rspec"
149
+ - ".rubocop.yml"
150
+ - ".rubocop_todo.yml"
151
+ - ".travis.yml"
152
+ - CODE_OF_CONDUCT.md
153
+ - Gemfile
154
+ - LICENSE.txt
155
+ - README.md
156
+ - Rakefile
157
+ - bin/console
158
+ - bin/setup
159
+ - lib/see_as_vee.rb
160
+ - lib/see_as_vee/exceptions.rb
161
+ - lib/see_as_vee/helpers.rb
162
+ - lib/see_as_vee/producers/hashes.rb
163
+ - lib/see_as_vee/sheet.rb
164
+ - lib/see_as_vee/version.rb
165
+ - see_as_vee.gemspec
166
+ homepage: https://kantox.com
167
+ licenses:
168
+ - MIT
169
+ metadata:
170
+ allowed_push_host: https://rubygems.org
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubyforge_project:
187
+ rubygems_version: 2.4.8
188
+ signing_key:
189
+ specification_version: 4
190
+ summary: Really easy CSV/XLSX reader/writer.
191
+ test_files: []