fmrest 0.5.0 → 0.5.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: 61e4602ba4797de70a866ea14197056bd0d09ca0bab4d09e44ddade7719395ac
4
- data.tar.gz: 77982322ac28bef17e648888dc67753a56fb02c3b31e616d7d4129c6031ba676
3
+ metadata.gz: 79fff3279b30b2bf4ba228646218abc622366aa97f48b1a60eee06d1cea249c8
4
+ data.tar.gz: a7b9c8fb36117733176ec355e6e80ef6981ee0e990f1b42fb5721a0baca46ff4
5
5
  SHA512:
6
- metadata.gz: c872d1d1b37710720d0cd5398f985c1abc6d59105fe117905518d86f2617f82e539e743b8d57693bde34558381a500d32f1d942f240705db21d5415ca2c86f14
7
- data.tar.gz: e71b4ca034162ed34b847b66d7ae0063f3fa654be1a73ddf12c9f995ca62956a186737ca15ba06939d5982a3b62bab30c2ad7d125498b07024276a7b0518d00c
6
+ metadata.gz: 1e38235d837ddd968164256c78f64bab77ed9464c2f33ee69d4e4f5920d093eeea082b0547f544edc409c5416d470bdd13998b42cb1ac2c501a2f485709ff5a5
7
+ data.tar.gz: 813305093670cbe0a684f0d63d079e9a5d799373521099d6229cf22a4cf34d3107167ac5a6b8750bf6abd410bc24f89fd84ea7aacf040e696c8196e57d8f21b4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.5.1
4
+
5
+ * Alias `:username` option as `:account_name` for ginjo-rfm gem
6
+ cross-compatibility
7
+
3
8
  ### 0.5.0
4
9
 
5
10
  * Much improved script execution support
data/README.md CHANGED
@@ -3,19 +3,17 @@
3
3
  <a href="https://rubygems.org/gems/fmrest"><img src="https://badge.fury.io/rb/fmrest.svg?style=flat" alt="Gem Version"></a>
4
4
 
5
5
  A Ruby client for
