ginjo-rfm 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWQ1ODlhYTI5ZDM2OTkxNDc3MGE5MGEyZjM4YWI2YTA0MzIyMTM1OA==
4
+ MmNhZWFmOTQwYTY4NmFmN2ZhMmQzZDk0YWNmOWQ5YzFlMWY2MWMwZg==
5
5
  data.tar.gz: !binary |-
6
- NzgwMmY2OTA3OTZkMzYxZTQ2ZmE2NzY1YmFkYmJhMzUxOGEwMGNlYw==
6
+ YjIxYzQzZTViMjQ3ZTFlMzRlOTlkNGI0ZTNjOTliMTAyMWJkOTRjYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzVmNWUwZmNlNTAxNmIwNzNlNDkxMDU4NTE3YWY1YzU1ZDg0MDIzZjFhNWVj
10
- MTNkZmJhN2QxNDBmOTY4NzE1MzRhMjU4MjIzNGZlODNlZjVhYmVlNTUwMWRk
11
- YzU0ZDBkNDRhNjk3MjFhNDBjNzRmNjBjODU5NmY4MmQ1MjgwZjE=
9
+ NDE4Mjk4MDVkODMzZGIyYjhmN2VjM2NlYzdmZjY3NWUzNzgyMTUzMjgzNjFj
10
+ MmNmZTYxOTYwMzA0YzcxZWM2MWYyMzY4YzgxZDQxZmFlZjhhNzUyZDYwYzE0
11
+ NWE3YzczMmRjNTYxOTY5NTcwNjFkZWUwNGY5MjJlY2NkMmQ3NDc=
12
12
  data.tar.gz: !binary |-
13
- ODZlYmU4ZTAwMmI3M2FjZDA0ZjE5MDk0NzNhNmNkODJmOTc5NmUxZmI0YzU5
14
- OTUxNTM4OTUxZjA5NTdkOTE0ZTZlNjAxMGI3NWMxY2FiOTJmNTJhODQxNDhh
15
- N2IxN2VjOWQ0ZDlhMTU0NzNjYjU3NGI3ZTJhOTk0NDM3MGQ1NDM=
13
+ NjExN2ZkNGVlY2RjMGEyZDIwYTgzMzk3NzA1OGVkODUwOGZjZWUwNmU4OTQ2
14
+ MzU2NWE2NTExODEzZThhZTY5ZDYxMWFkYjE2MjVhYjI1ZTFmZWEyNDE3OThm
15
+ MmM5ZTY1NDhiNDcxODZjZDg3ZDA0Y2E4YzE2Mzg2MDljYTBiZTY=
data/README.md CHANGED
@@ -1,3 +1,20 @@
1
+ <!--
2
+ See YARD documentation - https://github.com/lsegal/yard/wiki/GettingStarted
3
+
4
+ Yard is not the same as markdown - Yard is for ruby and can use any markup language,
5
+ whereas Markdown is just another markup language.
6
+
7
+ Rubydoc.info uses yard and can use markdown and other markup languages.
8
+ To update ginjo-rfm's yard documentation from github's master branch,
9
+ first find 'rfm' on rubydoc.info, then in list-view click the update button
10
+ on the right of the screen.
11
+ To preview this file in yard, run 'rake yard'
12
+
13
+ Github uses markdown or rdoc (maybe others?).
14
+ To preview this file in plain markdown, edit in TextMate and
15
+ choose Bundles/Markdown/Preview menu option.
16
+ -->
17
+
1
18
  # ginjo-rfm
2
19
 
3
20
  Rfm is a Ruby-Filemaker adapter, a Ruby Gem that provides an interface between Filemaker Server and Ruby. Query your Filemaker database, browse result records as persistent objects, and create/update/delete records with a syntax similar to ActiveRecord. Ginjo-rfm picks up from the lardawge-rfm gem and continues to refine code and fix bugs. Version 3 removes the dependency on ActiveSupport and is now a completely independent Gem, able to run most of its core features without requiring any other supporting Gems. ActiveModel features can be activated by adding activemodel to your Gemfile (or requiring activemodel manually).
@@ -14,27 +31,18 @@ Ginjo-rfm version 3 has been tested successfully on Ruby 1.8.7, 1.9.3, 2.0.0, an
14
31
  * Original homepage <http://sixfriedrice.com/wp/products/rfm/>
15
32
  * Lardawge at github <https://github.com/lardawge/rfm>
16
33
 
