ECS 0.1.4 → 0.1.5

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.
Files changed (4) hide show
  1. data/CHANGELOG +4 -0
  2. data/lib/ecs.rb +3 -2
  3. data/lib/ecs/help.rb +19 -0
  4. metadata +2 -2
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.5
2
+ * ECS::Help is now YAMLable, despite the fact that Libxml-Ruby is not.
3
+
4
+
1
5
  0.1.4
2
6
  * ECS.cache_directory=() now uses FileUtils.mkdir_p() instead of Dir.mkdir()
3
7
 
data/lib/ecs.rb CHANGED
@@ -66,8 +66,7 @@ module ECS
66
66
  raise NameError, "#{e.message}"#Are you sure that ECS::#{klass_name} is defined?"
67
67
  end
68
68
  end
69
-
70
-
69
+
71
70
  def self.counter
72
71
  @@counter
73
72
  end
@@ -168,6 +167,7 @@ module ECS
168
167
  @@elements=nil
169
168
  @@help_xml=nil
170
169
  ECS::ResponseGroups['#{klass_name}'] = self
170
+ yaml_as \"tag:ecs.rubyforge.org,2007:#{klass_name.underscore}\"
171
171
  end
172
172
  #{klass_name}"
173
173
  #puts string_to_eval
@@ -187,6 +187,7 @@ module ECS
187
187
  @@default_response_groups=nil
188
188
  @@available_response_groups=nil
189
189
  ECS::Operations['#{klass_name}'] = self
190
+ yaml_as \"tag:ecs.rubyforge.org,2007:#{klass_name.underscore}\"
190
191
  end
191
192
  #{klass_name}"
192
193
  # puts string_to_eval
@@ -1,4 +1,5 @@
1
1
  #!/usr/local/bin/ruby
2
+ require 'yaml'
2
3
 
3
4
  module ECS
4
5
  class Help
@@ -124,6 +125,24 @@ module ECS
124
125
  self.class.help_xml( force )
125
126
  end
126
127
 
128
+ YAML.add_domain_type( "ecs.rubyforge.org,2007", "Help" ) do |type, val|
129
+ return val
130
+ end
131
+
132
+ yaml_as "tag:ecs.rubyforge.org,2007:#{operation_name.underscore}"
133
+
134
+ def to_yaml( opts = {} )
135
+ YAML.quick_emit( self.object_id, opts ) { |out|
136
+ out.map( taguri ) { |map|
137
+ map.add( 'parameters', self.parameters )
138
+ }
139
+ }
140
+ end
141
+
142
+ def self.yaml_new( klass, tag, val )
143
+ ECS.send( ( tag =~ /:([^:]*)$/ ? $1 : 'help' ), val['parameters'] )
144
+ end
145
+
127
146
  def xml( force=false )
128
147
  if force || @xml.nil?
129
148
  self.class.required_parameters.each do |p|
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: ECS
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.4
7
- date: 2007-03-14 00:00:00 -07:00
6
+ version: 0.1.5
7
+ date: 2007-03-17 00:00:00 -07:00
8
8
  summary: A Ruby interface to Amazon's E-Commerce Service.
9
9
  require_paths:
10
10
  - lib