nrb-beerxml 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.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +674 -0
  3. data/README.md +33 -0
  4. data/lib/beerxml.rb +24 -0
  5. data/lib/beerxml/builder.rb +30 -0
  6. data/lib/beerxml/equipment.rb +38 -0
  7. data/lib/beerxml/fermentable.rb +33 -0
  8. data/lib/beerxml/hop.rb +38 -0
  9. data/lib/beerxml/inflector.rb +27 -0
  10. data/lib/beerxml/mash.rb +35 -0
  11. data/lib/beerxml/mash_step.rb +26 -0
  12. data/lib/beerxml/misc.rb +24 -0
  13. data/lib/beerxml/parser.rb +114 -0
  14. data/lib/beerxml/recipe.rb +109 -0
  15. data/lib/beerxml/record.rb +49 -0
  16. data/lib/beerxml/record_set.rb +39 -0
  17. data/lib/beerxml/record_validators.rb +8 -0
  18. data/lib/beerxml/record_validators/boolean_validator.rb +16 -0
  19. data/lib/beerxml/record_validators/percentage_validator.rb +38 -0
  20. data/lib/beerxml/style.rb +49 -0
  21. data/lib/beerxml/version.rb +6 -0
  22. data/lib/beerxml/water.rb +26 -0
  23. data/lib/beerxml/yeast.rb +38 -0
  24. data/spec/cases/beerxml/builder_spec.rb +107 -0
  25. data/spec/cases/beerxml/equipment_spec.rb +38 -0
  26. data/spec/cases/beerxml/fermentable_spec.rb +17 -0
  27. data/spec/cases/beerxml/hop_spec.rb +21 -0
  28. data/spec/cases/beerxml/mash_spec.rb +25 -0
  29. data/spec/cases/beerxml/mash_step_spec.rb +39 -0
  30. data/spec/cases/beerxml/misc_spec.rb +14 -0
  31. data/spec/cases/beerxml/parser_spec.rb +30 -0
  32. data/spec/cases/beerxml/recipe_spec.rb +98 -0
  33. data/spec/cases/beerxml/record_set_spec.rb +36 -0
  34. data/spec/cases/beerxml/record_spec.rb +15 -0
  35. data/spec/cases/beerxml/record_validators/boolean_validator_spec.rb +50 -0
  36. data/spec/cases/beerxml/record_validators/percentage_validator_spec.rb +98 -0
  37. data/spec/cases/beerxml/style_spec.rb +36 -0
  38. data/spec/cases/beerxml/version_spec.rb +13 -0
  39. data/spec/cases/beerxml/water_spec.rb +25 -0
  40. data/spec/cases/beerxml/yeast_spec.rb +20 -0
  41. data/spec/cases/beerxml_spec.rb +3 -0
  42. data/spec/fixtures/equipment.xml +28 -0
  43. data/spec/fixtures/recipes.xml +1412 -0
  44. data/spec/shared/active_model_lint.rb +21 -0
  45. data/spec/shared/record_typing.rb +19 -0
  46. data/spec/spec_helper.rb +8 -0
  47. metadata +210 -0
