glib-web 0.2.6 → 0.2.7

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: 91bbaabb7ba267a91d4f7ff4b8cdd3b142fe2dc2
4
- data.tar.gz: 22db4840a440ef31d8161267f366c24ea0e39365
3
+ metadata.gz: d1d23736ab1385ea517451aa33bebd883ef4b435
4
+ data.tar.gz: 2e0924b9b4aeaca57659e55d5c9f9a4ee5bf08f6
5
5
  SHA512:
6
- metadata.gz: 4f70589581f61e65eb0f4dd4d09b07657c30fde7fc8067d0f30c6577ebfa55af9d42f7ad513e4cc7ae3058542619758d2d9bf04cfffaf372d1822a99a975ce35
7
- data.tar.gz: 3ce7731eef560c59759fc483d16f3516d88f6f5e849489452d2a4c93120f805d128b3f1a4583e68fa67650ed41ae621c496b7b4f510294d53d6b31497914731e
6
+ metadata.gz: 648ab483946b51659c3f2c3039ada0427655ef1a722ed75cf51b48e643bb40d1927b04f7398bd063abc44abe47f49198b2d1c883863afe0df4fbd747893c8591
7
+ data.tar.gz: 340c83ff4c79a0146d55323e81a195d10235d5d2c8f393321e7a7c2826079cf3bb37bd85a759fb8f0e37aa89a2b3058dae9128e969e717c14f9d738676fbbb18
@@ -16,7 +16,7 @@ module Glib
16
16
 
17
17
  def add_singleton_element type, name, *args
18
18
  name_components = name.to_s.split('_')
19
- json.set! type, "#{name_components.join('/')}-v1" if type
19
+ json.set! type, "#{name_components.join('/')}" if type
20
20
  args = [yield] if block_given?
21
21
  "#{self.class.name}::#{name_components.map{ |str| capitalize_first_letter_and_leave_others_alone(str) }.join('::')}".constantize.new(json, @page).parse(*args)
22
22
  end
@@ -26,6 +26,22 @@ module Glib
26
26
  add_singleton_element type, name, *args
27
27
  end
28
28
  end
29
+
30
+ # TODO: Consider removing this in favour of non 'v1' suffix
31
+ def add_singleton_element_v1 type, name, *args
32
+ name_components = name.to_s.split('_')
33
+ json.set! type, "#{name_components.join('/')}-v1" if type
34
+ args = [yield] if block_given?
35
+ "#{self.class.name}::#{name_components.map{ |str| capitalize_first_letter_and_leave_others_alone(str) }.join('::')}".constantize.new(json, @page).parse(*args)
36
+ end
37
+
38
+ # TODO: Consider removing this in favour of non 'v1' suffix
39
+ def add_element_to_array_v1 type, name, *args
40
+ json.child! do
41
+ add_singleton_element_v1 type, name, *args
42
+ end
43
+ end
44
+
29
45
  end
30
46
 
31
47
  class JsonUiElement
@@ -2,7 +2,7 @@ module Glib
2
2
  module JsonUi
3
3
  class ActionBuilder < AbstractBuilder
4
4
  def method_missing m, *args
5
- add_singleton_element 'action', m, *args
5
+ add_singleton_element_v1 'action', m, *args
6
6
  end
7
7
 
8
8
  class Action < JsonUiElement
@@ -2,7 +2,7 @@ module Glib
2
2
  module JsonUi
3
3
  class MenuBuilder < AbstractBuilder
4
4
  def method_missing m, *args
5
- add_element_to_array nil, m, *args
5
+ add_element_to_array_v1 nil, m, *args
6
6
  end
7
7
 
8
8
  class MenuItem < JsonUiElement
@@ -2,7 +2,7 @@ module Glib
2
2
  module JsonUi
3
3
  class ViewBuilder < AbstractBuilder
4
4
  def add_view name, *args
5
- add_element_to_array 'view', name, *args
5
+ add_element_to_array_v1 'view', name, *args
6
6
  end
7
7
 
8
8
  def method_missing m, *args
@@ -3,7 +3,7 @@ json.rows do
3
3
  batch_count.times do |i|
4
4
  index = page * batch_count + i
5
5
  json.child! do
6
- json.template 'thumbnail-v1'
6
+ json.template 'thumbnail'
7
7
  json.title "Item #{index}"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''