17
- ## New in version 3.0
18
-
19
- There are many changes in version 3, but most of them are under the hood. Here are some highlights.
20
-
21
- * Compatibility with Ruby 2.1.2 (and 2.0.0, 1.9.3, 1.8.7).
22
-
23
- * XML parsing rewrite.
24
- The entire XML parsing engine of Rfm has been rewritten to use only the sax/stream parsing schemes of the supported Ruby XML parsers (libxml-ruby, nokogiri, ox, rexml). There were two main goals in this rewrite: 1, to separate the xml parsing code from the Rfm/Filemaker objects, and 2, to remove the hard dependency on ActiveSupport. See below for parsing configuration options.
25
-
26
- * Better logging capabilities.
27
- Added Rfm.logger, Rfm.logger=, Config.logger, Config#logger, and config(:logger=>(...)).
34
+ ## Requirements
28
35
 
29
- * Added field-mapping awareness to :sort_field query option.
36
+ Ginjo-rfm should run on any machine with a standard ruby installation. Ginjo-rfm's primary function is to interact with Filemaker Server,
37
+ however ginjo-rfm does not have to be installed on your Filemaker server - it can be installed on any machine that has network/internet access
38
+ to your Filemaker server.
30
39
 
31
- * Relaxed requirement that query option keys be symbols - can now be strings or symbols.
40
+ Ginjo-rfm will work with any Filemaker server that supports the fmresultset.xml grammar over the http protocol.
41
+ Since Filemaker Pro client does not support this, Filemaker server is required. Follow Filemaker Server's instructions
42
+ for setting up "Custom Web Publishing".
32
43
 
33
- * Detached resultset from record, so record doesn't drag resultset around with it.
34
-
35
- * Bug fixes and refinements in modeling, configuration, metadata access, and Rfm object instantiation.
36
-
37
- See the changelog or the commit history for more details on changes in ginjo-rfm v3.
44
+ Ginjo-rfm works great with Rails, but it does not require Rails.
45
+ You can write simple and powerful stand-alone ruby scripts that use ginjo-rfm to talk to a Filemaker server.
38
46
 
39
47
  ## Download & Installation
40
48
 
@@ -60,9 +68,9 @@ Note that while this gem is officially named "ginjo-rfm", you require/load it in
60
68
 
61
69
  ## Ginjo-rfm Basic Usage
62
70
 
63
- 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 Ruby class (often referred to as a "model" in this documentation) that represent a layout in your Filemaker database. Create as many models as you wish, each pointing to a layout/table-occurrence that you want to work with. The third step is using your new models to query, create, update, and delete records in your Filemaker database. Here's an example setup for a simple order-item table.
71
+ The first step in getting connected to your Filemaker databases with Rfm (assuming your Filemaker Server is properly set up - see the Filemaker Server instructions for "Custom Web Publishing") is to store your configuration settings in a yaml file or in the RFM_CONFIG hash. The second step is creating a Ruby class (often referred to as a "model" in this documentation) that represent a layout in your Filemaker database. Create as many models as you wish, each pointing to a layout/table-occurrence that you want to work with. The third step is using your new models to query, create, update, and delete records in your Filemaker database. Here's an example setup for a simple order-item table.
64
72
 
65
- rfm.yml
73
+ config/rfm.yml
66
74
 
67
75
  :host: my.host.com
68
76
  :account_name: myname
@@ -215,7 +223,7 @@ See `Rfm::Config::CONFIG_KEYS` for a list of currently allowed configuration opt
215
223
 
216
224
  ### Using Models
217
225
 
218
- Rfm models provide easy access, modeling, and persistence of your Filemaker data.
226
+ Rfm models provide easy access, modeling, and persistence of your Filemaker data. A ginjo-rfm model is basically an alias to a specific layout in your Filemaker database and provides all of the query options found in a classic rfm layout object. The model and/or the layout object is where you do most of your work with rfm. For more details about what methods and options are available to a model or layout object, see the documentation for the {Rfm::Layout} and {Rfm::Base} classes.
219
227
 
220
228
  class User < Rfm::Base
221
229
  config :layout => 'my_user_layout'
@@ -637,7 +645,29 @@ Repeating field compatibility, more coverage of Filemaker's query syntax, more e
637
645
 
638
646
 
639
647
 
640
- ## Previous Version Highlights
648
+ ## Version Highlights
649
+
650
+ ### Version 3.0
651
+
652
+ There are many changes in version 3, but most of them are under the hood. Here are some highlights.
653
+
654
+ * Compatibility with Ruby 2.1.2 (and 2.0.0, 1.9.3, 1.8.7).
655
+
656
+ * XML parsing rewrite.
657
+ The entire XML parsing engine of Rfm has been rewritten to use only the sax/stream parsing schemes of the supported Ruby XML parsers (libxml-ruby, nokogiri, ox, rexml). There were two main goals in this rewrite: 1, to separate the xml parsing code from the Rfm/Filemaker objects, and 2, to remove the hard dependency on ActiveSupport. See below for parsing configuration options.
658
+
659
+ * Better logging capabilities.
660
+ Added Rfm.logger, Rfm.logger=, Config.logger, Config#logger, and config(:logger=>(...)).
661
+
662
+ * Added field-mapping awareness to :sort_field query option.
663
+
664
+ * Relaxed requirement that query option keys be symbols - can now be strings or symbols.
665
+
666
+ * Detached resultset from record, so record doesn't drag resultset around with it.
667
+
668
+ * Bug fixes and refinements in modeling, configuration, metadata access, and Rfm object instantiation.
669
+
670
+ See the changelog or the commit history for more details on changes in ginjo-rfm v3.
641
671
 
