simplemapper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/LICENSE +1 -1
  2. data/README +16 -0
  3. data/Rakefile +1 -1
  4. data/doc/classes/Array.html +24 -5
  5. data/doc/classes/{Inflector.src/M000017.html → Array.src/M000005.html} +4 -8
  6. data/doc/classes/Array.src/{M000001.html → M000006.html} +1 -1
  7. data/doc/classes/Callbacks.html +15 -15
  8. data/doc/classes/Callbacks.src/{M000037.html → M000040.html} +0 -0
  9. data/doc/classes/Callbacks.src/{M000038.html → M000041.html} +0 -0
  10. data/doc/classes/Callbacks.src/{M000039.html → M000042.html} +0 -0
  11. data/doc/classes/Enumerable.html +5 -5
  12. data/doc/classes/Enumerable.src/{M000040.html → M000043.html} +1 -1
  13. data/doc/classes/Hash.html +23 -4
  14. data/doc/classes/Hash.src/M000002.html +6 -4
  15. data/doc/classes/Hash.src/M000003.html +4 -20
  16. data/doc/classes/Hash.src/M000004.html +34 -0
  17. data/doc/classes/Inflector/Inflections.html +40 -40
  18. data/doc/classes/Inflector/Inflections.src/M000034.html +4 -5
  19. data/doc/classes/Inflector/Inflections.src/M000035.html +4 -4
  20. data/doc/classes/Inflector/Inflections.src/M000036.html +4 -9
  21. data/doc/classes/Inflector/Inflections.src/M000037.html +19 -0
  22. data/doc/classes/Inflector/Inflections.src/{M000031.html → M000038.html} +4 -4
  23. data/doc/classes/Inflector/Inflections.src/M000039.html +23 -0
  24. data/doc/classes/Inflector.html +82 -82
  25. data/doc/classes/Inflector.src/M000020.html +6 -6
  26. data/doc/classes/Inflector.src/M000021.html +11 -4
  27. data/doc/classes/Inflector.src/M000022.html +11 -8
  28. data/doc/classes/Inflector.src/M000023.html +8 -4
  29. data/doc/classes/Inflector.src/M000024.html +4 -4
  30. data/doc/classes/Inflector.src/M000025.html +8 -4
  31. data/doc/classes/Inflector.src/M000026.html +4 -4
  32. data/doc/classes/Inflector.src/M000027.html +4 -5
  33. data/doc/classes/Inflector.src/M000028.html +4 -4
  34. data/doc/classes/Inflector.src/M000029.html +4 -8
  35. data/doc/classes/Inflector.src/M000030.html +5 -13
  36. data/doc/classes/Inflector.src/M000031.html +18 -0
  37. data/doc/classes/Inflector.src/M000032.html +22 -0
  38. data/doc/classes/Inflector.src/M000033.html +27 -0
  39. data/doc/classes/Merb/Request.html +5 -5
  40. data/doc/classes/Merb/Request.src/{M000041.html → M000044.html} +1 -1
  41. data/doc/classes/OAuth/RequestProxy/Base.html +5 -5
  42. data/doc/classes/OAuth/RequestProxy/Base.src/{M000012.html → M000015.html} +1 -1
  43. data/doc/classes/OAuth/Signature/Base.html +5 -5
  44. data/doc/classes/OAuth/Signature/Base.src/{M000011.html → M000014.html} +1 -1
  45. data/doc/classes/OAuthController.html +25 -25
  46. data/doc/classes/OAuthController.src/M000008.html +8 -11
  47. data/doc/classes/OAuthController.src/M000009.html +4 -5
  48. data/doc/classes/OAuthController.src/{M000007.html → M000010.html} +1 -1
  49. data/doc/classes/OAuthController.src/M000011.html +25 -0
  50. data/doc/classes/OAuthController.src/M000012.html +19 -0
  51. data/doc/classes/Object.html +18 -6
  52. data/doc/classes/Object.src/{M000010.html → M000013.html} +2 -2
  53. data/doc/classes/Proc.html +5 -5
  54. data/doc/classes/Proc.src/{M000004.html → M000007.html} +0 -0
  55. data/doc/classes/Serialize.html +20 -20
  56. data/doc/classes/Serialize.src/M000016.html +7 -32
  57. data/doc/classes/Serialize.src/{M000014.html → M000017.html} +1 -1
  58. data/doc/classes/Serialize.src/{M000015.html → M000018.html} +1 -1
  59. data/doc/classes/Serialize.src/M000019.html +18 -0
  60. data/doc/classes/SimpleMapper/Base.html +149 -124
  61. data/doc/classes/SimpleMapper/Base.src/M000067.html +3 -8
  62. data/doc/classes/SimpleMapper/Base.src/M000068.html +3 -13
  63. data/doc/classes/SimpleMapper/Base.src/M000069.html +4 -4
  64. data/doc/classes/SimpleMapper/Base.src/M000070.html +15 -4
  65. data/doc/classes/SimpleMapper/Base.src/M000071.html +7 -4
  66. data/doc/classes/SimpleMapper/Base.src/M000072.html +4 -5
  67. data/doc/classes/SimpleMapper/Base.src/M000073.html +12 -9
  68. data/doc/classes/SimpleMapper/Base.src/M000074.html +8 -5
  69. data/doc/classes/SimpleMapper/Base.src/M000075.html +5 -7
  70. data/doc/classes/SimpleMapper/Base.src/M000076.html +5 -5
  71. data/doc/classes/SimpleMapper/Base.src/M000077.html +6 -5
  72. data/doc/classes/SimpleMapper/Base.src/M000078.html +10 -6
  73. data/doc/classes/SimpleMapper/Base.src/M000079.html +4 -4
  74. data/doc/classes/SimpleMapper/Base.src/M000080.html +6 -4
  75. data/doc/classes/SimpleMapper/Base.src/M000081.html +4 -5
  76. data/doc/classes/SimpleMapper/Base.src/M000082.html +4 -6
  77. data/doc/classes/SimpleMapper/Base.src/M000083.html +5 -10
  78. data/doc/classes/SimpleMapper/Base.src/M000084.html +4 -4
  79. data/doc/classes/SimpleMapper/{HttpAdapter.src/M000057.html → Base.src/M000085.html} +4 -4
  80. data/doc/classes/SimpleMapper/Base.src/M000086.html +19 -0
  81. data/doc/classes/SimpleMapper/Base.src/M000087.html +20 -0
  82. data/doc/classes/SimpleMapper/Base.src/M000088.html +24 -0
  83. data/doc/classes/SimpleMapper/Base.src/M000089.html +18 -0
  84. data/doc/classes/SimpleMapper/HttpAdapter.html +40 -40
  85. data/doc/classes/SimpleMapper/HttpAdapter.src/{M000056.html → M000059.html} +1 -1
  86. data/doc/classes/SimpleMapper/HttpAdapter.src/M000060.html +4 -4
  87. data/doc/classes/SimpleMapper/HttpAdapter.src/M000061.html +5 -4
  88. data/doc/classes/SimpleMapper/HttpAdapter.src/M000063.html +5 -4
  89. data/doc/classes/SimpleMapper/HttpAdapter.src/M000064.html +18 -0
  90. data/doc/classes/SimpleMapper/HttpAdapter.src/{M000062.html → M000065.html} +1 -1
  91. data/doc/classes/SimpleMapper/HttpAdapter.src/M000066.html +18 -0
  92. data/doc/classes/SimpleMapper/HttpOAuthExtension.html +22 -22
  93. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000051.html +27 -4
  94. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000049.html → M000052.html} +1 -3
  95. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000050.html → M000053.html} +1 -1
  96. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000054.html +24 -0
  97. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.html +10 -10
  98. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000046.html → M000049.html} +0 -0
  99. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000047.html → M000050.html} +0 -0
  100. data/doc/classes/SimpleMapper/SimpleModel.html +20 -20
  101. data/doc/classes/SimpleMapper/SimpleModel.src/M000045.html +4 -10
  102. data/doc/classes/SimpleMapper/SimpleModel.src/{M000043.html → M000046.html} +0 -0
  103. data/doc/classes/SimpleMapper/SimpleModel.src/{M000044.html → M000047.html} +0 -0
  104. data/doc/classes/SimpleMapper/SimpleModel.src/M000048.html +24 -0
  105. data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.html +5 -5
  106. data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/{M000055.html → M000058.html} +5 -3
  107. data/doc/classes/SimpleMapper/XmlFormat.html +15 -15
  108. data/doc/classes/SimpleMapper/XmlFormat.src/{M000052.html → M000055.html} +1 -1
  109. data/doc/classes/SimpleMapper/XmlFormat.src/{M000053.html → M000056.html} +1 -1
  110. data/doc/classes/SimpleMapper/XmlFormat.src/{M000054.html → M000057.html} +4 -2
  111. data/doc/classes/Time.html +139 -0
  112. data/doc/classes/{OAuthController.src/M000006.html → Time.src/M000001.html} +4 -4
  113. data/doc/created.rid +1 -1
  114. data/doc/files/lib/simple_mapper/adapters/http_adapter_rb.html +2 -1
  115. data/doc/files/lib/simple_mapper/base_rb.html +1 -1
  116. data/doc/files/lib/simple_mapper/default_plugins/callbacks_rb.html +1 -1
  117. data/doc/files/lib/simple_mapper/default_plugins/oauth_rb.html +1 -7
  118. data/doc/files/lib/simple_mapper/default_plugins/options_to_query_rb.html +116 -0
  119. data/doc/files/lib/simple_mapper/default_plugins/simple_model_rb.html +1 -1
  120. data/doc/files/lib/simple_mapper/formats/xml_format_rb.html +3 -1
  121. data/doc/files/lib/simple_mapper/support/bliss_serializer_rb.html +2 -1
  122. data/doc/files/lib/simple_mapper/support/core_ext_rb.html +1 -1
  123. data/doc/files/lib/simple_mapper/support/inflections_rb.html +1 -1
  124. data/doc/files/lib/simple_mapper/support/inflector_rb.html +1 -1
  125. data/doc/files/lib/simple_mapper/support_rb.html +1 -1
  126. data/doc/files/lib/simple_mapper_rb.html +1 -1
  127. data/doc/fr_class_index.html +1 -0
  128. data/doc/fr_file_index.html +1 -0
  129. data/doc/fr_method_index.html +89 -84
  130. data/lib/simple_mapper/adapters/http_adapter.rb +4 -2
  131. data/lib/simple_mapper/base.rb +46 -23
  132. data/lib/simple_mapper/default_plugins/oauth.rb +3 -6
  133. data/lib/simple_mapper/default_plugins/options_to_query.rb +31 -0
  134. data/lib/simple_mapper/formats/xml_format.rb +10 -3
  135. data/lib/simple_mapper/support/bliss_serializer.rb +3 -113
  136. data/lib/simple_mapper/support/core_ext.rb +6 -2
  137. data/lib/simple_mapper/support/inflections.rb +1 -1
  138. metadata +52 -43
  139. data/doc/classes/Inflector/Inflections.src/M000032.html +0 -18
  140. data/doc/classes/Inflector/Inflections.src/M000033.html +0 -18
  141. data/doc/classes/Inflector.src/M000018.html +0 -25
  142. data/doc/classes/Inflector.src/M000019.html +0 -25
  143. data/doc/classes/OAuthController.src/M000005.html +0 -22
  144. data/doc/classes/Serialize.src/M000013.html +0 -21
  145. data/doc/classes/SimpleMapper/Base.src/M000064.html +0 -16
  146. data/doc/classes/SimpleMapper/Base.src/M000065.html +0 -16
  147. data/doc/classes/SimpleMapper/Base.src/M000066.html +0 -22
  148. data/doc/classes/SimpleMapper/HttpAdapter.src/M000058.html +0 -19
  149. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000048.html +0 -49
  150. data/doc/classes/SimpleMapper/SimpleModel.src/M000042.html +0 -18
