airtable2 0.2.1 → 0.2.2

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: 0fb935ffab4d6e71ec8d1d5b2dc3d333e8e594694efa066cdfb5b9cc2bc127c6
4
- data.tar.gz: 5df0a4d75e41a62e7e37083ebe86a8a907424bdc07b85415fd3322ee97c31564
3
+ metadata.gz: 8f8968193253823a000c9f38c14185208b89a4dfd77d9ff6ab0a5b5f8b3f595e
4
+ data.tar.gz: 06c31cfbcc19f156ab7e498e7e6b6f9f0ca4b749aecb523124f85df7d8a452c2
5
5
  SHA512:
6
- metadata.gz: c685dbee77e83356da763e04a4d21cd9045f590790fa1a07a3311fffa5e57f35a46c6ccad9a48763dcf42a6b056ab71421ff8303853f8e50f12e08ea6b03ed50
7
- data.tar.gz: 2a4ca8fc25b2dd248c36f5256ce3c7d57d087ada7048aa41276b20e7deb058e79e60800bcd30b71fe421dfe149fa28038b6240f3f078163c0a0367ef2ca4a0d7
6
+ metadata.gz: 6bbbc8e341a9a16969df15e605d0e379138915066968abd3581b635d6bf66349526ae7f88d483384a5248f6f72c97f1f85d32e2a4a7e3e49c223f339d07cedc0
7
+ data.tar.gz: f8f0c2a7f3400519a07082a7c1640ae80947c7d4c4143d6b0d82e50068c01176d0f3aaeeeee392d9926647574f65185fc69382a147fa68b0bad4c2603dc2f59d
data/README.md CHANGED
@@ -10,7 +10,7 @@ This is a fork of an abandoned [previous wrapper](https://github.com/nesquena/ai
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
- gem 'airtable2', github: 'https://github.com/aseroff/airtable-ruby', branch: 'main'
13
+ gem 'airtable2'
14
14
 
15
15
  And then execute:
16
16
 
@@ -92,6 +92,10 @@ Or as a convenience, you can delete all records with the `dump` method
92
92
  @table.dump
93
93
  ```
94
94
 
95
+ ## Complete documentation
96
+
97
+ YARD-generated documentation is hosted on [GitHub Pages](https://aseroff.github.io/airtable-ruby/).
98
+
95
99
  ## Contributing
96
100
 
97
101
  1. Fork it ( https://github.com/aseroff/airtable-ruby/fork )
data/airtable.gemspec CHANGED
@@ -9,19 +9,17 @@ Gem::Specification.new do |spec|
9
9
  spec.version = Airtable::VERSION
10
10
  spec.authors = ['Andrew Seroff', 'Nathan Esquenazi', 'Alexander Sorokin']
11
11
  spec.email = ['andy@seroff.co']
12
- spec.summary = 'Easily connect to airtable data using ruby'
12
+ spec.summary = 'For when Airrecord is just too much.'
13
13
  spec.description = 'Easily connect to airtable data using ruby with access to all of the airtable features.'
14
14
  spec.homepage = 'https://github.com/aseroff/airtable-ruby'
15
15
  spec.license = 'MIT'
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0")
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(docs|test)/}) }
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.required_ruby_version = '>= 3.1'
22
- spec.add_dependency 'activesupport'
23
- spec.add_dependency 'httparty'
24
- spec.add_dependency 'json'
22
+ spec.add_dependency 'httparty', '>= 0.14.0'
25
23
 
26
24
  spec.add_development_dependency 'bundler'
27
25
  spec.add_development_dependency 'minitest'
@@ -30,7 +28,7 @@ Gem::Specification.new do |spec|
30
28
  spec.add_development_dependency 'rubocop-md'
31
29
  spec.add_development_dependency 'rubocop-minitest'
32
30
  spec.add_development_dependency 'rubocop-performance'
31
+ spec.add_development_dependency 'rubocop-rake'
33
32
  spec.add_development_dependency 'webmock'
34
- spec.add_development_dependency 'yard'
35
33
  spec.metadata['rubygems_mfa_required'] = 'true'
36
34
  end
data/lib/airtable/base.rb CHANGED
@@ -3,9 +3,8 @@
3
3
  # Object corresponding to an Airtable Base
4
4
  class Airtable::Base < Airtable::Resource
5
5
  def initialize(token, id)
6
- @token = token
6
+ super(token)
7
7
  @id = id
8
- self.class.headers({ 'Authorization': "Bearer #{@token}", 'Content-Type': 'application/json' })
9
8
  end
10
9
 
11
10
  # Expects {name:,description:,fields:[]}
@@ -38,6 +37,6 @@ class Airtable::Base < Airtable::Resource
38
37
 
39
38
  protected
40
39
 
41
- # Instantiate table in base
40
+ # Endpoint for bases
42
41
  def base_url = "/v0/meta/bases/#{@id}"
43
42
  end
@@ -2,11 +2,6 @@
2
2
 
3
3
  # Client carrying authorization token
4
4
  class Airtable::Client < Airtable::Resource
5
- def initialize(token)
6
- @token = token
7
- self.class.headers({ 'Authorization': "Bearer #{@token}", 'Content-Type': 'application/json' })
8
- end
9
-
10
5
  # @see https://airtable.com/developers/web/api/list-bases
11
6
  # @return [Array]<Airtable::Base>
12
7
  def bases
@@ -5,12 +5,11 @@ class Airtable::Record < Airtable::Resource
5
5
  attr_reader :fields
6
6
 
7
7
  def initialize(token, base_id, table_id, api_response)
8
- @token = token
8
+ super(token)
9
9
  @base_id = base_id
10
10
  @table_id = table_id
11
11
  api_response.deep_symbolize_keys.each do |key, value|
12
12
  instance_variable_set(:"@#{key}", value)
13
13
  end
14
- self.class.headers({ 'Authorization': "Bearer #{@token}", 'Content-Type': 'application/json' })
15
14
  end
16
15
  end
@@ -5,12 +5,11 @@ class Airtable::Table < Airtable::Resource
5
5
  attr_reader :name
6
6
 
7
7
  def initialize(token, base_id, api_response)
8
- @token = token
8
+ super(token)
9
9
  @base_id = base_id
10
10
  api_response.deep_symbolize_keys.each do |key, value|
11
11
  instance_variable_set(:"@#{key}", value)
12
12
  end
13
- self.class.headers({ 'Authorization': "Bearer #{@token}", 'Content-Type': 'application/json' })
14
13
  end
15
14
 
16
15
  # @see https://airtable.com/developers/web/api/list-records
@@ -52,6 +51,7 @@ class Airtable::Table < Airtable::Resource
52
51
  response['records'].map { Airtable::Record.new(@token, @base_id, @id, _1) }
53
52
  end
54
53
 
54
+ # @note API maximum of 10 records at a time
55
55
  # @see https://airtable.com/developers/web/api/delete-multiple-records
56
56
  # @return [Array] Deleted record ids
57
57
  def delete_records(record_ids)
@@ -73,5 +73,6 @@ class Airtable::Table < Airtable::Resource
73
73
 
74
74
  protected
75
75
 
76
+ # Endpoint for tables
76
77
  def table_url = "/v0/#{@base_id}/#{@id}"
77
78
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module Airtable
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airtable2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Seroff
@@ -10,50 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-10-26 00:00:00.000000000 Z
13
+ date: 2024-10-28 00:00:00.000000000 Z
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: activesupport
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- version: '0'
29
15
  - !ruby/object:Gem::Dependency
30
16
  name: httparty
31
17
  requirement: !ruby/object:Gem::Requirement
32
18
  requirements:
33
19
  - - ">="
34
20
  - !ruby/object:Gem::Version
35
- version: '0'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
- - !ruby/object:Gem::Dependency
44
- name: json
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '0'
21
+ version: 0.14.0
50
22
  type: :runtime
51
23
  prerelease: false
52
24
  version_requirements: !ruby/object:Gem::Requirement
53
25
  requirements:
54
26
  - - ">="
55
27
  - !ruby/object:Gem::Version
56
- version: '0'
28
+ version: 0.14.0
57
29
  - !ruby/object:Gem::Dependency
58
30
  name: bundler
59
31
  requirement: !ruby/object:Gem::Requirement
@@ -153,7 +125,7 @@ dependencies:
153
125
  - !ruby/object:Gem::Version
154
126
  version: '0'
155
127
  - !ruby/object:Gem::Dependency
156
- name: webmock
128
+ name: rubocop-rake
157
129
  requirement: !ruby/object:Gem::Requirement
158
130
  requirements:
159
131
  - - ">="
@@ -167,7 +139,7 @@ dependencies:
167
139
  - !ruby/object:Gem::Version
168
140
  version: '0'
169
141
  - !ruby/object:Gem::Dependency
170
- name: yard
142
+ name: webmock
171
143
  requirement: !ruby/object:Gem::Requirement
172
144
  requirements:
173
145
  - - ">="
@@ -195,27 +167,6 @@ files:
195
167
  - README.md
196
168
  - Rakefile
197
169
  - airtable.gemspec
198
- - docs/Airtable.html
199
- - docs/Airtable/Base.html
200
- - docs/Airtable/Client.html
201
- - docs/Airtable/Error.html
202
- - docs/Airtable/Record.html
203
- - docs/Airtable/Resource.html
204
- - docs/Airtable/Table.html
205
- - docs/_index.html
206
- - docs/class_list.html
207
- - docs/css/common.css
208
- - docs/css/full_list.css
209
- - docs/css/style.css
210
- - docs/file.README.html
211
- - docs/file_list.html
212
- - docs/frames.html
213
- - docs/index.html
214
- - docs/js/app.js
215
- - docs/js/full_list.js
216
- - docs/js/jquery.js
217
- - docs/method_list.html
218
- - docs/top-level-namespace.html
219
170
  - lib/airtable.rb
220
171
  - lib/airtable/base.rb
221
172
  - lib/airtable/client.rb
@@ -224,9 +175,6 @@ files:
224
175
  - lib/airtable/resource.rb
225
176
  - lib/airtable/table.rb
226
177
  - lib/airtable/version.rb
227
- - test/airtable_test.rb
228
- - test/record_test.rb
229
- - test/test_helper.rb
230
178
  homepage: https://github.com/aseroff/airtable-ruby
231
179
  licenses:
232
180
  - MIT
@@ -250,5 +198,5 @@ requirements: []
250
198
  rubygems_version: 3.5.21
251
199
  signing_key:
252
200
  specification_version: 4
253
- summary: Easily connect to airtable data using ruby
201
+ summary: For when Airrecord is just too much.
254
202
  test_files: []