xml_mapper 0.5.2 → 0.5.3

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/VERSION +1 -1
  2. data/lib/xml_mapper.rb +3 -3
  3. data/xml_mapper.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.2
1
+ 0.5.3
data/lib/xml_mapper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "nokogiri"
2
2
  require "xml_mapper_hash"
3
- require "parsedate"
4
3
  require "date"
4
+ require "time"
5
5
 
6
6
  class XmlMapper
7
7
  attr_accessor :mappings, :after_map_block, :within_xpath
@@ -213,8 +213,8 @@ class XmlMapper
213
213
  return string.to_i if string.match(/^\d+$/)
214
214
  string = "00:#{string}" if string.match(/^(\d+):(\d+)$/)
215
215
  string = string.to_s.gsub(/PT(\d+M.*)/,"PT0H\\1") # insert 0H into PT3M12S, for example: PT0H3M12S
216
- year, month, day, hour, minute, second = ParseDate.parsedate(string)
217
- return (hour.to_i * 1 * 3600 + minute.to_i * 1 * 60 + second.to_i).to_i
216
+ time = Time.parse(string)
217
+ return (time.hour.to_i * 1 * 3600 + time.min.to_i * 1 * 60 + time.sec.to_i).to_i
218
218
  end
219
219
 
220
220
  def parse_date(text)
data/xml_mapper.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xml_mapper}
8
- s.version = "0.5.2"
8
+ s.version = "0.5.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tobias Schwab"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml_mapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Schwab