openmenu 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,4 @@
1
- === 1.0.0 / 2011-08-02
1
+ === 0.1.1 / 2011-08-02
2
2
 
3
3
  * 1 major enhancement
4
4
 
data/README.txt CHANGED
@@ -18,8 +18,8 @@ the interface should stay the same.
18
18
 
19
19
  om = OpenMenu.parse(open('http://openmenu.com/menu/sample'))
20
20
  om.restaurant_name # => 'My Restaurant'
21
- om.menus.inspect # => [#<OpenMenu::Menu:0x007fdb0a1facd8 @name="Main Menu", ...>,
22
- #<OpenMenu::Menu:0x007fdb0c027558 @name="Late Night Menu", ...]
21
+ om.menus.inspect # => [#<OpenMenu::Menu:0x007fdb0a1facd8 @name="Main Menu",
22
+ ...>, #<OpenMenu::Menu:0x007fdb0c027558 @name="Late Night Menu", ...]
23
23
  om.menus.first.groups.first.items.first.name # => 'Coconut Shrimp'
24
24
  om.menus.first.groups.first.items.first.price # => 7.95
25
25
 
data/lib/open_menu.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class OpenMenu
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  include HappyMapper
4
4
  tag 'omf'
5
5
 
@@ -178,13 +178,12 @@ class OpenMenu
178
178
  attribute :uid, Integer
179
179
  attribute :currency, String, :tag => 'currency_symbol'
180
180
  attribute :disabled, String
181
-
182
- element :description, String, :tag => "menu_description"
183
-
184
181
  def disabled?
185
182
  disabled == 'disabled'
186
183
  end
187
184
 
185
+ element :description, String, :tag => "menu_description"
186
+
188
187
  class Duration
189
188
  include HappyMapper
190
189
  tag 'menu_duration'
@@ -206,6 +205,8 @@ class OpenMenu
206
205
  disabled == 'disabled'
207
206
  end
208
207
 
208
+ element :description, String, :tag => 'menu_group_description'
209
+
209
210
  class Option
210
211
  include HappyMapper
211
212
  tag 'menu_group_option'
@@ -114,6 +114,7 @@ class TestOpenMenu< Test::Unit::TestCase
114
114
  assert_equal 'USD', menus.first.currency
115
115
  assert_equal 'disabled', menus.first.disabled
116
116
  assert_equal true, menus.first.disabled?
117
+ assert_equal 'Great food, everyday.', menus.first.description
117
118
 
118
119
  assert_equal 'lunch-dinner', menus.first.duration.name
119
120
  assert_equal '11:00', menus.first.duration.start
@@ -124,6 +125,7 @@ class TestOpenMenu< Test::Unit::TestCase
124
125
  assert_equal 2, group.uid
125
126
  assert_equal 'disabled', group.disabled
126
127
  assert_equal true, group.disabled?
128
+ assert_equal 'Succulent appetizers.', group.description
127
129
 
128
130
  option = menus.first.groups[1].options.first
129
131
  assert_equal 'Dressings', option.name
@@ -322,7 +324,7 @@ http://factual.com/31b8bfbf-08a3-478f-a4a4-d3e3143a37fb
322
324
  </restaurant_info>
323
325
  <menus>
324
326
  <menu name="Main Menu" currency_symbol="USD" uid="25" disabled="disabled">
325
- <menu_description/>
327
+ <menu_description>Great food, everyday.</menu_description>
326
328
  <menu_duration>
327
329
  <menu_duration_name>lunch-dinner</menu_duration_name>
328
330
  <menu_duration_time_start>11:00</menu_duration_time_start>
@@ -330,7 +332,7 @@ http://factual.com/31b8bfbf-08a3-478f-a4a4-d3e3143a37fb
330
332
  </menu_duration>
331
333
  <menu_groups>
332
334
  <menu_group name="Appetizers" uid="2" disabled="disabled">
333
- <menu_group_description/>
335
+ <menu_group_description>Succulent appetizers.</menu_group_description>
334
336
  <menu_items>
335
337
  <menu_item uid="65" disabled="disabled" special="special" vegetarian="vegetarian" vegan="vegan" kosher="kosher" halal="halal">
336
338
  <menu_item_name>Coconut Shrimp</menu_item_name>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openmenu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-08-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri-happymapper
16
- requirement: &70257982733820 !ruby/object:Gem::Requirement
16
+ requirement: &70317645354660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.3.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70257982733820
24
+ version_requirements: *70317645354660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &70257982733040 !ruby/object:Gem::Requirement
27
+ requirement: &70317645354080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.6'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70257982733040
35
+ version_requirements: *70317645354080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &70257982732200 !ruby/object:Gem::Requirement
38
+ requirement: &70317645352360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.12'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70257982732200
46
+ version_requirements: *70317645352360
47
47
  description: ! "Openmenu is parser for OpenMenu xml files.\n\nNOTE: This is an early
48
48
  release. There is some refactoring to be done, but \nthe interface should stay the
49
49
  same."