tableschema 1.0.2 → 1.0.4

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
  SHA256:
3
- metadata.gz: 69fad2bdd9eb1c16052eaa8e7d94935721b8b40d50c9d25760354d4f3875cb8d
4
- data.tar.gz: 642182b87bed0f569d47f93a6c74002e9c1610508cd5cceabc8be32fe5314f2a
3
+ metadata.gz: 5673159d49f406d03b040bd8dafcabaa8a95ca080e09efd8ec0cd55e29b61343
4
+ data.tar.gz: 6e8d2797825cbbefab12748669c23af71627b32ca1218609daf8e247094719af
5
5
  SHA512:
6
- metadata.gz: 07473330bf865ca8b1531e3994ea79ebdcdc3c311320776362c1c3baa52e8ae2bcd2b201f8d337e5e274fd1370a3873e32ba2dac37081ee3a980eecf27eb4cda
7
- data.tar.gz: c903e30b4311df2f5c27b4a4d21517572ded8ecc648fbfd9c70555e6b6c81c1445e1ee346cd91651e12a94d8b3475af3e8aaa0ddf016e7835a9e592fa2ed3f32
6
+ metadata.gz: 21dde94b56b75ee5fc6c64b8994abc6e9689948167d095e68197b9cc3a3fbbe50ec21d369669fabe7d0154bf673631594117cade95934e71946439970ced2e7b
7
+ data.tar.gz: 504678c0362c581de5c2d904781729cad61c8d09f0543aa6909ff68bec5142227af91bd96e2b242493a897769a164ec9ffffe553410b0b3ee34a0bc3488e4333
@@ -4,4 +4,4 @@ Please replace this line with full information about your idea or problem. If it
4
4
 
5
5
  ---
6
6
 
7
- Please preserve this line to notify @roll (maintainer of this repository)
7
+ Please preserve this line to notify @roll (lead of this repository)
@@ -4,4 +4,4 @@ Please replace this line with full information about your pull request. Make sur
4
4
 
5
5
  ---
6
6
 
7
- Please preserve this line to notify @roll (maintainer of this repository)
7
+ Please preserve this line to notify @roll (lead of this repository)
@@ -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 }}
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
- MAINTAINER := $(shell head -n 1 MAINTAINER.md)
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 master && git pull origin && git fetch -p
15
- git log --pretty=format:"%C(yellow)%h%Creset %s%Cgreen%d" --reverse -20
16
- @echo "Releasing v$(VERSION) in 10 seconds. Press <CTRL+C> to abort" && sleep 10
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*)/@$(MAINTAINER)/" .github/issue_template.md
22
- sed -i -E "s/@(\w*)/@$(MAINTAINER)/" .github/pull_request_template.md
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
- [![Travis](https://travis-ci.org/frictionlessdata/tableschema-rb.svg?branch=master)](https://travis-ci.org/frictionlessdata/tableschema-rb)
4
- [![Coveralls](https://coveralls.io/repos/github/frictionlessdata/tableschema-rb/badge.svg?branch=master)](https://coveralls.io/github/frictionlessdata/tableschema-rb?branch=master)
5
- [![Gem Version](http://img.shields.io/gem/v/tableschema.svg)](https://rubygems.org/gems/tableschema)
6
- [![SemVer](https://img.shields.io/badge/versions-SemVer-brightgreen.svg)](http://semver.org/)
7
- [![Gitter](https://img.shields.io/gitter/room/frictionlessdata/chat.svg)](https://gitter.im/frictionlessdata/chat)
3
+ [![Build](https://img.shields.io/github/workflow/status/frictionlessdata/tableschema-rb/general/main)](https://github.com/frictionlessdata/tableschema-rb/actions)
4
+ [![Coverage](https://img.shields.io/codecov/c/github/frictionlessdata/tableschema-rb/main)](https://codecov.io/gh/frictionlessdata/tableschema-rb)
5
+ [![Release](http://img.shields.io/gem/v/tableschema.svg)](https://rubygems.org/gems/tableschema)
6
+ [![Codebase](https://img.shields.io/badge/codebase-github-brightgreen)](https://github.com/frictionlessdata/tableschema-rb)
7
+ [![Support](https://img.shields.io/badge/support-discord-brightgreen)](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/master/spec/fixtures/simple_data.csv'
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/master/spec/fixtures/simple_data.csv' # Can also be a url or array of arrays
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()
@@ -41,5 +41,13 @@ module TableSchema
41
41
  }
42
42
  end
43
43
 
44
+ def read_file(descriptor)
45
+ if (descriptor =~ /http/) != 0
46
+ File.open(descriptor).read
47
+ else
48
+ URI.parse(descriptor).open.read
49
+ end
50
+ end
51
+
44
52
  end
45
53
  end
@@ -145,7 +145,7 @@ module TableSchema
145
145
  descriptor
146
146
  elsif descriptor.class == String
147
147
  begin
148
- JSON.parse(open(descriptor).read, symbolize_names: true)
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
@@ -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) : open(csv)
71
- CSV.new(csv, @csv_options)
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)
@@ -1,3 +1,3 @@
1
1
  module TableSchema
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.0.4".freeze
3
3
  end
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.11"
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", "~> 5.1.0"
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.2
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: 2019-10-18 00:00:00.000000000 Z
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.11'
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.11'
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: 5.1.0
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: 5.1.0
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
- rubyforge_project:
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