@@ -0,0 +1,31 @@
1
+ # This simply defines some extensions to various objects to enable smartly converting values to a
2
+ # standard query string understandable by Rails and Merb.
3
+ # First the structural base:
4
+ class Object
5
+ def to_param #:nodoc:
6
+ to_s
7
+ end
8
+ def to_query(key) #:nodoc:
9
+ "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param || "")}"
10
+ end
11
+ end
12
+ class Array
13
+ def to_query(key) #:nodoc:
14
+ collect { |value| value.to_query("#{key}[]") } * '&'
15
+ end
16
+ end
17
+ class Hash
18
+ def to_query(namespace=nil)
19
+ collect do |key, value|
20
+ value.to_query(namespace ? "#{namespace}[#{key}]" : key)
21
+ end * '&'
22
+ end
23
+ end
24
+
25
+ # And then some specifics:
26
+ require 'time'
27
+ class Time
28
+ def to_param
29
+ xmlschema
30
+ end
31
+ end
@@ -1,4 +1,7 @@
1
1
  require 'simple_mapper/support/bliss_serializer'
2
+ require 'rubygems'
3
+ gem 'formattedstring'
4
+ require 'formatted_string'
2
5
 
3
6
  module SimpleMapper
4
7
  module XmlFormat
@@ -11,7 +14,9 @@ module SimpleMapper
11
14
  end
