lardawge-rfm 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2007 Geoff Coffey
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.rdoc CHANGED
@@ -1,5 +1,13 @@
1
1
  = Rfm
2
2
 
3
+ Rfm was primarily designed by Six Fried Rice co-founder Geoff Coffey.
4
+
5
+ Other lead contributors:
6
+
7
+ - Mufaddal Khumri helped architect Rfm in the most ruby-like way possible. He also contributed the outstanding error handling code and a comprehensive hierarchy of error classes.
8
+ - Atsushi Matsuo was an early Rfm tester, and provided outstanding feedback, critical code fixes, and a lot of web exposure.
9
+ - Jesse Antunes helped ensure that Rfm is stable and functional.
10
+
3
11
  == Installation
4
12
 
5
13
  Run the following if you haven't already:
@@ -230,4 +238,8 @@ So, for an annoying, but detailed load of output, make a connection like this:
230
238
  :log_responses => true
231
239
  )
232
240
 
233
- These options will change in the future. They're only there now as a quick-easy way for me to track down problems. I'm open to suggestions for what kind of login options will make sense in the final release.
241
+ These options will change in the future. They're only there now as a quick-easy way for me to track down problems. I'm open to suggestions for what kind of login options will make sense in the final release.
242
+
243
+ == Copyright
244
+
245
+ Copyright (c) 2007 Geoff Coffey. See LICENSE for details.
data/lib/rfm_command.rb CHANGED
@@ -66,10 +66,15 @@ module Rfm
66
66
  #
67
67
  # * *host* the hostname of the Web Publishing Engine (WPE) server (defaults to 'localhost')
68
68
  #
69
- # * *port* the port number the WPE is listening no (defaults to 80)
69
+ # * *port* the port number the WPE is listening no (defaults to 80 unless *ssl* +true+ which sets it to 443)
70
70
  #
71
71
  # * *ssl* +true+ if you want to use SSL (HTTPS) to connect to FileMaker (defaults to +false+)
72
72
  #
73
+ # * *root_cert* name of pem file for certificate verification (Root cert from certificate authority who issued certificate.
74
+ # If self signed certificate do not use this option!!). You can download the entire bundle of CA Root Certificates
75
+ # from http://curl.haxx.se/ca/cacert.pem. Place the pem file in config directory. (WARNING: If left blank there is no guarantee that your
76
+ # session is secure)
77
+ #
73
78
  # * *account_name* the default account name to log in to databases with (you can also supply a
74
79
  # account name on a per-database basis if necessary)
75
80
  #
@@ -94,6 +99,7 @@ module Rfm
94
99
  :host => 'localhost',
95
100
  :port => 80,
96
101
  :ssl => false,
102
+ :root_cert => '',
97
103
  :account_name => '',
98
104
  :password => '',
99
105
  :log_actions => false,
@@ -111,7 +117,7 @@ module Rfm
111
117
 
112
118
  @host_name = @state[:host]
113
119
  @scheme = @state[:ssl] ? "https" : "http"
114
- @port = @state[:port]
120
+ @port = @state[:ssl] && options[:port].blank? ? 443 : @state[:port]
115
121
 
116
122
  @db = Rfm::Factory::DbFactory.new(self)
117
123
  end
@@ -187,7 +193,17 @@ module Rfm
187
193
  request.basic_auth(account_name, password)
188
194
  request.set_form_data(post_data)
189
195
 
190
- response = Net::HTTP.start(host_name, port) { |http|
196
+ response = Net::HTTP.new(host_name, port)
197
+ if @scheme == "https" # enable SSL/TLS
198
+ response.use_ssl = true
199
+ unless @state[:root_cert].blank?
200
+ response.verify_mode = OpenSSL::SSL::VERIFY_PEER
201
+ response.ca_file = File.join("#{RAILS_ROOT}/config/", @state[:root_cert])
202
+ else
203
+ response.verify_mode = OpenSSL::SSL::VERIFY_NONE
204
+ end
205
+ end
206
+ response = response.start { |http|
191
207
  http.request(request)
192
208
  }
193
209
 
data/lib/rfm_result.rb CHANGED
@@ -68,6 +68,8 @@ module Rfm::Result
68
68
  @date_format = nil
69
69
  @time_format = nil
70
70
  @timestamp_format = nil
71
+ @total_count = nil
72
+ @foundset_count = nil
71
73
 
72
74
  doc = REXML::Document.new(fmresultset)
73
75
  root = doc.root
@@ -83,6 +85,10 @@ module Rfm::Result
83
85
  @date_format = convertFormatString(datasource.attributes['date-format'])
84
86
  @time_format = convertFormatString(datasource.attributes['time-format'])
85
87
  @timestamp_format = convertFormatString(datasource.attributes['timestamp-format'])
88
+
89
+ # process count metadata
90
+ @total_count = datasource.attributes['total-count'].to_i
91
+ @foundset_count = root.elements['resultset'].attributes['count'].to_i
86
92
 
87
93
  # process field metadata
88
94
  root.elements['metadata'].each_element('field-definition') { |field|
@@ -109,7 +115,7 @@ module Rfm::Result
109
115
  }
110
116
  end
111
117
 
112
- attr_reader :server, :fields, :portals, :date_format, :time_format, :timestamp_format, :layout
118
+ attr_reader :server, :fields, :portals, :date_format, :time_format, :timestamp_format, :total_count, :foundset_count, :layout
113
119
 
114
120
  private
115
121
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lardawge-rfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Coffey
@@ -32,6 +32,7 @@ executables: []
32
32
  extensions: []
33
33
 
34
34
  extra_rdoc_files:
35
+ - LICENSE
35
36
  - README.rdoc
36
37
  files:
37
38
  - lib/rfm.rb
@@ -40,6 +41,7 @@ files:
40
41
  - lib/rfm_factory.rb
41
42
  - lib/rfm_result.rb
42
43
  - lib/rfm_util.rb
44
+ - LICENSE
43
45
  - README.rdoc
44
46
  has_rdoc: false
45
47
  homepage: http://sixfriedrice.com/wp/products/rfm/