fmrest-core 0.21.0.rc1 → 0.23.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2404b4260deeceb47d94995c5952a87a5e012138f7b5700995e8554f82278d94
4
- data.tar.gz: 48b31d91a7017d1d4c1c27ab006d09855fd110ebb8b09babb8ad99e653450e3d
3
+ metadata.gz: 92abb04ce230ccdabbb354ec5e6255f8bbb3deedceed6866ff5f62a5147596b5
4
+ data.tar.gz: 5408e86d4265da9ed26c16fdeab24ed4aa1f6ff2280041634a96f3b72f1ed117
5
5
  SHA512:
6
- metadata.gz: 3e7dcc78c4eebaa745b7b49c0d3cf05d1ac954d759f38ee906bd3cb45e0f73d68b4fec8e0c66c837f7ca1539d3d87881b58980517c514520ab2a18df7473d6d4
7
- data.tar.gz: d4d403552c87f7f6a735fc76b613300818640f15135e567bd5e528c61cac14146dff4c4794d5d01a0d15d7db1816fd221a38456ed2ebb838373310760c6b3a63
6
+ metadata.gz: 3c2d20938228133e8bfdfcca7bf5605c455ab4a03b62d17bc605839b3700f2797be772268cbb84171af55c46fc0eb00d8e5f19e1360361a000026b805c23b647
7
+ data.tar.gz: 1140784884cc26626b3746cee5d92957107afb9da5fea99e6268085c5da2f6ea0703062a845cfac34dbe98d84cb8476d7d86cd71d9e5c046934b0cf7d9f95ade
data/.yardopts CHANGED
@@ -1,5 +1,6 @@
1
1
  --markup markdown
2
2
  --plugin activesupport-concern
