rubysl-yaml 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/yaml/store.rb CHANGED
@@ -46,20 +46,15 @@ class YAML::Store < PStore
46
46
  #
47
47
  # Options passed in through +yaml_opts+ will be used when converting the
48
48
  # store to YAML via Hash#to_yaml().
49
- def initialize( *o )
50
- @opt = {}
51
- if String === o.first
52
- super(o.shift)
53
- end
54
- if o.last.is_a? Hash
55
- @opt.update(o.pop)
56
- end
49
+ def initialize file_name, yaml_opts = {}
50
+ @opt = yaml_opts
51
+ super
57
52
  end
58
53
 
59
54
  # :stopdoc:
60
55
 
61
56
  def dump(table)
62
- @table.to_yaml(@opt)
57
+ YAML.dump @table
63
58
  end
64
59
 
65
60
  def load(content)
@@ -75,7 +70,7 @@ class YAML::Store < PStore
75
70
  false
76
71
  end
77
72
 
78
- EMPTY_MARSHAL_DATA = {}.to_yaml
73
+ EMPTY_MARSHAL_DATA = YAML.dump({})
79
74
  EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
80
75
  def empty_marshal_data
81
76
  EMPTY_MARSHAL_DATA
data/rubysl-yaml.gemspec CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
 
14
14
  spec.files = `git ls-files`.split($/)
15
15
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.extensions = ["ext/rubysl/syck/extconf.rb"]
16
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
18
  spec.require_paths = ["lib"]
18
19
 
@@ -21,4 +22,5 @@ Gem::Specification.new do |spec|
21
22
  spec.add_development_dependency "bundler", "~> 1.3"
22
23
  spec.add_development_dependency "rake", "~> 10.0"
23
24
  spec.add_development_dependency "mspec", "~> 1.5"
25
+ spec.add_development_dependency "rubysl-prettyprint", "~> 2.0"
24
26
  end
metadata CHANGED
@@ -1,77 +1,118 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysl-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-17 00:00:00.000000000 Z
11
+ date: 2013-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubysl-prettyprint
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
55
69
  description: Ruby standard library YAML.
56
70
  email:
57
71
  - brixen@gmail.com
58
72
  executables: []
59
- extensions: []
73
+ extensions:
74
+ - ext/rubysl/syck/extconf.rb
60
75
  extra_rdoc_files: []
61
76
  files:
62
- - .gitignore
63
- - .travis.yml
77
+ - ".gitignore"
78
+ - ".travis.yml"
64
79
  - Gemfile
65
80
  - LICENSE
66
81
  - README.md
67
82
  - Rakefile
83
+ - ext/rubysl/syck/bytecode.c
84
+ - ext/rubysl/syck/emitter.c
85
+ - ext/rubysl/syck/extconf.rb
86
+ - ext/rubysl/syck/gram.c
87
+ - ext/rubysl/syck/gram.h
88
+ - ext/rubysl/syck/handler.c
89
+ - ext/rubysl/syck/implicit.c
90
+ - ext/rubysl/syck/node.c
91
+ - ext/rubysl/syck/rubyext.c
92
+ - ext/rubysl/syck/syck.c
93
+ - ext/rubysl/syck/syck.h
94
+ - ext/rubysl/syck/token.c
95
+ - ext/rubysl/syck/yaml2byte.c
96
+ - ext/rubysl/syck/yamlbyte.h
68
97
  - lib/rubysl/yaml.rb
69
98
  - lib/rubysl/yaml/version.rb
70
99
  - lib/rubysl/yaml/yaml.rb
100
+ - lib/syck.rb
101
+ - lib/syck/baseemitter.rb
102
+ - lib/syck/basenode.rb
103
+ - lib/syck/constants.rb
104
+ - lib/syck/encoding.rb
105
+ - lib/syck/error.rb
106
+ - lib/syck/loader.rb
107
+ - lib/syck/rubytypes.rb
108
+ - lib/syck/stream.rb
109
+ - lib/syck/tag.rb
110
+ - lib/syck/types.rb
111
+ - lib/syck/yamlnode.rb
112
+ - lib/syck/ypath.rb
71
113
  - lib/yaml.rb
72
114
  - lib/yaml/dbm.rb
73
115
  - lib/yaml/store.rb
74
- - lib/yaml/syck.rb
75
116
  - rubysl-yaml.gemspec
76
117
  - spec/add_builtin_type_spec.rb
77
118
  - spec/add_domain_type_spec.rb
@@ -116,17 +157,17 @@ require_paths:
116
157
  - lib
117
158
  required_ruby_version: !ruby/object:Gem::Requirement
118
159
  requirements:
119
- - - ~>
160
+ - - "~>"
120
161
  - !ruby/object:Gem::Version
121
162
  version: '2.0'
122
163
  required_rubygems_version: !ruby/object:Gem::Requirement
123
164
  requirements:
124
- - - '>='
165
+ - - ">="
125
166
  - !ruby/object:Gem::Version
126
167
  version: '0'
127
168
  requirements: []
128
169
  rubyforge_project:
129
- rubygems_version: 2.0.7
170
+ rubygems_version: 2.2.0
130
171
  signing_key:
131
172
  specification_version: 4
132
173
  summary: Ruby standard library YAML.
data/lib/yaml/syck.rb DELETED
@@ -1,53 +0,0 @@
1
- # $Id$
2
- #
3
- # = yaml/syck.rb:
4
- #
5
-
6
- require 'stringio'
7
- require 'syck/ext/syck'
8
- require 'syck/error'
9
- require 'syck/syck'
10
- require 'syck/tag'
11
- require 'syck/stream'
12
- require 'syck/constants'
13
- require 'syck/rubytypes'
14
- require 'syck/types'
15
-
16
- module Syck
17
- #--
18
- # For Rubinius, replaces the rb_iterate call to syck_set_ivars.
19
- #++
20
- def self.set_ivars(hsh, obj)
21
- hsh.each do |key, value|
22
- obj.instance_variable_set :"@#{key}", value
23
- end
24
- end
25
-
26
- #--
27
- # For Rubinius, replaces the rb_iterate call to syck_merge_i.
28
- #++
29
- def self.merge_i(ary, hsh)
30
- ary.each do |entry|
31
- begin
32
- entry = Rubinius::Type.coerce_to entry, Hash, :to_hash
33
- hsh.update entry
34
- rescue
35
- # ignore coercion errors
36
- end
37
- end
38
-
39
- nil
40
- end
41
-
42
- #--
43
- # For Rubinius, replaces rb_syck_mktime.
44
- #++
45
- def self.mktime(str)
46
- require "date"
47
- begin
48
- DateTime.parse(str).to_time
49
- rescue ArgumentError
50
- # nothing
51
- end
52
- end
53
- end