airrecord 1.0.0 → 1.0.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
  SHA256:
3
- metadata.gz: 52a1efc847fab74c1bd0ff89814a274b1eb789359efda52a71675b6e7602f362
4
- data.tar.gz: cb766b78e31e88ed253c2f7d7f2f7a1166fb5fec61bdbf46602b20b76a43cf9c
3
+ metadata.gz: 534c1f26e6248221487da3863fd700cb426b937cf26ece866a56c453f2bb70e9
4
+ data.tar.gz: dcfd2eaae567f63143fb2e2a4148faad1fd142bad54a16e3c9791b225c350b08
5
5
  SHA512:
6
- metadata.gz: ee40920b905e08644f8de12241b3bd842bac654b396c71e68677d8eec53b6f67f2fec17841754c9841e61542ac9f5de83c420141efc198cc2309d7d4fbbf0629
7
- data.tar.gz: 64de96b6d7b81a8b9e147aa6adbf81402a5a6c1c5e23b681807df3cd408e420dfe065beb15135ad63706bf5899539cd979792afac9c8971aa21281fb55cce9d5
6
+ metadata.gz: ef4e7f2a364a4a489c6eed6f7750855e118afcab19f1511bda87217a252b7d1f0a8bce1669aaf3ced875c4ea76c0629052ea2fbfec2dcf3e10e0320e789ff9d0
7
+ data.tar.gz: 2845f143db4a202f050c5382a4b2596296ef725a40004ddc779e35e74d78ba025914c3294411043ddfcbd8351d045368c0dcfdc1bfc87c87dcefe7d6d76bc7ed
@@ -1,3 +1,7 @@
1
+ # 1.0.1
2
+ * Support JRuby 9.0 and CRuby 2.2 (#47)
3
+ * Fix $stderr warnings in CRurby > 2.3 (#46)
4
+
1
5
  # 1.0.0
2
6
 
3
7
  * 1.0.0 introduces breaking changes, including removing support for symbols and
data/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  Airrecord is an alternative Airtable Ruby libary to
4
4
  [`airtable-ruby`](https://github.com/airtable/airtable-ruby). Airrecord attempts
5
5
  to enforce a more [database-like API to
6
- Airtable](http://sirupsen.com/minimum-viable-airtable/).
6
+ Airtable](http://sirupsen.com/minimum-viable-airtable/). However, there's also
7
+ an [ad-hoc API available](https://github.com/sirupsen/airrecord#ad-hoc-api) that
8
+ skips the class definitions!
7
9
 
8
10
  You can add this line to your Gemfile to use Airrecord:
9
11
 
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
+ spec.required_ruby_version = '>= 2.2'
21
22
 
22
23
  spec.add_dependency 'faraday', '~> 0.10'
23
24
  spec.add_dependency "net-http-persistent", '~> 2.9'
@@ -20,8 +20,6 @@ module Airrecord
20
20
  end
21
21
 
22
22
  module Encodings
23
- using QueryString
24
-
25
23
  def self.[](value)
26
24
  TYPES.fetch(value.class, DEFAULT)
27
25
  end
@@ -1,13 +1,18 @@
1
1
  module Airrecord
2
2
  class Table
3
3
  class << self
4
- attr_accessor :base_key, :table_name, :api_key, :associations
4
+ attr_accessor :base_key, :table_name
5
+ attr_writer :api_key
5
6
 
6
7
  def client
7
8
  @@clients ||= {}
8
9
  @@clients[api_key] ||= Client.new(api_key)
9
10
  end
10
11
 
12
+ def api_key
13
+ defined?(@api_key) ? @api_key : Airrecord.api_key
14
+ end
15
+
11
16
  def has_many(method_name, options)
12
17
  define_method(method_name.to_sym) do
13
18
  # Get association ids in reverse order, because Airtable’s UI and API
@@ -28,10 +33,6 @@ module Airrecord
28
33
 
29
34
  alias has_one belongs_to
30
35
 
31
- def api_key
32
- @api_key || Airrecord.api_key
33
- end
34
-
35
36
  def find(id)
36
37
  response = client.connection.get("/v0/#{base_key}/#{client.escape(table_name)}/#{id}")
37
38
  parsed_response = client.parse(response.body)
@@ -208,11 +209,11 @@ module Airrecord
208
209
 
209
210
  def validate_key(key)
210
211
  return true unless key.is_a?(Symbol)
211
- raise Error, <<~MSG
212
- Airrecord 1.0 dropped support for Symbols as field names.
213
- Please use the full column name, a String, instead.
214
- You might try: record['#{key.to_s.gsub('_', ' ')}']
215
- MSG
212
+ raise(Error, [
213
+ "Airrecord 1.0 dropped support for Symbols as field names.",
214
+ "Please use the raw field name, a String, instead.",
215
+ "You might try: record['#{key.to_s.tr('_', ' ')}']"
216
+ ].join("\n"))
216
217
  end
217
218
  end
218
219
 
@@ -1,3 +1,3 @@
1
1
  module Airrecord
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airrecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Eskildsen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-14 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: '0'
132
+ version: '2.2'
133
133
  required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - ">="