@@ -0,0 +1,21 @@
1
+ require 'test/unit/assertions'
2
+
3
+ shared_examples_for :ActiveModel do
4
+ include ActiveModel::Lint::Tests
5
+ include Minitest::Assertions
6
+
7
+ attr_accessor :assertions
8
+
9
+ before do
10
+ self.assertions = 0
11
+ end
12
+
13
+ ActiveModel::Lint::Tests.public_instance_methods.grep(/^test/).each do |m|
14
+ example m do; send m; end
15
+ end
16
+
17
+ def model
18
+ subject
19
+ end
20
+
21
+ end
@@ -0,0 +1,19 @@
1
+ require 'test/unit/assertions'
2
+ require 'active_model/lint'
3
+
4
+ shared_examples_for :record_typing do
5
+
6
+ let(:all_types) { %i( equipment fermentable hop mash_profile mash_step misc recipe style water yeast ) }
7
+
8
+ it 'correctly answers to its own type' do
9
+ expect subject.send("#{type}?")
10
+ end
11
+
12
+ it 'correctly answers to other types' do
13
+ (all_types - [type]).each do |question|
14
+ expect ! subject.send("#{question}?")
15
+ end
16
+ end
17
+
18
+ end
19
+
@@ -0,0 +1,8 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
2
+ require 'beerxml'
3
+ require 'active_model'
4
+ require 'shoulda/matchers'
5
+
6
+ RSpec.configure do |config|
7
+ config.order = :random
8
+ end
metadata ADDED
@@ -0,0 +1,210 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nrb-beerxml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Dean Brundage
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activemodel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
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: guard-rspec
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
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: shoulda
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: A BeerXML parser based on the original BeerXML gem
112
+ email:
113
+ - dean@newrepublicbrewing.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - README.md
119
+ - LICENSE
120
+ - lib/beerxml.rb
121
+ - lib/beerxml/builder.rb
122
+ - lib/beerxml/equipment.rb
123
+ - lib/beerxml/fermentable.rb
124
+ - lib/beerxml/hop.rb
125
+ - lib/beerxml/inflector.rb
126
+ - lib/beerxml/mash.rb
127
+ - lib/beerxml/mash_step.rb
128
+ - lib/beerxml/misc.rb
129
+ - lib/beerxml/parser.rb
130
+ - lib/beerxml/recipe.rb
131
+ - lib/beerxml/record.rb
132
+ - lib/beerxml/record_set.rb
133
+ - lib/beerxml/record_validators.rb
134
+ - lib/beerxml/record_validators/boolean_validator.rb
135
+ - lib/beerxml/record_validators/percentage_validator.rb
136
+ - lib/beerxml/style.rb
137
+ - lib/beerxml/version.rb
138
+ - lib/beerxml/water.rb
139
+ - lib/beerxml/yeast.rb
140
+ - spec/cases/beerxml/builder_spec.rb
141
+ - spec/cases/beerxml/equipment_spec.rb
142
+ - spec/cases/beerxml/fermentable_spec.rb
143
+ - spec/cases/beerxml/hop_spec.rb
144
+ - spec/cases/beerxml/mash_spec.rb
145
+ - spec/cases/beerxml/mash_step_spec.rb
146
+ - spec/cases/beerxml/misc_spec.rb
147
+ - spec/cases/beerxml/parser_spec.rb
148
+ - spec/cases/beerxml/recipe_spec.rb
149
+ - spec/cases/beerxml/record_set_spec.rb
150
+ - spec/cases/beerxml/record_spec.rb
151
+ - spec/cases/beerxml/record_validators/boolean_validator_spec.rb
152
+ - spec/cases/beerxml/record_validators/percentage_validator_spec.rb
153
+ - spec/cases/beerxml/style_spec.rb
154
+ - spec/cases/beerxml/version_spec.rb
155
+ - spec/cases/beerxml/water_spec.rb
156
+ - spec/cases/beerxml/yeast_spec.rb
157
+ - spec/cases/beerxml_spec.rb
158
+ - spec/fixtures/equipment.xml
159
+ - spec/fixtures/recipes.xml
160
+ - spec/shared/active_model_lint.rb
161
+ - spec/shared/record_typing.rb
162
+ - spec/spec_helper.rb
163
+ homepage: ''
164
+ licenses:
165
+ - GPL-3
166
+ metadata: {}
167
+ post_install_message:
168
+ rdoc_options: []
169
+ require_paths:
170
+ - lib
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '2'
176
+ required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ requirements: []
182
+ rubyforge_project:
183
+ rubygems_version: 2.0.14
184
+ signing_key:
185
+ specification_version: 4
186
+ summary: BeerXML parser
187
+ test_files:
188
+ - spec/cases/beerxml/builder_spec.rb
189
+ - spec/cases/beerxml/equipment_spec.rb
190
+ - spec/cases/beerxml/fermentable_spec.rb
191
+ - spec/cases/beerxml/hop_spec.rb
192
+ - spec/cases/beerxml/mash_spec.rb
193
+ - spec/cases/beerxml/mash_step_spec.rb
194
+ - spec/cases/beerxml/misc_spec.rb
195
+ - spec/cases/beerxml/parser_spec.rb
196
+ - spec/cases/beerxml/recipe_spec.rb
197
+ - spec/cases/beerxml/record_set_spec.rb
198
+ - spec/cases/beerxml/record_spec.rb
199
+ - spec/cases/beerxml/record_validators/boolean_validator_spec.rb
200
+ - spec/cases/beerxml/record_validators/percentage_validator_spec.rb
201
+ - spec/cases/beerxml/style_spec.rb
202
+ - spec/cases/beerxml/version_spec.rb
203
+ - spec/cases/beerxml/water_spec.rb
204
+ - spec/cases/beerxml/yeast_spec.rb
205
+ - spec/cases/beerxml_spec.rb
206
+ - spec/fixtures/equipment.xml
207
+ - spec/fixtures/recipes.xml
208
+ - spec/shared/active_model_lint.rb
209
+ - spec/shared/record_typing.rb
210
+ - spec/spec_helper.rb