3
- lib/**/*.rb
3
+ --exclude lib/generators/*
4
4
  -
5
+ lib/**/*.rb
5
6
  docs/*
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.23.0
4
+
5
+ * Add `find_one!` (aliased as `first!`) exception-raising method
6
+ * Add mapping of API exceptions to HTTP responses in Rails
7
+
8
+ ### 0.22.0
9
+
10
+ * Add `fmrest-rails` gem with Rails integration (initializer, generators)
11
+
12
+ ### 0.21.0
13
+
14
+ * Support for Spyke 7 and Faraday 2
15
+ * Drop support for Faraday 1
16
+ * Drop support for Ruby 2.5
17
+
3
18
  ### 0.20.0
4
19
 
5
20
  * Forward proxy options to AWS Client when using `fmrest-cloud` gem
data/README.md CHANGED
@@ -19,13 +19,14 @@ Need Ruby or FileMaker consulting? Contact us at
19
19
 
20
20
  ## Gems
21
21
 
22
- The `fmrest` gem is a wrapper for two other gems:
22
+ The `fmrest` gem is a wrapper for these gems:
23
23
 
24
24
  * `fmrest-spyke`, providing an ActiveRecord-like ORM library built on top
25
25
  of `fmrest-core` and [Spyke](https://github.com/balvig/spyke).
26
26
  * `fmrest-core`, providing the core
27
27
  [Faraday](https://github.com/lostisland/faraday) connection builder, session
28
28
  management, and other core utilities.
29
+ * `fmrest-rails`, providing Rails integration.
29
30
 
30
31
  In addition, the optional `fmrest-cloud` gem adds support for FileMaker Cloud.
31
32
  See the [main document on connecting to FileMaker
@@ -42,6 +43,12 @@ gem 'fmrest'
42
43
  gem 'fmrest-cloud'
43
44
  ```
44
45
 
46
+ If you're using Rails you can now run:
47
+
48
+ ```
49
+ rails generate fmrest:config
50
+ ```
51
+
45
52
  ## Simple example
46
53
 
47
54
  ```ruby
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FmRest
4
- VERSION = "0.21.0.rc1"
4
+ VERSION = "0.23.0"
5
5
  end
data/lib/fmrest.rb CHANGED
@@ -48,10 +48,9 @@ module FmRest
48
48
  end
49
49
  end
50
50
 
51
- # Shortcut for FmRest::V1.escape_find_operators
51
+ # Shortcut for `FmRest::V1.escape_find_operators`
52
52
  #
53
- # @param (see FmRest::V1.escape_find_operators
54
- # @return (see FmRest::V1.escape_find_operators
53
+ # @see FmRest::V1.escape_find_operators
55
54
  def e(s)
56
55
  V1.escape_find_operators(s)
57
56
  end
@@ -69,3 +68,9 @@ module FmRest
69
68
  end
70
69
  end
71
70
  end
71
+
72
+ begin
73
+ require "fmrest/railtie" if defined?(Rails::Railtie)
74
+ # In case fmrest-rails is not installed
75
+ rescue LoadError
76
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This is capitalized differently (Fmrest vs FmRest) on purpose, so the
4
+ # generator can be found as "fmrest:config"
5
+ module Fmrest
6
+ module Generators
7
+ class ConfigGenerator < Rails::Generators::Base
8
+ source_root File.expand_path('templates', __dir__)
9
+
10
+ def copy_config_file
11
+ copy_file "fmrest.yml", "config/fmrest.yml"
12
+ end
13
+
14
+ def copy_initializer_file
15
+ copy_file "fmrest_initializer.rb", "config/initializers/fmrest.rb"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ development:
2
+ host:
3
+ database:
4
+ username:
5
+ password:
6
+
7
+ # Additional options
8
+ #
9
+ # log: false
10
+ #
11
+ # ssl:
12
+ # verify: true
13
+
14
+ test:
15
+ host:
16
+ database:
17
+ username:
18
+ password:
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Use ActiveRecord token store
4
+ FmRest.token_store = FmRest::TokenStore::ActiveRecord
5
+
6
+ # Use ActiveRecord token store with custom table name
7
+ # FmRest.token_store = FmRest::TokenStore::ActiveRecord.new(table_name: "my_token_store")
8
+
9
+ # Use Redis token store (requires redis gem)
10
+ # FmRest.token_store = FmRest::TokenStore::Redis
11
+
12
+ # Use Redis token store with custom prefix
13
+ # FmRest.token_store = FmRest::TokenStore::Redis.new(prefix: "my-fmrest-token:")
14
+
15
+ # Use Moneta token store (requires moneta gem)
16
+ # FmRest.token_store = FmRest::TokenStore::Moneta.new(backend: )
17
+
18
+ # Use Memory token store (not suitable for production)
19
+ # FmRest.token_store = FmRest::TokenStore::Memory
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This is capitalized differently (Fmrest vs FmRest) on purpose, so the
4
+ # generator can be found as "fmrest:config"
5
+ module Fmrest
6
+ module Generators
7
+ class ModelGenerator < Rails::Generators::NamedBase
8
+ source_root File.expand_path('templates', __dir__)
9
+
10
+ def create_model_file
11
+ template "model.rb", "app/models/#{file_name}.rb"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class <%= class_name %> < FmRest::Layout
4
+ # Uncomment if your layout name isn't "<%= class_name %>", or delete:
5
+ # layout "<%= plural_name %>"
6
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fmrest-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0.rc1
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Carbajal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-12 00:00:00.000000000 Z
11
+ date: 2022-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -77,6 +77,11 @@ files:
77
77
  - lib/fmrest/v1/type_coercer.rb
78
78
  - lib/fmrest/v1/utils.rb
79
79
  - lib/fmrest/version.rb
80
+ - lib/generators/fmrest/config/config_generator.rb
81
+ - lib/generators/fmrest/config/templates/fmrest.yml
82
+ - lib/generators/fmrest/config/templates/fmrest_initializer.rb
83
+ - lib/generators/fmrest/model/model_generator.rb
84
+ - lib/generators/fmrest/model/templates/model.rb
80
85
  homepage: https://github.com/beezwax/fmrest-ruby
81
86
  licenses:
82
87
  - MIT
@@ -92,9 +97,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
97
  version: '0'
93
98
  required_rubygems_version: !ruby/object:Gem::Requirement
94
99
  requirements:
95
- - - ">"
100
+ - - ">="
96
101
  - !ruby/object:Gem::Version
97
- version: 1.3.1
102
+ version: '0'
98
103
  requirements: []
99
104
  rubygems_version: 3.3.3
100
105
  signing_key: