fmrest-core 0.21.0 → 0.22.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: 1dcd50851dca459061ccd7a2f55a2b3dcadea27ed5aa91aa854fb23660747667
4
- data.tar.gz: ee483bb0ded64cda1342d38a9afa97789e1bcc6b813602543787c049eea038b8
3
+ metadata.gz: b7ac58128c88341bca022d6470847a1bf0ee489daf71323697e17ba103f0325f
4
+ data.tar.gz: 7061ed4af4f344646aa4dd4935242f00751473885302cb257283183aadbed763
5
5
  SHA512:
6
- metadata.gz: 5570a533c122bbfae3d3cbdbcee96bdf4ed1d3ebfe43691ec92acb0ed078a2b5badf0cf546afd2d6a9d877425203fefab737bf24594b92cf64639c66ebb51ba4
7
- data.tar.gz: adbd2c191f65cc2a67f2db3b571f7c287c12eddbfd6c3c31e32a5d730b7d8ada2f61197c9e0df731aa748b1a2caa443ca3d17d16f483437107d16fc4440c6f79
6
+ metadata.gz: db124b9095a6a8636e5edea83ba9b2c1517aff515336daa37cb882db1818f02f5fb6ceb2eaac7d980d433bbef2892fa708bbb1087fc9bbde1829cd22f738dd67
7
+ data.tar.gz: 587890573a26cc811da0a7327d4b8b3799f9f7717fb6885b4f2d8414922d48eb53cb54c3cad52050e56bc998e9ade720fe7cd835a9bd36184afbb4271f12729f
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"
4
+ VERSION = "0.22.0"
5
5
  end
data/lib/fmrest.rb CHANGED
@@ -69,3 +69,9 @@ module FmRest
69
69
  end
70
70
  end
71
71
  end
72
+
73
+ begin
74
+ require "fmrest/railtie" if defined?(Rails::Railtie)
75
+ # In case fmrest-rails is not installed
76
+ rescue LoadError
77
+ 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
4
+ version: 0.22.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