diffable_yaml 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ede5b1945e4249a0b29dd466e7263ea5feb7b59
4
- data.tar.gz: 93551e520ff49a88346cbd946e90a0e835ff5baf
3
+ metadata.gz: 4110cf2f990c7509d53b62dcc3eb12aedade1c05
4
+ data.tar.gz: f6f6d6de5cfc4a822a06c126d22f59e0e8aaa18b
5
5
  SHA512:
6
- metadata.gz: 89562fddf48689216c8345ba7fe9de12561d4192093cc4a48c128092e5f64b7d2a2ad326e3759cd0659b76cb397e8949a0380ed4538874a35d6b8ed2499cde80
7
- data.tar.gz: dc21e0b117ba61aecb1b5b8fc8df406e0944a78d5d368d8b733f29e498321e4d1ef2c1219e6e0f228393b9360f7fb7e229d1487fcd0aa8bf4387d15a08cd85c1
6
+ metadata.gz: ea217682af5d3d6e9654d528e87da9553667d81578a3b2335812cdaac4b784b93c4e50c784f794c90b4ea1a99583a44b43ec942be26723787443d2eae93b18e1
7
+ data.tar.gz: efd47bf73085832fe6eae351fcb4fe643eea813ee2f89db9a51211a73466b3ae2139a770068ce4bb2f815521173dd2077a995784cf3d7d6ed4d22426f1e5ab7c
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
- # require "rspec/core/rake_task"
2
+ require "rspec/core/rake_task"
3
3
 
4
- # RSpec::Core::RakeTask.new(:spec)
4
+ RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  this is a little chunck of code i use to dump Ruby objects to YAML with Hash
14
14
  keys in a some-what consistent order.
15
15
 
16
- i do this because i often find myself using YAML files as data storage and
16
+ i do this because i often find myself using YAML files as data storage and
17
17
  this makes it a lot easier to compare versions with text-based diff toolspec.
18
18
 
19
19
  this lib is horribly alpha and has no tests what-so-ever. i'm sure it's
@@ -27,14 +27,16 @@ against at the moment.
27
27
  EOS
28
28
  spec.homepage = 'https://github.com/nrser/DiffableYAML'
29
29
  spec.license = 'BSD'
30
-
30
+
31
31
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
32
  spec.bindir = "exe"
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ["lib"]
35
-
35
+
36
36
  spec.add_dependency 'psych', '~> 2.0'
37
-
37
+
38
38
  spec.add_development_dependency "bundler", "~> 1.5"
39
39
  spec.add_development_dependency "rake"
40
+ spec.add_development_dependency "rspec"
41
+ spec.add_development_dependency "nrser"
40
42
  end
data/lib/diffable_yaml.rb CHANGED
@@ -8,7 +8,7 @@ module DiffableYAML
8
8
  class DiffableYAMLTree < Psych::Visitors::YAMLTree
9
9
  def self.create options = {}, emitter = nil
10
10
  preorder = options.delete(:preorder) || []
11
- instance = Psych::Visitors::YAMLTree.create options, emitter
11
+ instance = super options, emitter
12
12
  instance.instance_variable_set '@preorder', preorder
13
13
  instance
14
14
  end
@@ -17,9 +17,9 @@ module DiffableYAML
17
17
  tag = o.class == ::Hash ? nil : "!ruby/hash:#{o.class}"
18
18
  implicit = !tag
19
19
 
20
- register(o, @emitter.start_mapping( nil,
21
- tag,
22
- implicit,
20
+ register(o, @emitter.start_mapping( nil,
21
+ tag,
22
+ implicit,
23
23
  Psych::Nodes::Mapping::BLOCK))
24
24
 
25
25
  @preorder.each do |key|
@@ -73,15 +73,15 @@ module DiffableYAML
73
73
  maptag = '!ruby/string'
74
74
  maptag << ":#{o.class}" unless o.class == ::String
75
75
 
76
- register o, @emitter.start_mapping( nil,
77
- maptag,
78
- false,
76
+ register o, @emitter.start_mapping( nil,
77
+ maptag,
78
+ false,
79
79
  Pysch::Nodes::Mapping::BLOCK)
80
- @emitter.scalar 'str',
81
- nil,
82
- nil,
83
- true,
84
- false,
80
+ @emitter.scalar 'str',
81
+ nil,
82
+ nil,
83
+ true,
84
+ false,
85
85
  Psych::Nodes::Scalar::ANY
86
86
  @emitter.scalar str, nil, tag, plain, quote, style
87
87
 
@@ -102,4 +102,4 @@ module DiffableYAML
102
102
  visitor << o
103
103
  visitor.tree.yaml io, options
104
104
  end
105
- end
105
+ end
@@ -1,3 +1,3 @@
1
1
  module DiffableYAML
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffable_yaml
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
  - nrser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: psych
@@ -52,21 +52,56 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: "this is a little chunck of code i use to dump Ruby objects to YAML with
56
- Hash\nkeys in a some-what consistent order.\n\ni do this because i often find myself
57
- using YAML files as data storage and \nthis makes it a lot easier to compare versions
58
- with text-based diff toolspec.\n\nthis lib is horribly alpha and has no tests what-so-ever.
59
- i'm sure it's\nas full or bugs and bad ideas as 100 lines of code can be. i just
60
- put it\nhere so it's easier for me to use across projectspec. but you're welcome\nto
61
- take it for a spin too if you really want.\n\nthis relies on Psych internals, so
62
- it has a dependency on pysch ~> 2.0.\nit might work fine with other versions; that's
63
- just all i've tested it\nagainst at the moment.\n"
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: nrser
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: |
84
+ this is a little chunck of code i use to dump Ruby objects to YAML with Hash
85
+ keys in a some-what consistent order.
86
+
87
+ i do this because i often find myself using YAML files as data storage and
88
+ this makes it a lot easier to compare versions with text-based diff toolspec.
89
+
90
+ this lib is horribly alpha and has no tests what-so-ever. i'm sure it's
91
+ as full or bugs and bad ideas as 100 lines of code can be. i just put it
92
+ here so it's easier for me to use across projectspec. but you're welcome
93
+ to take it for a spin too if you really want.
94
+
95
+ this relies on Psych internals, so it has a dependency on pysch ~> 2.0.
96
+ it might work fine with other versions; that's just all i've tested it
97
+ against at the moment.
64
98
  email: neil@ztkae.com
65
99
  executables: []
66
100
  extensions: []
67
101
  extra_rdoc_files: []
68
102
  files:
69
103
  - ".gitignore"
104
+ - ".rspec"
70
105
  - Gemfile
71
106
  - LICENSE
72
107
  - README.md