dc-kwalify 0.7.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/contrib/kwalify +1 -1
  4. data/dc-kwalify.gemspec +27 -0
  5. data/lib/kwalify/main.rb +1 -1
  6. data/lib/kwalify/util/testcase-helper.rb +1 -1
  7. data/lib/kwalify/version.rb +5 -0
  8. data/lib/kwalify.rb +1 -7
  9. metadata +83 -203
  10. data/setup.rb +0 -1585
  11. data/test/Rookbook.yaml +0 -10
  12. data/test/data/users-guide/AddressBook.java.expected +0 -40
  13. data/test/data/users-guide/BABEL.data.yaml +0 -24
  14. data/test/data/users-guide/BABEL.schema.yaml +0 -30
  15. data/test/data/users-guide/ExampleAddressBook.java +0 -47
  16. data/test/data/users-guide/Group.java.expected +0 -24
  17. data/test/data/users-guide/Person.java.expected +0 -44
  18. data/test/data/users-guide/address_book.rb +0 -52
  19. data/test/data/users-guide/address_book.schema.yaml +0 -28
  20. data/test/data/users-guide/address_book.yaml +0 -27
  21. data/test/data/users-guide/answers-schema.yaml +0 -12
  22. data/test/data/users-guide/answers-validator.rb +0 -52
  23. data/test/data/users-guide/babel_genclass.result +0 -26
  24. data/test/data/users-guide/config.schema.yaml +0 -7
  25. data/test/data/users-guide/config.yaml +0 -4
  26. data/test/data/users-guide/document01a.yaml +0 -3
  27. data/test/data/users-guide/document01b.yaml +0 -3
  28. data/test/data/users-guide/document02a.yaml +0 -4
  29. data/test/data/users-guide/document02b.yaml +0 -4
  30. data/test/data/users-guide/document03a.yaml +0 -6
  31. data/test/data/users-guide/document03b.yaml +0 -6
  32. data/test/data/users-guide/document04a.yaml +0 -9
  33. data/test/data/users-guide/document04b.yaml +0 -9
  34. data/test/data/users-guide/document05a.yaml +0 -11
  35. data/test/data/users-guide/document05b.yaml +0 -12
  36. data/test/data/users-guide/document06a.yaml +0 -15
  37. data/test/data/users-guide/document06b.yaml +0 -16
  38. data/test/data/users-guide/document07a.yaml +0 -9
  39. data/test/data/users-guide/document07b.yaml +0 -7
  40. data/test/data/users-guide/document12a.json +0 -10
  41. data/test/data/users-guide/document12b.json +0 -6
  42. data/test/data/users-guide/document13a.yaml +0 -17
  43. data/test/data/users-guide/document14a.yaml +0 -3
  44. data/test/data/users-guide/document14b.yaml +0 -3
  45. data/test/data/users-guide/document15a.yaml +0 -6
  46. data/test/data/users-guide/document15b.yaml +0 -5
  47. data/test/data/users-guide/example_address_book.rb +0 -10
  48. data/test/data/users-guide/example_address_book_java.result +0 -32
  49. data/test/data/users-guide/example_address_book_ruby.result +0 -31
  50. data/test/data/users-guide/genclass_java.result +0 -4
  51. data/test/data/users-guide/howto-validation-with-parsing.rb +0 -28
  52. data/test/data/users-guide/howto-validation.rb +0 -25
  53. data/test/data/users-guide/howto3.rb +0 -6
  54. data/test/data/users-guide/howto3.result +0 -5
  55. data/test/data/users-guide/howto3.yaml +0 -8
  56. data/test/data/users-guide/howto5_databinding.result +0 -111
  57. data/test/data/users-guide/invalid01.result +0 -3
  58. data/test/data/users-guide/invalid02.result +0 -5
  59. data/test/data/users-guide/invalid03.result +0 -5
  60. data/test/data/users-guide/invalid04.result +0 -4
  61. data/test/data/users-guide/invalid05.result +0 -11
  62. data/test/data/users-guide/invalid06.result +0 -4
  63. data/test/data/users-guide/invalid07.result +0 -3
  64. data/test/data/users-guide/invalid08.result +0 -3
  65. data/test/data/users-guide/invalid12.json +0 -8
  66. data/test/data/users-guide/invalid14.result +0 -4
  67. data/test/data/users-guide/invalid15.result +0 -4
  68. data/test/data/users-guide/loadbabel.rb +0 -27
  69. data/test/data/users-guide/loadconfig.rb +0 -16
  70. data/test/data/users-guide/loadconfig.result +0 -6
  71. data/test/data/users-guide/models.rb +0 -22
  72. data/test/data/users-guide/option_ha.result +0 -6
  73. data/test/data/users-guide/option_ha_genclass_java.result +0 -7
  74. data/test/data/users-guide/schema01.yaml +0 -3
  75. data/test/data/users-guide/schema02.yaml +0 -12
  76. data/test/data/users-guide/schema03.yaml +0 -9
  77. data/test/data/users-guide/schema04.yaml +0 -20
  78. data/test/data/users-guide/schema05.yaml +0 -29
  79. data/test/data/users-guide/schema06.yaml +0 -11
  80. data/test/data/users-guide/schema12.json +0 -12
  81. data/test/data/users-guide/schema13.yaml +0 -13
  82. data/test/data/users-guide/schema14.yaml +0 -5
  83. data/test/data/users-guide/schema15.yaml +0 -21
  84. data/test/data/users-guide/valid01.result +0 -2
  85. data/test/data/users-guide/valid02.result +0 -2
  86. data/test/data/users-guide/valid03.result +0 -2
  87. data/test/data/users-guide/valid04.result +0 -2
  88. data/test/data/users-guide/valid05.result +0 -2
  89. data/test/data/users-guide/valid06.result +0 -2
  90. data/test/data/users-guide/valid07.result +0 -2
  91. data/test/data/users-guide/valid08.result +0 -2
  92. data/test/data/users-guide/valid12.result +0 -2
  93. data/test/data/users-guide/valid13.result +0 -2
  94. data/test/data/users-guide/valid14.result +0 -2
  95. data/test/data/users-guide/valid15.result +0 -2
  96. data/test/data/users-guide/validate08.rb +0 -37
  97. data/test/test-action.rb +0 -78
  98. data/test/test-action.yaml +0 -738
  99. data/test/test-databinding.rb +0 -83
  100. data/test/test-databinding.yaml +0 -339
  101. data/test/test-main.rb +0 -157
  102. data/test/test-main.yaml +0 -415
  103. data/test/test-metavalidator.rb +0 -80
  104. data/test/test-metavalidator.yaml +0 -1179
  105. data/test/test-parser-yaml.rb +0 -57
  106. data/test/test-parser-yaml.yaml +0 -1749
  107. data/test/test-rule.rb +0 -26
  108. data/test/test-rule.yaml +0 -317
  109. data/test/test-users-guide.rb +0 -75
  110. data/test/test-util.rb +0 -125
  111. data/test/test-validator.rb +0 -95
  112. data/test/test-validator.yaml +0 -986
  113. data/test/test-yaml-parser.rb +0 -47
  114. data/test/test-yaml-parser.yaml +0 -1226
  115. data/test/test.rb +0 -61
