parsing-utils 1.0.0 → 1.1.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
data/lib/parsing_utils.rb CHANGED
@@ -12,7 +12,7 @@ module ParsingUtils
12
12
  def available_parsers; @@available_parsers; end
13
13
  def add(parser, *mime_types)
14
14
  parser.dependencies
15
- parser.supported_mime_types = mime_types
15
+ parser.supported_mime_types = [mime_types, parser.default_mime_type].flatten.compact.uniq
16
16
  @@available_parsers << parser
17
17
  self
18
18
  end
@@ -34,6 +34,9 @@ module ParsingUtils
34
34
  def dependencies
35
35
  require 'json'
36
36
  end
37
+ def default_mime_type
38
+ 'application/json'
39
+ end
37
40
  def dump(object, options = {})
38
41
  options = options.dup
39
42
  case options.delete(:format)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{parsing-utils}
8
- s.version = "1.0.0"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cyril Rohr"]
12
- s.date = %q{2009-10-21}
12
+ s.date = %q{2009-10-22}
13
13
  s.description = %q{Some classes useful for parsing matters (especially to select a parser based on a given mime type)}
14
14
  s.email = %q{cyril.rohr@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -28,4 +28,5 @@ describe ParsingUtils do
28
28
  ParsingUtils::JSONParser.dump(Foo.new).should == "{\"1\":3,\"3\":5}"
29
29
  end
30
30
  end
31
+
31
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsing-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Rohr
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-21 00:00:00 +02:00
12
+ date: 2009-10-22 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15