csvpp 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96198044193b9b7a62d2e35810217bfc5b603c7b
4
- data.tar.gz: c5f025bd90f45294986eb3892c5db6d81f2b5498
3
+ metadata.gz: 880efa52b42f34d49e6aeeb59cfb05211f274ff6
4
+ data.tar.gz: 226688ad42678fdca218b2a2fcd047d08846aa62
5
5
  SHA512:
6
- metadata.gz: 3b35fd7ed568851367faf5b16c329271fa4d7d5935161037ceb1e8fba739d84515c8fec63c0382394156914e3d6eb2d4116b3c75ed0a88986e6554487b3b16db
7
- data.tar.gz: 211dc3241614ba542156221574054264528a2baed9f99c8875c3e01d041d0a04065723cb5bc5e4cf04f539822131c96ed92789fdf3d4c72c152cbab55d7a0830
6
+ metadata.gz: 6b030f48cec237f995f2b1fec2912a0229cd6e0b224bbdac5cc007ff7db2121f0d7f8e0c79fae96c4eeabbb54d9f4c8b541bb410a60dbe632e4f1ef049bae795
7
+ data.tar.gz: 72c4d7c77acb0d0bffb903f1236e031434d5b8116ce73167f0be94f6b58d5033944427fca2c5fc39ec1e45f07ecead446f4375833e29b6e2e87336303a323415
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- csvpp (0.3.0)
4
+ csvpp (0.3.1)
5
5
  oj (~> 3.3.9)
6
- sinatra (~> 2.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
@@ -12,7 +11,6 @@ GEM
12
11
  coderay (1.1.2)
13
12
  method_source (0.9.0)
14
13
  minitest (5.10.3)
15
- mustermann (1.0.1)
16
14
  oj (3.3.10)
17
15
  pry (0.11.3)
18
16
  coderay (~> 1.1.0)
@@ -23,16 +21,7 @@ GEM
23
21
  pry-doc (0.11.1)
24
22
  pry (~> 0.9)
25
23
  yard (~> 0.9)
26
- rack (2.0.3)
27
- rack-protection (2.0.0)
28
- rack
29
24
  rake (12.3.0)
30
- sinatra (2.0.0)
31
- mustermann (~> 1.0)
32
- rack (~> 2.0)
33
- rack-protection (= 2.0.0)
34
- tilt (~> 2.0)
35
- tilt (2.0.8)
36
25
  yard (0.9.11)
37
26
 
38
27
  PLATFORMS
data/README.md CHANGED
@@ -14,11 +14,15 @@ gem 'csvpp'
14
14
 
15
15
  And then execute:
16
16
 
17
- $ bundle
17
+ ```
18
+ $ bundle
19
+ ```
18
20
 
19
21
  Or install it yourself as:
20
22
 
21
- $ gem install csvpp
23
+ ```
24
+ $ gem install csvpp
25
+ ```
22
26
 
23
27
  ## Usage
24
28
 
@@ -29,6 +33,41 @@ CSVPP.parse(
29
33
  ) # => [{"v1"=>34, "line_number"=>1, "v2"=>"foobar"}, {"v1"=>99, "line_number"=>2, "v2"=>"hi there"}]
30
34
  ```
31
35
 
36
+ ### CLI
37
+
38
+ CSV++ comes with a CLI. To print a JSON representation of an input file, pass a
39
+ file argument and provide a format specification file with `-f`, e.g.:
40
+
41
+ ```
42
+ $ csvpp test/sample_inputs/simple.txt -f test/sample_formats/simple.json
43
+
44
+ {
45
+ "vars": [
46
+ {
47
+ "line_number": 1,
48
+ "v1": 34,
49
+ "v2": "foobar",
50
+ "v3": 1.1,
51
+ "v4": false
52
+ },
53
+ {
54
+ "line_number": 2,
55
+ "v1": 99,
56
+ "v2": "hi there",
57
+ "v3": 2.2,
58
+ "v4": true
59
+ },
60
+ {
61
+ "line_number": 3,
62
+ "v1": null,
63
+ "v2": "Missing",
64
+ "v3": null,
65
+ "v4": true
66
+ }
67
+ ]
68
+ }
69
+ ```
70
+
32
71
  ## Development
33
72
 
34
73
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
data/csvpp.gemspec CHANGED
@@ -30,7 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency 'sinatra', '~> 2.0'
34
33
  spec.add_dependency 'oj', '~> 3.3.9'
35
34
 
36
35
  spec.add_development_dependency "bundler"
data/lib/csvpp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CSVPP
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvpp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SwissDRG AG
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-22 00:00:00.000000000 Z
11
+ date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: sinatra
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: oj
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -141,30 +127,13 @@ files:
141
127
  - Rakefile
142
128
  - bin/console
143
129
  - bin/setup
144
- - config.ru
145
130
  - csvpp.gemspec
146
131
  - exe/csvpp
147
132
  - lib/csvpp.rb
148
- - lib/csvpp/api.rb
149
133
  - lib/csvpp/conversions.rb
150
134
  - lib/csvpp/format.rb
151
135
  - lib/csvpp/parser.rb
152
136
  - lib/csvpp/version.rb
153
- - ui/.gitignore
154
- - ui/README.md
155
- - ui/package.json
156
- - ui/public/favicon.ico
157
- - ui/public/index.html
158
- - ui/public/manifest.json
159
- - ui/src/App.css
160
- - ui/src/App.js
161
- - ui/src/App.test.js
162
- - ui/src/Editor.js
163
- - ui/src/index.css
164
- - ui/src/index.js
165
- - ui/src/logo.svg
166
- - ui/src/registerServiceWorker.js
167
- - ui/yarn.lock
168
137
  homepage: https://www.swissdrg.org
169
138
  licenses:
170
139
  - MIT
data/config.ru DELETED
@@ -1,4 +0,0 @@
1
- require 'csvpp'
2
- require 'csvpp/api'
3
-
4
- run CSVPP::API
data/lib/csvpp/api.rb DELETED
@@ -1,25 +0,0 @@
1
- require 'sinatra/base'
2
-
3
- module CSVPP
4
- class API < Sinatra::Base
5
- before do
6
- headers 'Access-Control-Allow-Origin' => '*'
7
-
8
- content_type :json
9
- end
10
-
11
- post '/parse' do
12
- body = Oj.load(request.body.read)
13
- input = body.fetch('input')
14
- format = body.fetch('format')
15
-
16
- CSVPP.json(input: input, format: format)
17
- end
18
-
19
- options "*" do
20
- response.headers["Allow"] = "HEAD,GET,PUT,POST,DELETE,OPTIONS"
21
- response.headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Cache-Control, Accept"
22
- 200
23
- end
24
- end
25
- end
data/ui/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
-
6
- # testing
7
- /coverage
8
-
9
- # production
10
- /build
11
-
12
- # misc
13
- .DS_Store
14
- .env.local
15
- .env.development.local
16
- .env.test.local
17
- .env.production.local
18
-
19
- npm-debug.log*
20
- yarn-debug.log*
21
- yarn-error.log*