ginjo-rfm 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +5 -0
- data/CHANGELOG.md +6 -0
- data/README.md +7 -12
- data/lib/rfm.rb +11 -1
- data/lib/rfm/VERSION +1 -1
- data/lib/rfm/base.rb +3 -2
- data/lib/rfm/utilities/compound_query.rb +8 -7
- data/lib/rfm/utilities/core_ext.rb +1 -1
- data/lib/rfm/utilities/factory.rb +1 -1
- data/lib/rfm/utilities/xml_parser.rb +3 -3
- data/lib/rfm/xml_mini/hpricot.rb +2 -2
- data/lib/rfm/xml_mini/ox_sax.rb +1 -1
- metadata +5 -4
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## Ginjo-Rfm 2.0.1
|
4
|
+
|
5
|
+
* Fixed bug in Base.find where options weren't being passed to Layout#find correctly
|
6
|
+
|
7
|
+
* Fixed bug in rfm.rb when calling #models or #modelize.
|
8
|
+
|
3
9
|
## Ginjo-Rfm 2.0.0
|
4
10
|
|
5
11
|
* ActiveModel compatibility allows Rails ActiveRecord-style models
|
data/README.md
CHANGED
@@ -6,10 +6,10 @@ Rfm is a Ruby-Filemaker adapter, a Ruby gem that allows scripts and applications
|
|
6
6
|
## Documentation & Links
|
7
7
|
|
8
8
|
* Ginjo-rfm rubygem <https://rubygems.org/gems/ginjo-rfm>
|
9
|
-
* Original homepage <http://sixfriedrice.com/wp/products/rfm/>
|
10
9
|
* Rdoc location <http://rubydoc.info/github/ginjo/rfm/frames>
|
11
10
|
* Discussion <http://groups.google.com/group/rfmcommunity>
|
12
11
|
* Ginjo at github <https://github.com/ginjo/rfm>
|
12
|
+
* Original homepage <http://sixfriedrice.com/wp/products/rfm/>
|
13
13
|
* Lardawge at github <https://github.com/lardawge/rfm>
|
14
14
|
|
15
15
|
|
@@ -239,15 +239,6 @@ Once the gem is installed, you can use rfm in your ruby scripts by requiring it:
|
|
239
239
|
require 'rfm'
|
240
240
|
|
241
241
|
|
242
|
-
### Edge - in an upcoming version of ginjo-rfm
|
243
|
-
|
244
|
-
Try out unreleased features of ginjo-rfm in the edge branch.
|
245
|
-
|
246
|
-
#gemfile
|
247
|
-
gem 'ginjo-rfm', :git=>'git://github.com/ginjo/rfm.git', :branch=>'edge'
|
248
|
-
|
249
|
-
|
250
|
-
|
251
242
|
## Ginjo-rfm Basic Usage
|
252
243
|
|
253
244
|
The first step in getting connected to your Filemaker databases with Rfm is to store your configuration settings in a yaml file or in the RFM_CONFIG hash. The second step is creating a model that represents a layout from one of your Filemaker databases.
|
@@ -356,7 +347,7 @@ Use `get_config` to view the compiled configuration settings for any object. Con
|
|
356
347
|
:account_name => 'name', :password => 'pass'
|
357
348
|
}
|
358
349
|
|
359
|
-
|
350
|
+
**Possible Configuration Options**
|
360
351
|
|
361
352
|
Following are all of the recognized configuration options, including defaults if applicable.
|
362
353
|
|
@@ -473,7 +464,7 @@ To learn more about ActiveModel, see the ActiveModel or RubyOnRails documentatio
|
|
473
464
|
|
474
465
|
Once you have an Rfm model or layout, you can use any of the standard Rfm commands to create, search, edit, and delete records. To learn more about these commands, see below for Databases, Layouts, Resultsets, and Records. Or checkout the API documentation for Rfm::Server, Rfm::Database, Rfm::Layout, Rfm::Record, and Rfm::Base.
|
475
466
|
|
476
|
-
|
467
|
+
**Two Small Changes in Rfm Return Values**
|
477
468
|
|
478
469
|
When using Models to retrieve records using the `any` method or the `find(record_id)` method, the return values will be single Rfm::Record objects. This differs from the traditional Rfm behavior of these methods when accessed directly from the the Rfm::Layout instance, where the return value is always a Rfm::Resultset.
|
479
470
|
|
@@ -777,6 +768,10 @@ So, for an annoying, but detailed load of output, make a connection like this:
|
|
777
768
|
:log_responses => true
|
778
769
|
)
|
779
770
|
|
771
|
+
### Source Code
|
772
|
+
|
773
|
+
If you were tracking ginjo-rfm on github before the switch to version 2.0.0, please accept my humblest apologies for making a mess of the branching. The pre 2.0.0 edge branch has become master, and the pre 2.0.0 master branch has become ginjo-1-4-stable. I don't intend to make that kind of hard reset again, at least not on public branches. Master will be the branch to find the latest-greatest public source, and 'stable' branches will emerge as necessary to preserve historical releases.
|
774
|
+
|
780
775
|
|
781
776
|
## Credits
|
782
777
|
|
data/lib/rfm.rb
CHANGED
@@ -58,10 +58,20 @@ module Rfm
|
|
58
58
|
"Using ginjo-rfm version #{::Rfm::VERSION} with #{XmlParser.backend}"
|
59
59
|
end
|
60
60
|
|
61
|
-
def_delegators 'Rfm::Factory', :servers, :server, :db, :database, :layout
|
61
|
+
def_delegators 'Rfm::Factory', :servers, :server, :db, :database, :layout
|
62
62
|
def_delegators 'Rfm::XmlParser', :backend, :backend=
|
63
63
|
def_delegators 'Rfm::Config', :config, :get_config, :config_clear
|
64
64
|
|
65
|
+
def models(*args)
|
66
|
+
Rfm::Base
|
67
|
+
Rfm::Factory.models(*args)
|
68
|
+
end
|
69
|
+
|
70
|
+
def modelize(*args)
|
71
|
+
Rfm::Base
|
72
|
+
Rfm::Factory.modelize(*args)
|
73
|
+
end
|
74
|
+
|
65
75
|
extend self
|
66
76
|
|
67
77
|
end # Rfm
|
data/lib/rfm/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
data/lib/rfm/base.rb
CHANGED
@@ -30,7 +30,8 @@ module Rfm
|
|
30
30
|
# @person.update_attributes(:name => 'Michael', :title => "Senior Partner")
|
31
31
|
# @person.save
|
32
32
|
#
|
33
|
-
#
|
33
|
+
#
|
34
|
+
require 'active_support/core_ext/string/inflections'
|
34
35
|
require 'rfm/database'
|
35
36
|
require 'rfm/layout'
|
36
37
|
require 'rfm/record'
|
@@ -225,7 +226,7 @@ module Rfm
|
|
225
226
|
|
226
227
|
# Just like Layout#find, but searching by record_id will return a record, not a resultset.
|
227
228
|
def find(find_criteria, options={})
|
228
|
-
r = layout.find(find_criteria, options
|
229
|
+
r = layout.find(find_criteria, options)
|
229
230
|
if ![Hash,Array].include?(find_criteria.class) and r.size == 1
|
230
231
|
r[0]
|
231
232
|
else
|
@@ -1,11 +1,12 @@
|
|
1
|
+
# The classes in this module are used internally by RFM and are not intended for outside use.
|
1
2
|
module Rfm
|
2
3
|
|
3
4
|
|
4
|
-
# Class to build complex FMP queries
|
5
|
-
# Perform Filemaker find using complex boolean logic (multiple value options for a single field)
|
6
|
-
#
|
7
|
-
# Also allow find requests to be :omit
|
8
|
-
class CompoundQuery < Array
|
5
|
+
# Class to build complex FMP queries.
|
6
|
+
# Perform Filemaker find using complex boolean logic (multiple value options for a single field),
|
7
|
+
# or create multiple find requests.
|
8
|
+
# Also allow find requests to be :omit.
|
9
|
+
class CompoundQuery < Array
|
9
10
|
|
10
11
|
attr_accessor :original_input, :query_type, :key_values, :key_arrays, :key_map, :key_map_string, :key_counter
|
11
12
|
|
@@ -65,7 +66,7 @@ module Rfm
|
|
65
66
|
end
|
66
67
|
|
67
68
|
|
68
|
-
# Build key-value definitions and query map '-q1...'
|
69
|
+
# Build key-value definitions and query map '-q1...'.
|
69
70
|
# Converts query_hash to fmresultset uri format for -findquery query type.
|
70
71
|
def build_key_values(input_hash)
|
71
72
|
input_hash = input_hash.clone
|
@@ -89,7 +90,7 @@ module Rfm
|
|
89
90
|
|
90
91
|
|
91
92
|
# Input array of arrays.
|
92
|
-
# Transform single key_array into key_map (array of requests)
|
93
|
+
# Transform single key_array into key_map (array of requests).
|
93
94
|
# Creates all combinations of sub-arrays where each combination contains one element of each subarray.
|
94
95
|
def build_key_map(key_array)
|
95
96
|
key_array = key_array.clone
|
@@ -12,7 +12,7 @@ module Rfm
|
|
12
12
|
extend Config
|
13
13
|
config :parent=>'Rfm::Config'
|
14
14
|
|
15
|
-
class ServerFactory < Rfm::CaseInsensitiveHash
|
15
|
+
class ServerFactory < Rfm::CaseInsensitiveHash
|
16
16
|
|
17
17
|
def [](host, conf = Factory.get_config) #(Factory.instance_variable_get(:@config) || {}))
|
18
18
|
conf[:host] = host
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Rfm
|
2
|
-
module XmlParser
|
2
|
+
module XmlParser
|
3
3
|
|
4
4
|
extend Config
|
5
5
|
config :parent=>'Rfm::Config'
|
@@ -12,7 +12,7 @@ module Rfm
|
|
12
12
|
BACKENDS[:jdom] = {:require=>'jdom', :class => 'JDOM'}
|
13
13
|
|
14
14
|
BACKENDS[:oxsax] = {:require=>'ox', :class => proc{
|
15
|
-
#
|
15
|
+
# Ox module is part of Rfm, not XmlMini,
|
16
16
|
# and needs to be handed manually to XmlMini.
|
17
17
|
require File.join(File.dirname(__FILE__), '../xml_mini/ox_sax.rb')
|
18
18
|
ActiveSupport::XmlMini_OxSAX}}
|
@@ -34,7 +34,7 @@ module Rfm
|
|
34
34
|
BACKENDS[:rexml] = {:require=>'rexml/document', :class=>'REXML'}
|
35
35
|
|
36
36
|
BACKENDS[:rexmlsax] = {:require=>'rexml/parsers/sax2parser', :class => proc{
|
37
|
-
#
|
37
|
+
# Rexmlsax module is part of Rfm, not XmlMini,
|
38
38
|
# and needs to be handed manually to XmlMini.
|
39
39
|
require File.join(File.dirname(__FILE__), '../xml_mini/rexml_sax.rb')
|
40
40
|
ActiveSupport::XmlMini_REXMLSAX}}
|
data/lib/rfm/xml_mini/hpricot.rb
CHANGED
@@ -2,8 +2,8 @@ require 'active_support/core_ext/kernel/reporting'
|
|
2
2
|
require 'active_support/core_ext/object/blank'
|
3
3
|
require 'stringio'
|
4
4
|
|
5
|
-
module ActiveSupport
|
6
|
-
module XmlMini_Hpricot
|
5
|
+
module ActiveSupport
|
6
|
+
module XmlMini_Hpricot
|
7
7
|
extend self
|
8
8
|
|
9
9
|
CONTENT_KEY = '__content__'.freeze
|
data/lib/rfm/xml_mini/ox_sax.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ginjo-rfm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 1
|
10
|
+
version: 2.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Geoff Coffey
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2012-
|
22
|
+
date: 2012-04-19 00:00:00 Z
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: activesupport
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/rfm/xml_mini/rexml_sax.rb
|
215
215
|
- lib/rfm.rb
|
216
216
|
- lib/rfm/VERSION
|
217
|
+
- .yardopts
|
217
218
|
- LICENSE
|
218
219
|
- README.md
|
219
220
|
- CHANGELOG.md
|