tableschema 1.0.2 → 1.0.4
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.
- checksums.yaml +4 -4
- data/.github/issue_template.md +1 -1
- data/.github/pull_request_template.md +1 -1
- data/.github/workflows/general.yml +60 -0
- data/{MAINTAINER.md → LEAD.md} +0 -0
- data/Makefile +7 -6
- data/README.md +7 -7
- data/lib/tableschema/helpers.rb +8 -0
- data/lib/tableschema/schema.rb +1 -1
- data/lib/tableschema/table.rb +3 -3
- data/lib/tableschema/version.rb +1 -1
- data/tableschema.gemspec +2 -2
- metadata +11 -12
- data/.travis.yml +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5673159d49f406d03b040bd8dafcabaa8a95ca080e09efd8ec0cd55e29b61343
|
4
|
+
data.tar.gz: 6e8d2797825cbbefab12748669c23af71627b32ca1218609daf8e247094719af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21dde94b56b75ee5fc6c64b8994abc6e9689948167d095e68197b9cc3a3fbbe50ec21d369669fabe7d0154bf673631594117cade95934e71946439970ced2e7b
|
7
|
+
data.tar.gz: 504678c0362c581de5c2d904781729cad61c8d09f0543aa6909ff68bec5142227af91bd96e2b242493a897769a164ec9ffffe553410b0b3ee34a0bc3488e4333
|
data/.github/issue_template.md
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
name: general
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
tags:
|
8
|
+
- v*.*.*
|
9
|
+
pull_request:
|
10
|
+
branches:
|
11
|
+
- main
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
|
15
|
+
# Test
|
16
|
+
|
17
|
+
test:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
strategy:
|
20
|
+
matrix:
|
21
|
+
ruby-version: [2.4]
|
22
|
+
steps:
|
23
|
+
- name: Checkout repository
|
24
|
+
uses: actions/checkout@v2
|
25
|
+
- name: Install Ruby
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby-version }}
|
29
|
+
- name: Install dependencies
|
30
|
+
run: |
|
31
|
+
gem install bundler -v 1.11.2
|
32
|
+
bundle
|
33
|
+
- name: Test software
|
34
|
+
run: rake spec
|
35
|
+
- name: Report coverage
|
36
|
+
uses: codecov/codecov-action@v1
|
37
|
+
|
38
|
+
# Release
|
39
|
+
|
40
|
+
release:
|
41
|
+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
42
|
+
runs-on: ubuntu-latest
|
43
|
+
needs: [test]
|
44
|
+
steps:
|
45
|
+
- name: Checkout repository
|
46
|
+
uses: actions/checkout@v2
|
47
|
+
- name: Install Ruby
|
48
|
+
uses: ruby/setup-ruby@v1
|
49
|
+
with:
|
50
|
+
ruby-version: 2.4
|
51
|
+
- name: Release Gem
|
52
|
+
uses: cadwallion/publish-rubygems-action@master
|
53
|
+
env:
|
54
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
55
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
56
|
+
RELEASE_COMMAND: rake release
|
57
|
+
- name: Release to GitHub
|
58
|
+
uses: softprops/action-gh-release@v1
|
59
|
+
env:
|
60
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/{MAINTAINER.md → LEAD.md}
RENAMED
File without changes
|
data/Makefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
VERSION := $(shell cat lib/tableschema/version.rb | awk -F\" '{ print $$2 }' | xargs)
|
5
|
-
|
5
|
+
LEAD := $(shell head -n 1 LEAD.md)
|
6
6
|
|
7
7
|
|
8
8
|
all: list
|
@@ -11,15 +11,16 @@ list:
|
|
11
11
|
@grep '^\.PHONY' Makefile | cut -d' ' -f2- | tr ' ' '\n'
|
12
12
|
|
13
13
|
release:
|
14
|
-
git checkout
|
15
|
-
|
16
|
-
@
|
14
|
+
git checkout main && git pull origin && git fetch -p && git diff
|
15
|
+
@echo "\nContinuing in 10 seconds. Press <CTRL+C> to abort\n" && sleep 10
|
16
|
+
@git log --pretty=format:"%C(yellow)%h%Creset %s%Cgreen%d" --reverse -20
|
17
|
+
@echo "\nReleasing v$(VERSION) in 10 seconds. Press <CTRL+C> to abort\n" && sleep 10
|
17
18
|
git commit -a -m 'v$(VERSION)' && git tag -a v$(VERSION) -m 'v$(VERSION)'
|
18
19
|
git push --follow-tags
|
19
20
|
|
20
21
|
templates:
|
21
|
-
sed -i -E "s/@(\w*)/@$(
|
22
|
-
sed -i -E "s/@(\w*)/@$(
|
22
|
+
sed -i -E "s/@(\w*)/@$(LEAD)/" .github/issue_template.md
|
23
|
+
sed -i -E "s/@(\w*)/@$(LEAD)/" .github/pull_request_template.md
|
23
24
|
|
24
25
|
version:
|
25
26
|
@echo $(VERSION)
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# tableschema-rb
|
2
2
|
|
3
|
-
[](https://github.com/frictionlessdata/tableschema-rb/actions)
|
4
|
+
[](https://codecov.io/gh/frictionlessdata/tableschema-rb)
|
5
|
+
[](https://rubygems.org/gems/tableschema)
|
6
|
+
[](https://github.com/frictionlessdata/tableschema-rb)
|
7
|
+
[](https://discordapp.com/invite/Sewv6av)
|
8
8
|
|
9
9
|
A utility library for working with [Table Schema](https://specs.frictionlessdata.io/table-schema/) in Ruby.
|
10
10
|
|
@@ -74,7 +74,7 @@ schema = {
|
|
74
74
|
]
|
75
75
|
}
|
76
76
|
|
77
|
-
source = 'https://github.com/frictionlessdata/tableschema-rb/raw/
|
77
|
+
source = 'https://github.com/frictionlessdata/tableschema-rb/raw/main/spec/fixtures/simple_data.csv'
|
78
78
|
|
79
79
|
table = TableSchema::Table.new(source, schema: schema)
|
80
80
|
|
@@ -99,7 +99,7 @@ Both `iter` and `read` take the optional parameters:
|
|
99
99
|
If you don't have a schema for a CSV, and want to generate one, you can infer a schema like so:
|
100
100
|
|
101
101
|
```ruby
|
102
|
-
source = 'https://github.com/frictionlessdata/tableschema-rb/raw/
|
102
|
+
source = 'https://github.com/frictionlessdata/tableschema-rb/raw/main/spec/fixtures/simple_data.csv' # Can also be a url or array of arrays
|
103
103
|
|
104
104
|
table = TableSchema::Table.new(source)
|
105
105
|
table.infer()
|
data/lib/tableschema/helpers.rb
CHANGED
data/lib/tableschema/schema.rb
CHANGED
@@ -145,7 +145,7 @@ module TableSchema
|
|
145
145
|
descriptor
|
146
146
|
elsif descriptor.class == String
|
147
147
|
begin
|
148
|
-
JSON.parse(
|
148
|
+
JSON.parse(read_file(descriptor), symbolize_names: true)
|
149
149
|
rescue Errno::ENOENT
|
150
150
|
raise SchemaException.new("File not found at `#{descriptor}`")
|
151
151
|
rescue OpenURI::HTTPError => e
|
data/lib/tableschema/table.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module TableSchema
|
2
2
|
class Table
|
3
|
-
|
3
|
+
include TableSchema::Helpers
|
4
4
|
# Public
|
5
5
|
|
6
6
|
attr_reader :headers, :schema
|
@@ -67,8 +67,8 @@ module TableSchema
|
|
67
67
|
private
|
68
68
|
|
69
69
|
def parse_csv(csv)
|
70
|
-
csv = csv.is_a?(Array) ? StringIO.new(array_to_csv csv) :
|
71
|
-
CSV.new(csv,
|
70
|
+
csv = csv.is_a?(Array) ? StringIO.new(array_to_csv csv) : read_file(csv)
|
71
|
+
CSV.new(csv, **@csv_options)
|
72
72
|
end
|
73
73
|
|
74
74
|
def array_to_csv(array)
|
data/lib/tableschema/version.rb
CHANGED
data/tableschema.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1
|
21
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
23
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
24
|
spec.add_development_dependency "pry", "~> 0.10.0"
|
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "json-schema", "~> 2.8.0"
|
30
30
|
spec.add_dependency "uuid", "~> 2.3.8"
|
31
31
|
spec.add_dependency "tod", "~> 2.1.0"
|
32
|
-
spec.add_dependency "activesupport"
|
32
|
+
spec.add_dependency "activesupport" #, "~> 5.1.0"
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tableschema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Open Knowledge Foundation
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: activesupport
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: '0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: '0'
|
167
167
|
description:
|
168
168
|
email:
|
169
169
|
- info@okfn.org
|
@@ -174,15 +174,15 @@ files:
|
|
174
174
|
- ".github/issue_template.md"
|
175
175
|
- ".github/pull_request_template.md"
|
176
176
|
- ".github/stale.yml"
|
177
|
+
- ".github/workflows/general.yml"
|
177
178
|
- ".gitignore"
|
178
179
|
- ".rspec"
|
179
180
|
- ".rubocop.yml"
|
180
|
-
- ".travis.yml"
|
181
181
|
- CHANGELOG.md
|
182
182
|
- CODE_OF_CONDUCT.md
|
183
183
|
- Gemfile
|
184
|
+
- LEAD.md
|
184
185
|
- LICENSE.txt
|
185
|
-
- MAINTAINER.md
|
186
186
|
- Makefile
|
187
187
|
- README.md
|
188
188
|
- Rakefile
|
@@ -245,8 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
245
|
- !ruby/object:Gem::Version
|
246
246
|
version: '0'
|
247
247
|
requirements: []
|
248
|
-
|
249
|
-
rubygems_version: 2.7.7
|
248
|
+
rubygems_version: 3.3.7
|
250
249
|
signing_key:
|
251
250
|
specification_version: 4
|
252
251
|
summary: A Ruby library for working with Table Schema. Formerly known as 'jsontableschema'
|
data/.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
language:
|
2
|
-
ruby
|
3
|
-
|
4
|
-
rvm:
|
5
|
-
- 2.3.3
|
6
|
-
- 2.4.0
|
7
|
-
|
8
|
-
before_install:
|
9
|
-
gem install bundler -v 1.11.2
|
10
|
-
|
11
|
-
install:
|
12
|
-
- bundle
|
13
|
-
- gem install rubocop
|
14
|
-
|
15
|
-
script:
|
16
|
-
- rake spec
|
17
|
-
|
18
|
-
after_success:
|
19
|
-
- rubocop
|
20
|
-
|
21
|
-
deploy:
|
22
|
-
provider: rubygems
|
23
|
-
api_key:
|
24
|
-
secure: ZOvsryo3ZRUom+YBwpYrqLOQ8Sa/BSmp3igu4k5RcLOIVYwGgN1lLgeleKvFJHbuPwauFOdD3XsoOiHHM6D4d1YvgmSuQROU4Z4zyuGb2vnnAxhvwTvFjecSKVJk+mcvel1EjP+Az0UH2Oom3Dctp+oCpdtJQ3D0tDmvHmJhRQOQJcAhwiXKUMadF6vWvmzHkkaYfxUIwh+Bd5gna2tSImPdX6E4MPba0Lpi+Afhl4Xu3OSRGx4q2NFPrdqqRJj4dqASXREP562VBiiSBvZR/c+2E5MDSUK4J6aUTxaRQKYXN5tDsiXFW6FLc77KS2jYXxPZSsktP80Ms1BYhr1W8pWKBFEJW96uShrIYbyWdkYjqozPShxMl84+cTl+UqtmE7TJSVZClGBz2b1qUgtME2IAjMElR9a/qwCfHzltqitSWvlEvdWrHgd8iIkTuBCKYBgTQeS++zFWLvIOdDSiAHGOE0w2bTL2c53viBn1cRYYpMJR8kOBRjipytBjqzWXQGQi1WYmpD8+J03KHzSCfZolZBqeClcaL2e2ggEaWUH4FIyVk2Df5Rs5MQwXwrb3mFnddetRTHGBhONv1SJ43uBbe/F1y7HVPJeW2/1gg3Gfj4iw/9kdq+KjHJEETQJXVXaKAMiDfzXfNfkLBk8RgLFepfIp13F38myMCWnvtyg=
|
25
|
-
gem: tableschema
|
26
|
-
on:
|
27
|
-
tags: true
|
28
|
-
repo: frictionlessdata/tableschema-rb
|