642
672
  ### Version 2.1
643
673
 
data/lib/rfm/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.5
1
+ 3.0.6
@@ -26,7 +26,7 @@ module Rfm
26
26
  field = resultset.portal_meta[table.downcase][name.downcase]
27
27
  data = @attributes['data']
28
28
  #puts ['DATUM_portal_callback_02', resultset.class, table, name, field, data].join(', ')
29
- #(y resultset.portal_meta) unless field
29
+ #(puts resultset.portal_meta.to_yaml) unless field
30
30
  cursor.parent.object[name.downcase] = field.coerce(data)
31
31
  end
32
32
 
@@ -950,7 +950,7 @@ class Object
950
950
  instance_variable_get("@#{name}")[delimit_name]=obj
951
951
  # Trying to handle multiple portals with same table-occurance on same layout.
952
952
  # In parsing terms, this is trying to handle multiple elements who's delimiter field contains the SAME delimiter data.
953
- #instance_variable_get("@#{name}")._merge_object!(obj, delimit_name, nil, nil, nil)
953
+ instance_variable_get("@#{name}")._merge_delimited_object!(obj, delimit_name)
954
954
  else
955
955
  #puts ["\_setting_existing_instance_var", name]
956
956
  if name == options[:text_label]
@@ -970,6 +970,15 @@ class Object
970
970
  rslt
971
971
  end
972
972
 
973
+ def _merge_delimited_object!(obj, delimit_name)
974
+ case
975
+ when self[delimit_name].nil?; self[delimit_name] = obj
976
+ when self[delimit_name].is_a?(Hash); self[delimit_name].merge!(obj)
977
+ when self[delimit_name].is_a?(Array); self[delimit_name] << obj
978
+ else self[delimit_name] = [self[delimit_name], obj]
979
+ end
980
+ end
981
+
973
982
  # Get an instance variable, a member of a shared instance variable, or a hash value of self.
974
983
  def _get_attribute(name, shared_var_name=nil, options={})
975
984
  return unless name
@@ -1041,6 +1050,7 @@ class Array
1041
1050
  end # Array
1042
1051
 
1043
1052
  class Hash
1053
+
1044
1054
  def _merge_object!(obj, name, delimiter, prefs, type, options={})
1045
1055
  #puts ["\n*****HASH._merge_object", "type: #{type}", "name: #{name}", "self.class: #{self.class}", "new_obj: #{(obj.to_s rescue obj.class)}", "delimiter: #{delimiter}", "prefs: #{prefs}", "options: #{options}"]
1046
1056
  case
@@ -1053,10 +1063,9 @@ class Hash
1053
1063
  delimit_name = obj._get_attribute(delimiter, options[:shared_variable_name]).to_s.downcase
1054
1064
  #puts "MERGING delimited object with hash: self '#{self.class}' obj '#{obj.class}' name '#{name}' delim '#{delimiter}' delim_name '#{delimit_name}' options '#{options}'"
1055
1065
  self[name] ||= options[:default_class].new
1056
- self[name][delimit_name]=obj
1066
+ #self[name][delimit_name]=obj
1057
1067
  # This is supposed to handle multiple elements who's delimiter value is the SAME.
1058
- #obj.instance_variable_set(:@_index_, 0)
1059
- #self[name]._merge_object!(obj, delimit_name, nil, nil, nil)
1068
+ self[name]._merge_delimited_object!(obj, delimit_name)
1060
1069
  else
1061
1070
  if name == options[:text_label]
1062
1071
  self[name] << obj.to_s
@@ -1065,7 +1074,7 @@ class Hash
1065
1074
  self[name] << obj
1066
1075
  end
1067
1076
  end
1068
- _create_accessor(name) if (options[:create_accessors] & ['all','shared','hash']).any?
1077
+ _create_accessor(name) if (options[:create_accessors].to_a & ['all','shared','hash']).any?
1069
1078
 
1070
1079
  rslt
1071
1080
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ginjo-rfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Coffey
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-08-07 00:00:00.000000000 Z
15
+ date: 2014-09-02 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activemodel