data/test/Rookbook.yaml DELETED
@@ -1,10 +0,0 @@
1
-
2
- recipes:
3
-
4
- - product: :diff
5
- ingreds: [ test-parser-yaml.yaml, test-yaml-parser.yaml ]
6
- byprods: [ hoge.yaml, hoge.diff ]
7
- method*: |
8
- sys "ruby -e 's=ARGF.read(); print s.gsub(/^locations:.*?(?=^\\S)/m,\"\").gsub(/Kwalify::SyntaxError/,\"Kwalify::YamlSyntaxError\")' #{@ingreds[0]} > #{@byprods[0]}"
9
- sys! "diff -U5 hoge.yaml #{@ingreds[1]} | tee #{@byprods[1]}"
10
- rm @byprods
@@ -1,40 +0,0 @@
1
- // generated by kwalify from address_book.schema.yaml
2
-
3
- import java.util.*;
4
-
5
- /**
6
- * address-book class
7
- */
8
- public class AddressBook {
9
-
10
- private List _groups;
11
- private List _people;
12
-
13
- public AddressBook() {}
14
-
15
- public AddressBook(Map map) {
16
- List seq;
17
- Object obj;
18
- if ((seq = (List)map.get("groups")) != null) {
19
- for (int i = 0; i < seq.size(); i++) {
20
- if ((obj = seq.get(i)) instanceof Map) {
21
- seq.set(i, new Group((Map)obj));
22
- }
23
- }
24
- }
25
- _groups = seq;
26
- if ((seq = (List)map.get("people")) != null) {
27
- for (int i = 0; i < seq.size(); i++) {
28
- if ((obj = seq.get(i)) instanceof Map) {
29
- seq.set(i, new Person((Map)obj));
30
- }
31
- }
32
- }
33
- _people = seq;
34
- }
35
-
36
- public List getGroups() { return _groups; }
37
- public void setGroups(List groups_) { _groups = groups_; }
38
- public List getPeople() { return _people; }
39
- public void setPeople(List people_) { _people = people_; }
40
- }
@@ -1,24 +0,0 @@
1
- teams:
2
- - &thechildren
3
- name: The Children
4
- desc: Level 7 ESPers
5
- chief: *minamoto # preceding alias
6
- members: [*kaoru, *aoi, *shiho] # preceding aliases
7
-
8
- members:
9
- - &minamoto
10
- name: Kohichi Minamoto
11
- desc: Scientist
12
- team: *thechildren
13
- - &kaoru
14
- name: Kaoru Akashi
15
- desc: Psychokino
16
- team: *thechildren
17
- - &aoi
18
- name: Aoi Nogami
19
- desc: Teleporter
20
- team: *thechildren
21
- - &shiho
22
- name: Shiho Sannomiya
23
- desc: Psycometrer
24
- team: *thechildren
@@ -1,30 +0,0 @@
1
- type: map
2
- required: yes
3
- mapping:
4
- "teams":
5
- type: seq
6
- required: yes
7
- sequence:
8
- - &team
9
- type: map
10
- required: yes
11
- class: Team
12
- mapping:
13
- "name": {type: str, required: yes, unique: yes}
14
- "desc": {type: str}
15
- "chief": *member # preceding alias
16
- "members":
17
- type: seq
18
- sequence: [*member] # preceding alias
19
- "members":
20
- type: seq
21
- required: yes
22
- sequence:
23
- - &member
24
- type: map
25
- required: yes
26
- class: Member
27
- mapping:
28
- "name": {type: str, required: yes, unique: yes}
29
- "desc": {type: str}
30
- "team": *team
@@ -1,47 +0,0 @@
1
- import java.util.*;
2
- import kwalify.*;
3
-
4
- public class ExampleAddressBook {
5
- public static void main(String args[]) throws Exception {
6
- // read schema
7
- String schema_str = Util.readFile("address_book.schema.yaml");
8
- schema_str = Util.untabify(schema_str);
9
- Object schema = new YamlParser(schema_str).parse();
10
-
11
- // read document file
12
- String document_str = Util.readFile("address_book.yaml");
13
- document_str = Util.untabify(document_str);
14
- YamlParser parser = new YamlParser(document_str);
15
- Object document = parser.parse();
16
-
17
- // create address book object
18
- AddressBook addrbook = new AddressBook((Map)document);
19
-
20
- // show groups
21
- List groups = addrbook.getGroups();
22
- if (groups != null) {
23
- for (Iterator it = groups.iterator(); it.hasNext(); ) {
24
- Group group = (Group)it.next();
25
- System.out.println("group name: " + group.getName());
26
- System.out.println("group desc: " + group.getDesc());
27
- System.out.println();
28
- }
29
- }
30
-
31
- // show people
32
- List people = addrbook.getPeople();
33
- if (people != null) {
34
- for (Iterator it = people.iterator(); it.hasNext(); ) {
35
- Person person = (Person)it.next();
36
- System.out.println("person name: " + person.getName());
37
- System.out.println("person group: " + person.getGroup());
38
- System.out.println("person email: " + person.getEmail());
39
- System.out.println("person phone: " + person.getPhone());
40
- System.out.println("person blood: " + person.getBlood());
41
- System.out.println("person birth: " + person.getBirth());
42
- System.out.println();
43
- }
44
- }
45
- }
46
-
47
- }
@@ -1,24 +0,0 @@
1
- // generated by kwalify from address_book.schema.yaml
2
-
3
- import java.util.*;
4
-
5
- /**
6
- * group class
7
- */
8
- public class Group {
9
-
10
- private String _name;
11
- private String _desc;
12
-
13
- public Group() {}
14
-
15
- public Group(Map map) {
16
- _name = (String)map.get("name");
17
- _desc = (String)map.get("desc");
18
- }
19
-
20
- public String getName() { return _name; }
21
- public void setName(String name_) { _name = name_; }
22
- public String getDesc() { return _desc; }
23
- public void setDesc(String desc_) { _desc = desc_; }
24
- }
@@ -1,44 +0,0 @@
1
- // generated by kwalify from address_book.schema.yaml
2
-
3
- import java.util.*;
4
-
5
- /**
6
- * person class
7
- */
8
- public class Person {
9
-
10
- private String _name;
11
- private String _desc;
12
- private String _group;
13
- private String _email;
14
- private String _phone;
15
- private Date _birth;
16
- private String _blood;
17
-
18
- public Person() {}
19
-
20
- public Person(Map map) {
21
- _name = (String)map.get("name");
22
- _desc = (String)map.get("desc");
23
- _group = (String)map.get("group");
24
- _email = (String)map.get("email");
25
- _phone = (String)map.get("phone");
26
- _birth = (Date)map.get("birth");
27
- _blood = (String)map.get("blood");
28
- }
29
-
30
- public String getName() { return _name; }
31
- public void setName(String name_) { _name = name_; }
32
- public String getDesc() { return _desc; }
33
- public void setDesc(String desc_) { _desc = desc_; }
34
- public String getGroup() { return _group; }
35
- public void setGroup(String group_) { _group = group_; }
36
- public String getEmail() { return _email; }
37
- public void setEmail(String email_) { _email = email_; }
38
- public String getPhone() { return _phone; }
39
- public void setPhone(String phone_) { _phone = phone_; }
40
- public Date getBirth() { return _birth; }
41
- public void setBirth(Date birth_) { _birth = birth_; }
42
- public String getBlood() { return _blood; }
43
- public void setBlood(String blood_) { _blood = blood_; }
44
- }
@@ -1,52 +0,0 @@
1
- ## address-book class
2
- class AddressBook
3
- def initialize(hash=nil)
4
- if hash.nil?
5
- return
6
- end
7
- @groups = (v=hash['groups']) ? v.map!{|e| e.is_a?(Group) ? e : Group.new(e)} : v
8
- @people = (v=hash['people']) ? v.map!{|e| e.is_a?(Person) ? e : Person.new(e)} : v
9
- end
10
- attr_accessor :groups # seq
11
- attr_accessor :people # seq
12
- end
13
-
14
- ## group class
15
- class Group
16
- def initialize(hash=nil)
17
- if hash.nil?
18
- return
19
- end
20
- @name = hash['name']
21
- @desc = hash['desc']
22
- end
23
- attr_accessor :name # str
24
- attr_accessor :desc # str
25
- end
26
-
27
- ## person class
28
- class Person
29
- def initialize(hash=nil)
30
- if hash.nil?
31
- @deleted = false
32
- return
33
- end
34
- @name = hash['name']
35
- @desc = hash['desc']
36
- @group = hash['group']
37
- @email = hash['email']
38
- @phone = hash['phone']
39
- @birth = hash['birth']
40
- @blood = hash['blood']
41
- @deleted = (v=hash['deleted']).nil? ? false : v
42
- end
43
- attr_accessor :name # str
44
- attr_accessor :desc # str
45
- attr_accessor :group # str
46
- attr_accessor :email # str
47
- attr_accessor :phone # str
48
- attr_accessor :birth # date
49
- attr_accessor :blood # str
50
- attr_accessor :deleted # bool
51
- def deleted? ; @deleted ; end
52
- end
@@ -1,28 +0,0 @@
1
- type: map
2
- class: AddressBook
3
- desc: address-book class
4
- mapping:
5
- "groups":
6
- type: seq
7
- sequence:
8
- - type: map
9
- class: Group
10
- desc: group class
11
- mapping:
12
- "name": { type: str, required: yes }
13
- "desc": { type: str }
14
- "people":
15
- type: seq
16
- sequence:
17
- - type: map
18
- class: Person
19
- desc: person class
20
- mapping:
21
- "name": { type: str, required: yes }
22
- "desc": { type: str }
23
- "group": { type: str }
24
- "email": { type: str, pattern: '/@/' }
25
- "phone": { type: str }
26
- "birth": { type: date }
27
- "blood": { type: str, enum: [A, B, O, AB] }
28
- "deleted": { type: bool, default: false }
@@ -1,27 +0,0 @@
1
- groups:
2
-
3
- - name: family
4
- desc: my family
5
-
6
- - name: friend
7
- desc: my friends
8
-
9
- - name: business
10
- desc: those who works together
11
-
12
- people:
13
-
14
- - name: Sumire
15
- group: family
16
- birth: 2000-01-01
17
- blood: A
18
-
19
- - name: Shiina
20
- group: friend
21
- birth: 1995-01-01
22
- email: shiina@mail.org
23
-
24
- - name: Sakura
25
- group: business
26
- email: cherry@mail.net
27
- phone: 012-345-6789
@@ -1,12 +0,0 @@
1
- type: map
2
- mapping:
3
- "answers":
4
- type: seq
5
- sequence:
6
- - type: map
7
- name: Answer
8
- mapping:
9
- "name": { type: str, required: yes }
10
- "answer": { type: str, required: yes,
11
- enum: [good, not bad, bad] }
12
- "reason": { type: str }
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'kwalify'
4
-
5
- ## validator class for answers
6
- class AnswersValidator < Kwalify::Validator
7
-
8
- ## load schema definition
9
- @@schema = Kwalify::Yaml.load_file('answers-schema.yaml')
10
- ## or
11
- ## require 'yaml'
12
- ## @@schema = YAML.load_file('answers-schema.yaml')
13
-
14
- def initialize()
15
- super(@@schema)
16
- end
17
-
18
- ## hook method called by Validator#validate()
19
- def validate_hook(value, rule, path, errors)
20
- case rule.name
21
- when 'Answer'
22
- if value['answer'] == 'bad'
23
- reason = value['reason']
24
- if !reason || reason.empty?
25
- msg = "reason is required when answer is 'bad'."
26
- errors << Kwalify::ValidationError.new(msg, path)
27
- end
28
- end
29
- end
30
- end
31
-
32
- end
33
-
34
- ## create validator
35
- validator = AnswersValidator.new
36
-
37
- ## parse and validate YAML document
38
- input = ARGF.read()
39
- parser = Kwalify::Yaml::Parser.new(validator)
40
- document = parser.parse(input)
41
-
42
- ## show errors
43
- errors = parser.errors()
44
- if !errors || errors.empty?
45
- puts "Valid."
46
- else
47
- puts "*** INVALID!"
48
- for e in errors
49
- # e.class == Kwalify::ValidationError
50
- puts "#{e.linenum}:#{e.column} [#{e.path}] #{e.message}"
51
- end
52
- end
@@ -1,26 +0,0 @@
1
- $ kwalify -a genclass-ruby -P -f BABEL.schema.yaml \
2
- --hashlike --initialize=false --module=Babel
3
- require 'kwalify/util/hashlike'
4
-
5
- module Babel
6
-
7
- ##
8
- class Team
9
- include Kwalify::Util::HashLike
10
- attr_accessor :name # str
11
- attr_accessor :desc # str
12
- attr_accessor :chief # map
13
- attr_accessor :members # seq
14
- end
15
-
16
- ##
17
- class Member
18
- include Kwalify::Util::HashLike
19
- attr_accessor :name # str
20
- attr_accessor :desc # str
21
- attr_accessor :team # map
22
- end
23
-
24
- end
25
- $ kwalify -a genclass-ruby -P -f BABEL.schema.yaml \
26
- --hashlike --initialize=false --module=Babel > models.rb
@@ -1,7 +0,0 @@
1
- type: map
2
- class: Config
3
- mapping:
4
- "host": { type: str, required: true }
5
- "port": { type: int }
6
- "user": { type: str, required: true }
7
- "pass": { type: str, required: true }
@@ -1,4 +0,0 @@
1
- host: localhost
2
- port: 8080
3
- user: user1
4
- pass: password1
@@ -1,3 +0,0 @@
1
- - foo
2
- - bar
3
- - baz
@@ -1,3 +0,0 @@
1
- - foo
2
- - 123
3
- - baz
@@ -1,4 +0,0 @@
1
- name: foo
2
- email: foo@mail.com
3
- age: 20
4
- birth: 1985-01-01
@@ -1,4 +0,0 @@
1
- name: foo
2
- email: foo(at)mail.com
3
- age: twenty
4
- birth: Jun 01, 1985
@@ -1,6 +0,0 @@
1
- - name: foo
2
- email: foo@mail.com
3
- - name: bar
4
- email: bar@mail.net
5
- - name: baz
6
- email: baz@mail.org
@@ -1,6 +0,0 @@
1
- - name: foo
2
- email: foo@mail.com
3
- - naem: bar
4
- email: bar@mail.net
5
- - name: baz
6
- mail: baz@mail.org
@@ -1,9 +0,0 @@
1
- company: Kuwata lab.
2
- email: webmaster@kuwata-lab.com
3
- employees:
4
- - code: 101
5
- name: foo
6
- email: foo@kuwata-lab.com
7
- - code: 102
8
- name: bar
9
- email: bar@kuwata-lab.com
@@ -1,9 +0,0 @@
1
- company: Kuwata Lab.
2
- email: webmaster@kuwata-lab.com
3
- employees:
4
- - code: A101
5
- name: foo
6
- email: foo@kuwata-lab.com
7
- - code: 102
8
- name: bar
9
- mail: bar@kuwata-lab.com
@@ -1,11 +0,0 @@
1
- - name: foo
2
- email: foo@mail.com
3
- password: xxx123456
4
- age: 20
5
- blood: A
6
- birth: 1985-01-01
7
- - name: bar
8
- email: bar@mail.net
9
- age: 25
10
- blood: AB
11
- birth: 1980-01-01
@@ -1,12 +0,0 @@
1
- - name: foo
2
- email: foo(at)mail.com
3
- password: xxx123
4
- age: twenty
5
- blood: a
6
- birth: 1985-01-01
7
- - given-name: bar
8
- family-name: Bar
9
- email: bar@mail.net
10
- age: 15
11
- blood: AB
12
- birth: 1980/01/01
@@ -1,15 +0,0 @@
1
- - name: foo
2
- email: admin@mail.com
3
- groups:
4
- - users
5
- - foo
6
- - admin
7
- - name: bar
8
- email: admin@mail.com
9
- groups:
10
- - users
11
- - admin
12
- - name: baz
13
- email: baz@mail.com
14
- groups:
15
- - users
@@ -1,16 +0,0 @@
1
- - name: foo
2
- email: admin@mail.com
3
- groups:
4
- - foo
5
- - users
6
- - admin
7
- - foo
8
- - name: bar
9
- email: admin@mail.com
10
- groups:
11
- - admin
12
- - users
13
- - name: bar
14
- email: baz@mail.com
15
- groups:
16
- - users
@@ -1,9 +0,0 @@
1
- answers:
2
- - name: Foo
3
- answer: good
4
- reason: I like this style.
5
- - name: Bar
6
- answer: not bad
7
- - name: Baz
8
- answer: bad
9
- reason: I don't like this style.
@@ -1,7 +0,0 @@
1
- answers:
2
- - name: Foo
3
- answer: good
4
- - name: Bar
5
- answer: bad
6
- - name: Baz
7
- answer: not bad
@@ -1,10 +0,0 @@
1
- { "name": "Foo",
2
- "email": "foo@mail.com",
3
- "age": 20,
4
- "gender": "F",
5
- "favorite": [
6
- "football",
7
- "basketball",
8
- "baseball"
9
- ]
10
- }
@@ -1,6 +0,0 @@
1
- {
2
- "mail": "foo@mail.com",
3
- "age": twenty,
4
- "gender": "X",
5
- "favorite": [ 123, 456 ]
6
- }
@@ -1,17 +0,0 @@
1
- - &foo
2
- given-name: foo
3
- family-name: Foo
4
- post: exective
5
- - &bar
6
- given-name: bar
7
- family-name: Bar
8
- post: manager
9
- supervisor: *foo
10
- - given-name: baz
11
- family-name: Baz
12
- post: clerk
13
- supervisor: *bar
14
- - given-name: zak
15
- family-name: Zak
16
- post: clerk
17
- supervisor: *bar
@@ -1,3 +0,0 @@
1
- value1: 0
2
- value2: 0.5
3
- value3: -0.9
@@ -1,3 +0,0 @@
1
- value1: 0
2
- value2: 1.1
3
- value3: -2.0
@@ -1,6 +0,0 @@
1
- group:
2
- name: foo
3
- email: foo@mail.com
4
- user:
5
- name: bar
6
- email: bar@mail.com
@@ -1,5 +0,0 @@
1
- group:
2
- name: foo
3
- email: foo@mail.com
4
- user:
5
- name: toooooo-looooong-name
@@ -1,10 +0,0 @@
1
- require 'address_book'
2
- require 'yaml'
3
- require 'pp'
4
-
5
- str = File.read('address_book.yaml')
6
- ydoc = YAML.load(str)
7
- addrbook = AddressBook.new(ydoc)
8
-
9
- pp addrbook.groups
10
- pp addrbook.people