6
- [FileMaker 17's Data API](https://fmhelp.filemaker.com/docs/17/en/dataapi/)
6
+ [FileMaker 18's Data API](https://fmhelp.filemaker.com/docs/18/en/dataapi/)
7
7
  using
8
8
  [Faraday](https://github.com/lostisland/faraday) and with optional
9
9
  [Spyke](https://github.com/balvig/spyke) support (ActiveRecord-ish models).
10
10
 
11
- FileMaker 16's Data API is not supported (but you shouldn't be using it
12
- anyway).
13
-
14
11
  If you're looking for a Ruby client for the legacy XML/Custom Web Publishing
15
12
  API try the fabulous [ginjo-rfm gem](https://github.com/ginjo/rfm) instead.
16
13
 
17
- fmrest-ruby does not currently implement the full spec of FileMaker 17's Data
18
- API.
14
+ fmrest-ruby only partially implements FileMaker 18's Data API.
15
+ See the [implementation completeness table](#api-implementation-completeness-table)
16
+ to see if a feature you need is natively supported by the gem.
19
17
 
20
18
  ## Installation
21
19
 
@@ -24,11 +22,11 @@ Add this line to your Gemfile:
24
22
  ```ruby
25
23
  gem 'fmrest'
26
24
 
27
- # Optional (for ORM features)
25
+ # Optional but recommended (for ORM features)
28
26
  gem 'spyke'
29
27
  ```
30
28
 
31
- ## Basic usage
29
+ ## Basic usage (without ORM)
32
30
 
33
31
  To get a Faraday connection that can handle FM's Data API auth workflow:
34
32
 
@@ -79,9 +77,12 @@ FmRest::V1.build_connection(
79
77
  )
80
78
  ```
81
79
 
82
- You can use the `:log` option for basic request logging, see the section on
80
+ You can also pass a `:log` option for basic request logging, see the section on
83
81
  [Logging](#Logging) below.
84
82
 
83
+ `:username` is also aliased as `:account_name` to provide cross-compatibility
84
+ with the ginjo-rfm gem.
85
+
85
86
  ### Default connection settings
86
87
 
87
88
  If you're only connecting to a single FM database you can configure it globally
@@ -234,13 +235,15 @@ class Honeybee < FmRest::Spyke::Base
234
235
  end
235
236
  ```
236
237
 
237
- In this case you can pass the `fmrest_config` hash as an argument to `Base()`:
238
+ In this case you can pass the [`fmrest_config`](#modelfmrest_config) hash as an
239
+ argument to `Base()`:
238
240
 
239
241
  ```ruby
240
242
  class Honeybee < FmRest::Spyke::Base(host: "...", database: "...", username: "...", password: "...")
241
243
  end
242
244
 
243
- Honeybee.fmrest_config # => { host: "...", database: "...", username: "...", password: "..." }
245
+ Honeybee.fmrest_config
246
+ # => { host: "...", database: "...", username: "...", password: "..." }
244
247
  ```
245
248
 
246
249
  All of Spyke's basic ORM operations work:
@@ -839,6 +842,37 @@ class LoggyBee < FmRest::Spyke::Base
839
842
  end
840
843
  ```
841
844
 
845
+ ## API implementation completeness table
846
+
847
+ FM Data API reference: https://fmhelp.filemaker.com/docs/18/en/dataapi/
848
+
849
+ | FM 18 Data API feature | Supported by basic connection | Supported by FmRest::Spyke::Base |
850
+ |-------------------------------------|-------------------------------|----------------------------------|
851
+ | Log in using HTTP Basic Auth | Yes | Yes |
852
+ | Log in using OAuth | No | No |
853
+ | Log in to an external data source | No | No |
854
+ | Log in using a FileMaker ID account | No | No |
855
+ | Log out | Manual* | No |
856
+ | Get product information | Manual* | No |
857
+ | Get database names | Manual* | No |
858
+ | Get script names | Manual* | No |
859
+ | Get layout names | Manual* | No |
860
+ | Get layout metadata | Manual* | No |
861
+ | Create a record | Manual* | Yes |
862
+ | Edit a record | Manual* | Yes |
863
+ | Duplicate a record | Manual* | No |
864
+ | Delete a record | Manual* | Yes |
865
+ | Get a single record | Manual* | Yes |
866
+ | Get a range of records | Manual* | Yes |
867
+ | Get container data | Manual* | Yes |
868
+ | Upload container data | Manual* | Yes |
869
+ | Perform a find request | Manual* | Yes |
870
+ | Set global field values | Manual* | No |
871
+ | Run a script | Manual* | Yes |
872
+ | Run a script with another request | Manual* | Yes |
873
+
874
+ \* You can manually supply the URL and JSON to a `FmRest` connection.
875
+
842
876
  ## TODO
843
877
 
844
878
  - [ ] Support for FM18 features
@@ -853,7 +887,7 @@ end
853
887
  - [x] Specs
854
888
  - [x] Support for portal data
855
889
 
856
- ## Development
890
+ ## Gem development
857
891
 
858
892
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
859
893
  `rake spec` to run the tests. You can also run `bin/console` for an interactive
data/fmrest.gemspec CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "sqlite3"
34
34
  spec.add_development_dependency "mock_redis"
35
35
  spec.add_development_dependency "moneta"
36
+ spec.add_development_dependency "yard"
36
37
  end
@@ -14,6 +14,10 @@ module FmRest
14
14
  # error handling. A block can be optionally given for additional
15
15
  # middleware configuration
16
16
  #
17
+ # @option options [String] :username The username for DAPI authentication
18
+ # @option options [String] :account_name Alias of :username for
19
+ # compatibility with Rfm gem
20
+ # @option options [String] :password The password for DAPI authentication
17
21
  # @option (see #base_connection)
18
22
  # @return (see #base_connection)
19
23
  def build_connection(options = FmRest.default_connection_settings, &block)
@@ -49,8 +53,6 @@ module FmRest
49
53
  #
50
54
  # @option options [String] :host The hostname for the FM server
51
55
  # @option options [String] :database The FM database name
52
- # @option options [String] :username The username for DAPI authentication
53
- # @option options [String] :password The password for DAPI authentication
54
56
  # @option options [String] :ssl SSL options to forward to the Faraday
55
57
  # connection
56
58
  # @option options [String] :proxy Proxy options to forward to the Faraday
@@ -96,7 +96,9 @@ module FmRest
96
96
 
97
97
  def auth_connection
98
98
  @auth_connection ||= V1.base_connection(@options) do |conn|
99
- conn.basic_auth @options.fetch(:username), @options.fetch(:password)
99
+ username = @options.fetch(:account_name) { @options.fetch(:username) }
100
+
101
+ conn.basic_auth username, @options.fetch(:password)
100
102
 
101
103
  if @options[:log]
102
104
  conn.response :logger, nil, bodies: true, headers: true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FmRest
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fmrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Carbajal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -190,6 +190,20 @@ dependencies:
190
190
  - - ">="
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
+ - !ruby/object:Gem::Dependency
194
+ name: yard
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ type: :development
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
193
207
  description: FileMaker Data API client using Faraday, with optional ActiveRecord-like
194
208
  ORM based on Spyke
195
209
  email: