tableschema 1.0.1 → 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 +7 -0
- data/.github/pull_request_template.md +7 -0
- data/.github/stale.yml +23 -0
- data/.github/workflows/general.yml +60 -0
- data/LEAD.md +1 -0
- data/Makefile +26 -0
- data/README.md +7 -7
- data/bin/console +0 -0
- 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 +15 -10
- 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/stale.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
2
|
+
daysUntilStale: 90
|
3
|
+
|
4
|
+
# Number of days of inactivity before a stale issue is closed
|
5
|
+
daysUntilClose: 30
|
6
|
+
|
7
|
+
# Issues with these labels will never be considered stale
|
8
|
+
exemptLabels:
|
9
|
+
- feature
|
10
|
+
- enhancement
|
11
|
+
- bug
|
12
|
+
|
13
|
+
# Label to use when marking an issue as stale
|
14
|
+
staleLabel: wontfix
|
15
|
+
|
16
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
17
|
+
markComment: >
|
18
|
+
This issue has been automatically marked as stale because it has not had
|
19
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
20
|
+
for your contributions.
|
21
|
+
|
22
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
23
|
+
closeComment: false
|
@@ -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/LEAD.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
roll
|
data/Makefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
.PHONY: all list release templates version
|
2
|
+
|
3
|
+
|
4
|
+
VERSION := $(shell cat lib/tableschema/version.rb | awk -F\" '{ print $$2 }' | xargs)
|
5
|
+
LEAD := $(shell head -n 1 LEAD.md)
|
6
|
+
|
7
|
+
|
8
|
+
all: list
|
9
|
+
|
10
|
+
list:
|
11
|
+
@grep '^\.PHONY' Makefile | cut -d' ' -f2- | tr ' ' '\n'
|
12
|
+
|
13
|
+
release:
|
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
|
18
|
+
git commit -a -m 'v$(VERSION)' && git tag -a v$(VERSION) -m 'v$(VERSION)'
|
19
|
+
git push --follow-tags
|
20
|
+
|
21
|
+
templates:
|
22
|
+
sed -i -E "s/@(\w*)/@$(LEAD)/" .github/issue_template.md
|
23
|
+
sed -i -E "s/@(\w*)/@$(LEAD)/" .github/pull_request_template.md
|
24
|
+
|
25
|
+
version:
|
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/bin/console
CHANGED
File without changes
|
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
|
@@ -171,14 +171,19 @@ executables: []
|
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
|
+
- ".github/issue_template.md"
|
175
|
+
- ".github/pull_request_template.md"
|
176
|
+
- ".github/stale.yml"
|
177
|
+
- ".github/workflows/general.yml"
|
174
178
|
- ".gitignore"
|
175
179
|
- ".rspec"
|
176
180
|
- ".rubocop.yml"
|
177
|
-
- ".travis.yml"
|
178
181
|
- CHANGELOG.md
|
179
182
|
- CODE_OF_CONDUCT.md
|
180
183
|
- Gemfile
|
184
|
+
- LEAD.md
|
181
185
|
- LICENSE.txt
|
186
|
+
- Makefile
|
182
187
|
- README.md
|
183
188
|
- Rakefile
|
184
189
|
- bin/console
|
@@ -240,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
245
|
- !ruby/object:Gem::Version
|
241
246
|
version: '0'
|
242
247
|
requirements: []
|
243
|
-
rubygems_version: 3.
|
248
|
+
rubygems_version: 3.3.7
|
244
249
|
signing_key:
|
245
250
|
specification_version: 4
|
246
251
|
summary: A Ruby library for working with Table Schema. Formerly known as 'jsontableschema'
|
data/.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: 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
|