12
15
 
13
16
  def to_xml
14
- Serialize.object_to_xml(self, :key_name => 'self').to_s
17
+ xml = Serialize.object_to_xml(self, :key_name => 'self').to_s
18
+ puts "POST XML: #{xml}"
19
+ xml
15
20
  end
16
21
 
17
22
  module ClassMethods
@@ -33,14 +38,16 @@ module SimpleMapper
33
38
  # doc could include a single 'model' element, or a 'models' wrapper around several.
34
39
  puts "Top-level XML key(s): #{doc.keys.inspect}" if @debug
35
40
  key = doc.keys.first
36
- if doc[key].keys.uniq == [key.singularize] && doc[key][key.singularize].is_a?(Array)
41
+ if doc[key] && doc[key].keys.uniq == [key.singularize] && doc[key][key.singularize].is_a?(Array)
37
42
  puts "Several objects returned under key '#{key}'/'#{key.singularize}':" if @debug
38
43
  doc[key][key.singularize].collect do |e|
39
44
  puts "Obj: #{e.inspect}" if @debug
40
45
  Object.module_eval("::#{key.singularize.camelize}", __FILE__, __LINE__).new(e)
41
46
  end
42
- else # top-level must be single object
47
+ elsif doc[key] # top-level must be single object
43
48
  Object.module_eval("::#{key.singularize.camelize}", __FILE__, __LINE__).new(Serialize.hash_from_xml(xml)[self.name.underscore])
