can_play 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6f5cb2af6bd4413b6c377887eced9f1bac5f3ff
4
- data.tar.gz: d74939b73a868b42276834a6a28ac1fb066711aa
3
+ metadata.gz: 3c81ae7827dd27f109d747595eb8e96d60de3089
4
+ data.tar.gz: e30b740ae3afb6b37fc1e2ed206f25da0c961d5c
5
5
  SHA512:
6
- metadata.gz: 3e65eb0a73dda143136ed314008dc6a98589a68d42311856c715e61ef238e4c0bfe73c2d26cda05627f341da893cd83223d60aef7ee5309541b9f4842ed2b4e3
7
- data.tar.gz: ca50b5437522185f1b59c430143f56f1a0e0b02a898e32ce9a1dbd9cefa52cd7b4f95ecac87d82d1575d416b7f4ae4f4d7c89ff569b3002285b37ebba0061175
6
+ metadata.gz: cf442e042eba7431302500371f61e6216c7989990143ddbe6d9c291aeb94cb8ca9882cc5003cd49a71ea624be23503434e3989d54a8afdf43131fdb7d5a6d7a5
7
+ data.tar.gz: 6409b25d4ee731b4cf3d8f7ebb88106a7958b746eff753d712a82cc3aae89cd5184476bb28acea62db6abcba559bc01a47dc25571f2a829b3f2ea5c77d50a1aa
@@ -1,3 +1,3 @@
1
1
  module CanPlay
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/lib/can_play.rb CHANGED
@@ -30,6 +30,10 @@ module CanPlay
30
30
  @grouped_resources ||= CanPlay.resources.multi_group_by(:module_name, :group)
31
31
  end
32
32
 
33
+ def splat_grouped_resources
34
+ @grouped_resources ||= CanPlay.resources.multi_group_by(:group)
35
+ end
36
+
33
37
  def my_resources
34
38
  CanPlay.resources
35
39
  end
@@ -51,6 +55,22 @@ module CanPlay
51
55
  end
52
56
  end
53
57
  end
58
+
59
+ def splat_grouped_resources_with_chinese_desc
60
+ splat_grouped_resources.tap do |i|
61
+ i.each do |group, resources|
62
+ group[:chinese_desc] = begin
63
+ name = I18n.t("can_play.class_name.#{group[:name].singularize}", default: '')
64
+ name = group[:klass].model_name.human if name.blank?
65
+ name
66
+ end
67
+ resources.each do |resource|
68
+ resource[:chinese_desc] = I18n.t("can_play.authority_name.#{group[:name].singularize}.#{resource[:verb]}", default: '').presence || I18n.t("can_play.authority_name.common.#{resource[:verb]}")
69
+ end
70
+ end
71
+ i.rehash
72
+ end
73
+ end
54
74
  end
55
75
 
56
76
  module Config
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: can_play
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - happyming9527