49
+ else
50
+ nil
44
51
  end
45
52
  end
46
53
  end
@@ -1,89 +1,7 @@
1
1
  require 'rexml/light/node'
2
2
  require 'rexml/document'
3
-
4
- # This is a slighly modified version of the XMLUtilityNode from
5
- # http://merb.devjavu.com/projects/merb/ticket/95 (has.sox@gmail.com)
6
- # It's mainly just adding vowels, as I ht cd wth n vwls :)
7
- # This represents the hard part of the work, all I did was change the underlying
8
- # parser
9
- class REXMLUtilityNode # :nodoc:
10
- attr_accessor :name, :attributes, :children
11
-
12
- def initialize(name, attributes = {})
13
- @name = name.tr("-", "_")
14
- @attributes = undasherize_keys(attributes)
15
- @children = []
16
- @text = false
17
- end
18
-
19
- def add_node(node)
20
- @text = true if node.is_a? String
21
- @children << node
22
- end
23
-
24
- def to_hash
25
- if @text
26
- return { name => typecast_value( translate_xml_entities( inner_html ) ) }
27
- else
28
- #change repeating groups into an array
29
- # group by the first key of each element of the array to find repeating groups
30
- groups = @children.group_by{ |c| c.name }
31
-
32
- hash = {}
33
- groups.each do |key, values|
34
- if values.size == 1
35
- hash.merge! values.first
36
- else
37
- hash.merge! key => values.map { |element| element.to_hash[key] }
38
- end
39
- end
40
-
41
- # merge the arrays, including attributes
42
- hash.merge! attributes unless attributes.empty?
43
-
44
- { name => hash }
45
- end
46
- end
47
-
48
- def typecast_value(value)
49
- return value unless attributes["type"]
50
-
51
- case attributes["type"]
52
- when "integer" then value.to_i
53
- when "boolean" then value.strip == "true"
54
- when "datetime" then ::Time.parse(value).utc
55
- when "date" then ::Date.parse(value)
56
- else value
57
- end
58
- end
59
-
60
- def translate_xml_entities(value)
61
- value.gsub(/&lt;/, "<").
62
- gsub(/&gt;/, ">").
63
- gsub(/&quot;/, '"').
64
- gsub(/&apos;/, "'").
65
- gsub(/&amp;/, "&")
66
- end
67
-
68
- def undasherize_keys(params)
69
- params.keys.each do |key, vvalue|
70
- params[key.tr("-", "_")] = params.delete(key)
71
- end
72
- params
73
- end
74
-
75
- def inner_html
76
- @children.join
77
- end
78
-
79
- def to_html
80
- "<#{name}#{attributes.to_xml_attributes}>#{inner_html}</#{name}>"
81
- end
82
-
83
- def to_s
84
- to_html
85
- end
86
- end
3
+ gem 'formattedstring'
4
+ require 'formatted_string'
87
5
 
88
6
  module Serialize
89
7
  XML_OPTIONS = {
@@ -123,35 +41,7 @@ module Serialize
123
41
  end
124
42
 
125
43
  def self.hash_from_xml(xml,options={})
126
- options = XML_OPTIONS.merge(options)
127
-
128
- stack = []
129
- parser = REXML::Parsers::BaseParser.new(xml)
130
-
131
- while true
132
- event = parser.pull
133
- case event[0]
134
- when :end_document
135
- break
136
- when :end_doctype, :start_doctype
137
- # do nothing
138
- when :start_element
139
- stack.push REXMLUtilityNode.new(event[1], event[2])
140
- when :end_element
141
- if stack.size > 1
142
- temp = stack.pop
143
- stack.last.add_node(temp)
144
- end
145
- when :text, :cdata
146
- stack.last.add_node(event[1]) unless event[1].strip.length == 0
147
- end
148
- end
149
- data = stack.pop.to_hash
150
-
151
- # Turn any {"nil" => "true"} into just nil
152
- data.crawl {|h,k,v| h[k] = nil if v == {}; v} unless options[:report_nil]
153
- data.crawl {|h,k,v| h[k] = nil if v == {} || v == {'nil' => 'true'}; v} if options[:report_nil]
154
- data
44
+ xml.format=(:xml).to_hash
155
45
  end
156
46
  end
157
47
 
@@ -2,8 +2,8 @@ require 'ruby2ruby'
2
2
 
3
3
  class Object
4
4
  # Calls the block in the context of self, and returns self.
5
- def extended(&block)
6
- self.send(:eval, block.to_ruby).call
5
+ def extended(*args, &block)
6
+ self.send(:eval, block.to_ruby).call(*args)
7
7
  self
8
8
  end
9
9
  end
@@ -42,6 +42,10 @@ class Hash
42
42
  end
43
43
 
44
44
  class Array
45
+ def except(element)
46
+ reject {|e| e == element}
47
+ end
48
+
45
49
  def crawl(&block)
46
50
  raise ArgumentError, "no block given" unless block_given?
47
51
  self.each do |v|
@@ -109,4 +109,4 @@ end
109
109
 
110
110
  class String
111
111
  include Inflections
112
- end
112
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplemapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Parker
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-11 00:00:00 -04:00
12
+ date: 2008-03-17 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -30,6 +30,7 @@ files:
30
30
  - lib/simple_mapper/default_plugins
31
31
  - lib/simple_mapper/default_plugins/callbacks.rb
32
32
  - lib/simple_mapper/default_plugins/oauth.rb
33
+ - lib/simple_mapper/default_plugins/options_to_query.rb
33
34
  - lib/simple_mapper/default_plugins/simple_model.rb
34
35
  - lib/simple_mapper/formats
35
36
  - lib/simple_mapper/formats/xml_format.rb
@@ -46,33 +47,32 @@ files:
46
47
  - doc/classes
47
48
  - doc/classes/Array.html
48
49
  - doc/classes/Array.src
49
- - doc/classes/Array.src/M000001.html
50
+ - doc/classes/Array.src/M000005.html
51
+ - doc/classes/Array.src/M000006.html
50
52
  - doc/classes/Callbacks.html
51
53
  - doc/classes/Callbacks.src
52
- - doc/classes/Callbacks.src/M000037.html
53
- - doc/classes/Callbacks.src/M000038.html
54
- - doc/classes/Callbacks.src/M000039.html
54
+ - doc/classes/Callbacks.src/M000040.html
55
+ - doc/classes/Callbacks.src/M000041.html
56
+ - doc/classes/Callbacks.src/M000042.html
55
57
  - doc/classes/Enumerable.html
56
58
  - doc/classes/Enumerable.src
57
- - doc/classes/Enumerable.src/M000040.html
59
+ - doc/classes/Enumerable.src/M000043.html
58
60
  - doc/classes/Hash.html
59
61
  - doc/classes/Hash.src
60
62
  - doc/classes/Hash.src/M000002.html
61
63
  - doc/classes/Hash.src/M000003.html
64
+ - doc/classes/Hash.src/M000004.html
62
65
  - doc/classes/Inflector
63
66
  - doc/classes/Inflector/Inflections.html
64
67
  - doc/classes/Inflector/Inflections.src
65
- - doc/classes/Inflector/Inflections.src/M000031.html
66
- - doc/classes/Inflector/Inflections.src/M000032.html
67
- - doc/classes/Inflector/Inflections.src/M000033.html
68
68
  - doc/classes/Inflector/Inflections.src/M000034.html
69
69
  - doc/classes/Inflector/Inflections.src/M000035.html
70
70
  - doc/classes/Inflector/Inflections.src/M000036.html
71
+ - doc/classes/Inflector/Inflections.src/M000037.html
72
+ - doc/classes/Inflector/Inflections.src/M000038.html
73
+ - doc/classes/Inflector/Inflections.src/M000039.html
71
74
  - doc/classes/Inflector.html
72
75
  - doc/classes/Inflector.src
73
- - doc/classes/Inflector.src/M000017.html
74
- - doc/classes/Inflector.src/M000018.html
75
- - doc/classes/Inflector.src/M000019.html
76
76
  - doc/classes/Inflector.src/M000020.html
77
77
  - doc/classes/Inflector.src/M000021.html
78
78
  - doc/classes/Inflector.src/M000022.html
@@ -84,48 +84,48 @@ files:
84
84
  - doc/classes/Inflector.src/M000028.html
85
85
  - doc/classes/Inflector.src/M000029.html
86
86
  - doc/classes/Inflector.src/M000030.html
87
+ - doc/classes/Inflector.src/M000031.html
88
+ - doc/classes/Inflector.src/M000032.html
89
+ - doc/classes/Inflector.src/M000033.html
87
90
  - doc/classes/Merb
88
91
  - doc/classes/Merb/Request.html
89
92
  - doc/classes/Merb/Request.src
90
- - doc/classes/Merb/Request.src/M000041.html
93
+ - doc/classes/Merb/Request.src/M000044.html
91
94
  - doc/classes/Merb.html
92
95
  - doc/classes/OAuth
93
96
  - doc/classes/OAuth/RequestProxy
94
97
  - doc/classes/OAuth/RequestProxy/Base.html
95
98
  - doc/classes/OAuth/RequestProxy/Base.src
96
- - doc/classes/OAuth/RequestProxy/Base.src/M000012.html
99
+ - doc/classes/OAuth/RequestProxy/Base.src/M000015.html
97
100
  - doc/classes/OAuth/RequestProxy.html
98
101
  - doc/classes/OAuth/Signature
99
102
  - doc/classes/OAuth/Signature/Base.html
100
103
  - doc/classes/OAuth/Signature/Base.src
101
- - doc/classes/OAuth/Signature/Base.src/M000011.html
104
+ - doc/classes/OAuth/Signature/Base.src/M000014.html
102
105
  - doc/classes/OAuth/Signature.html
103
106
  - doc/classes/OAuth.html
104
107
  - doc/classes/OAuthController.html
105
108
  - doc/classes/OAuthController.src
106
- - doc/classes/OAuthController.src/M000005.html
107
- - doc/classes/OAuthController.src/M000006.html
108
- - doc/classes/OAuthController.src/M000007.html
109
109
  - doc/classes/OAuthController.src/M000008.html
110
110
  - doc/classes/OAuthController.src/M000009.html
111
+ - doc/classes/OAuthController.src/M000010.html
112
+ - doc/classes/OAuthController.src/M000011.html
113
+ - doc/classes/OAuthController.src/M000012.html
111
114
  - doc/classes/Object.html
112
115
  - doc/classes/Object.src
113
- - doc/classes/Object.src/M000010.html
116
+ - doc/classes/Object.src/M000013.html
114
117
  - doc/classes/Proc.html
115
118
  - doc/classes/Proc.src
116
- - doc/classes/Proc.src/M000004.html
119
+ - doc/classes/Proc.src/M000007.html
117
120
  - doc/classes/Serialize.html
118
121
  - doc/classes/Serialize.src
119
- - doc/classes/Serialize.src/M000013.html
120
- - doc/classes/Serialize.src/M000014.html
121
- - doc/classes/Serialize.src/M000015.html
122
122
  - doc/classes/Serialize.src/M000016.html
123
+ - doc/classes/Serialize.src/M000017.html
124
+ - doc/classes/Serialize.src/M000018.html
125
+ - doc/classes/Serialize.src/M000019.html
123
126
  - doc/classes/SimpleMapper
124
127
  - doc/classes/SimpleMapper/Base.html
125
128
  - doc/classes/SimpleMapper/Base.src
126
- - doc/classes/SimpleMapper/Base.src/M000064.html
127
- - doc/classes/SimpleMapper/Base.src/M000065.html
128
- - doc/classes/SimpleMapper/Base.src/M000066.html
129
129
  - doc/classes/SimpleMapper/Base.src/M000067.html
130
130
  - doc/classes/SimpleMapper/Base.src/M000068.html
131
131
  - doc/classes/SimpleMapper/Base.src/M000069.html
@@ -144,43 +144,51 @@ files:
144
144
  - doc/classes/SimpleMapper/Base.src/M000082.html
145
145
  - doc/classes/SimpleMapper/Base.src/M000083.html
146
146
  - doc/classes/SimpleMapper/Base.src/M000084.html
147
+ - doc/classes/SimpleMapper/Base.src/M000085.html
148
+ - doc/classes/SimpleMapper/Base.src/M000086.html
149
+ - doc/classes/SimpleMapper/Base.src/M000087.html
150
+ - doc/classes/SimpleMapper/Base.src/M000088.html
151
+ - doc/classes/SimpleMapper/Base.src/M000089.html
147
152
  - doc/classes/SimpleMapper/HttpAdapter.html
148
153
  - doc/classes/SimpleMapper/HttpAdapter.src
149
- - doc/classes/SimpleMapper/HttpAdapter.src/M000056.html
150
- - doc/classes/SimpleMapper/HttpAdapter.src/M000057.html
151
- - doc/classes/SimpleMapper/HttpAdapter.src/M000058.html
154
+ - doc/classes/SimpleMapper/HttpAdapter.src/M000059.html
152
155
  - doc/classes/SimpleMapper/HttpAdapter.src/M000060.html
153
156
  - doc/classes/SimpleMapper/HttpAdapter.src/M000061.html
154
- - doc/classes/SimpleMapper/HttpAdapter.src/M000062.html
155
157
  - doc/classes/SimpleMapper/HttpAdapter.src/M000063.html
158
+ - doc/classes/SimpleMapper/HttpAdapter.src/M000064.html
159
+ - doc/classes/SimpleMapper/HttpAdapter.src/M000065.html
160
+ - doc/classes/SimpleMapper/HttpAdapter.src/M000066.html
156
161
  - doc/classes/SimpleMapper/HttpOAuthExtension.html
157
162
  - doc/classes/SimpleMapper/HttpOAuthExtension.src
158
- - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000048.html
159
- - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000049.html
160
- - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000050.html
161
163
  - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000051.html
164
+ - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000052.html
165
+ - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000053.html
166
+ - doc/classes/SimpleMapper/HttpOAuthExtension.src/M000054.html
162
167
  - doc/classes/SimpleMapper/SimpleModel
163
168
  - doc/classes/SimpleMapper/SimpleModel/ClassMethods.html
164
169
  - doc/classes/SimpleMapper/SimpleModel/ClassMethods.src
165
- - doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/M000046.html
166
- - doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/M000047.html
170
+ - doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/M000049.html
171
+ - doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/M000050.html
167
172
  - doc/classes/SimpleMapper/SimpleModel.html
168
173
  - doc/classes/SimpleMapper/SimpleModel.src
169
- - doc/classes/SimpleMapper/SimpleModel.src/M000042.html
170
- - doc/classes/SimpleMapper/SimpleModel.src/M000043.html
171
- - doc/classes/SimpleMapper/SimpleModel.src/M000044.html
172
174
  - doc/classes/SimpleMapper/SimpleModel.src/M000045.html
175
+ - doc/classes/SimpleMapper/SimpleModel.src/M000046.html
176
+ - doc/classes/SimpleMapper/SimpleModel.src/M000047.html
177
+ - doc/classes/SimpleMapper/SimpleModel.src/M000048.html
173
178
  - doc/classes/SimpleMapper/XmlFormat
174
179
  - doc/classes/SimpleMapper/XmlFormat/ClassMethods.html
175
180
  - doc/classes/SimpleMapper/XmlFormat/ClassMethods.src
176
- - doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/M000055.html
181
+ - doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/M000058.html
177
182
  - doc/classes/SimpleMapper/XmlFormat.html
178
183
  - doc/classes/SimpleMapper/XmlFormat.src
179
- - doc/classes/SimpleMapper/XmlFormat.src/M000052.html
180
- - doc/classes/SimpleMapper/XmlFormat.src/M000053.html
181
- - doc/classes/SimpleMapper/XmlFormat.src/M000054.html
184
+ - doc/classes/SimpleMapper/XmlFormat.src/M000055.html
185
+ - doc/classes/SimpleMapper/XmlFormat.src/M000056.html
186
+ - doc/classes/SimpleMapper/XmlFormat.src/M000057.html
182
187
  - doc/classes/SimpleMapper.html
183
188
  - doc/classes/String.html
189
+ - doc/classes/Time.html
190
+ - doc/classes/Time.src
191
+ - doc/classes/Time.src/M000001.html
184
192
  - doc/created.rid
185
193
  - doc/files
186
194
  - doc/files/lib
@@ -191,6 +199,7 @@ files:
191
199
  - doc/files/lib/simple_mapper/default_plugins
192
200
  - doc/files/lib/simple_mapper/default_plugins/callbacks_rb.html
193
201
  - doc/files/lib/simple_mapper/default_plugins/oauth_rb.html
202
+ - doc/files/lib/simple_mapper/default_plugins/options_to_query_rb.html
194
203
  - doc/files/lib/simple_mapper/default_plugins/simple_model_rb.html
195
204
  - doc/files/lib/simple_mapper/formats
196
205
  - doc/files/lib/simple_mapper/formats/xml_format_rb.html
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>plural (Inflector::Inflections)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 33</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">plural</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
15
- <span class="ruby-ivar">@plurals</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, [<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>])
16
- <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>singular (Inflector::Inflections)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 39</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singular</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
15
- <span class="ruby-ivar">@singulars</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, [<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>])
16
- <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>pluralize (Inflector)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 99</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">word</span>)
15
- <span class="ruby-identifier">result</span> = <span class="ruby-identifier">word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
16
-
17
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">uncountables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">downcase</span>)
18
- <span class="ruby-identifier">result</span>
19
- <span class="ruby-keyword kw">else</span>
20
- <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">plurals</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)<span class="ruby-operator">|</span> <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>) }
21
- <span class="ruby-identifier">result</span>
22
- <span class="ruby-keyword kw">end</span>
23
- <span class="ruby-keyword kw">end</span></pre>
24
- </body>
25
- </html>
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>singularize (Inflector)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 119</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">word</span>)
15
- <span class="ruby-identifier">result</span> = <span class="ruby-identifier">word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
16
-
17
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">uncountables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">downcase</span>)
18
- <span class="ruby-identifier">result</span>
19
- <span class="ruby-keyword kw">else</span>
20
- <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">singulars</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)<span class="ruby-operator">|</span> <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>) }
21
- <span class="ruby-identifier">result</span>
22
- <span class="ruby-keyword kw">end</span>
23
- <span class="ruby-keyword kw">end</span></pre>
24
- </body>
25
- </html>
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (OAuthController)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 104</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">controller</span>, <span class="ruby-identifier">model</span>, <span class="ruby-identifier">consumer_key</span>, <span class="ruby-identifier">consumer_secret</span>, <span class="ruby-identifier">options</span>={})
15
- <span class="ruby-ivar">@controller</span> = <span class="ruby-identifier">controller</span>
16
- <span class="ruby-ivar">@model</span> = <span class="ruby-identifier">model</span>
17
- <span class="ruby-ivar">@options</span> = <span class="ruby-constant">DEFAULT_OPTIONS</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
18
- <span class="ruby-ivar">@model</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:model</span>)
19
- <span class="ruby-ivar">@consumer</span> = <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Consumer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">consumer_key</span>, <span class="ruby-identifier">consumer_secret</span>, <span class="ruby-identifier">options</span>)
20
- <span class="ruby-keyword kw">end</span></pre>
21
- </body>
22
- </html>
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>object_to_xml (Serialize)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/bliss_serializer.rb, line 94</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">object_to_xml</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">options</span>={})
15
- <span class="ruby-comment cmt"># Automatically set the key_name for DataMapper objects</span>
16
- <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">:key_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">table</span>.<span class="ruby-identifier">key</span>.<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:table</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:persistent?</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">persistent?</span>
17
- <span class="ruby-comment cmt"># Should do the above also for ActiveRecord...</span>
18
- <span class="ruby-identifier">to_xml</span>(<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">underscore</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_hash</span>(<span class="ruby-identifier">options</span>), <span class="ruby-identifier">options</span>)
19
- <span class="ruby-keyword kw">end</span></pre>
20
- </body>
21
- </html>
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>debug? (SimpleMapper::Base)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/base.rb, line 7</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug?</span>; <span class="ruby-ivar">@debug</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>debug! (SimpleMapper::Base)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/base.rb, line 8</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug!</span>; <span class="ruby-ivar">@debug</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>connection_adapter= (SimpleMapper::Base)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/base.rb, line 10</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connection_adapter=</span>(<span class="ruby-identifier">adapter</span>,<span class="ruby-identifier">debug</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
- <span class="ruby-comment cmt"># Should complain if the adapter doesn't exist.</span>
16
- <span class="ruby-ivar">@connection_adapter</span> = <span class="ruby-identifier">adapter</span>
17
- <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{File.dirname(__FILE__)}/adapters/#{@connection_adapter}_adapter&quot;</span>
18
- <span class="ruby-ivar">@connection_init</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
19
- <span class="ruby-ivar">@connection_debug</span> = <span class="ruby-identifier">debug</span>
20
- <span class="ruby-keyword kw">end</span></pre>
21
- </body>
22
- </html>