vidibus-category_tag 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/tag_category.rb +6 -7
- data/lib/vidibus/category_tag/mongoid.rb +2 -2
- data/lib/vidibus/category_tag/version.rb +1 -1
- metadata +129 -93
data/app/models/tag_category.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
class TagCategory
|
2
2
|
include Mongoid::Document
|
3
3
|
include Mongoid::Timestamps
|
4
|
-
include Mongoid::Acts::Tree
|
5
4
|
include Vidibus::Uuid::Mongoid
|
6
5
|
|
7
6
|
field :label
|
@@ -14,10 +13,11 @@ class TagCategory
|
|
14
13
|
|
15
14
|
before_validation :set_callname
|
16
15
|
|
17
|
-
|
16
|
+
scope :sorted, order_by([:position, :asc])
|
18
17
|
|
19
|
-
def
|
20
|
-
|
18
|
+
def self.context(context_hash)
|
19
|
+
return all if context_hash.blank?
|
20
|
+
all_in(:context => context_list(context_hash))
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.context_list(context_hash)
|
@@ -25,8 +25,7 @@ class TagCategory
|
|
25
25
|
context_hash.map { |key,value| "#{key}:#{value}" }
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
30
|
-
all_in(:context => context_list(context_hash))
|
28
|
+
def set_callname
|
29
|
+
self.callname = label.parameterize if callname.blank?
|
31
30
|
end
|
32
31
|
end
|
@@ -27,8 +27,8 @@ module Vidibus
|
|
27
27
|
|
28
28
|
tags_hash = {}
|
29
29
|
categories.each do |category, tags|
|
30
|
-
tags = tags.split(self.class.tags_separator)
|
31
|
-
tags_hash[category.to_s] = tags.
|
30
|
+
tags = tags.split(self.class.tags_separator).map(&:strip).reject(&:blank?)
|
31
|
+
tags_hash[category.to_s] = tags unless tags.empty?
|
32
32
|
end
|
33
33
|
self.tags_hash = tags_hash
|
34
34
|
end
|
metadata
CHANGED
@@ -1,122 +1,147 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidibus-category_tag
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Martin Jagusch
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-09-13 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: activesupport
|
16
|
-
requirement: &70203205276660 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '3.0'
|
22
|
-
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: mongoid
|
27
|
-
requirement: &70203205276140 !ruby/object:Gem::Requirement
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
28
25
|
none: false
|
29
|
-
requirements:
|
26
|
+
requirements:
|
30
27
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
version: "3.0"
|
33
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: mongoid
|
34
38
|
prerelease: false
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: mongoid_acts_as_tree
|
38
|
-
requirement: &70203205275760 !ruby/object:Gem::Requirement
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 2
|
47
|
+
- 0
|
48
|
+
version: "2.0"
|
44
49
|
type: :runtime
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
48
52
|
name: vidibus-uuid
|
49
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
55
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
55
63
|
type: :runtime
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
59
66
|
name: rake
|
60
|
-
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
61
69
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
66
77
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
70
80
|
name: rspec
|
71
|
-
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
version: "0"
|
77
91
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
92
|
+
version_requirements: *id005
|
93
|
+
- !ruby/object:Gem::Dependency
|
81
94
|
name: factory_girl
|
82
|
-
|
95
|
+
prerelease: false
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
83
97
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
version: "0"
|
88
105
|
type: :development
|
89
|
-
|
90
|
-
|
91
|
-
- !ruby/object:Gem::Dependency
|
106
|
+
version_requirements: *id006
|
107
|
+
- !ruby/object:Gem::Dependency
|
92
108
|
name: rcov
|
93
|
-
|
109
|
+
prerelease: false
|
110
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
94
111
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
99
119
|
type: :development
|
100
|
-
|
101
|
-
|
102
|
-
- !ruby/object:Gem::Dependency
|
120
|
+
version_requirements: *id007
|
121
|
+
- !ruby/object:Gem::Dependency
|
103
122
|
name: rdoc
|
104
|
-
|
123
|
+
prerelease: false
|
124
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
105
125
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
130
|
+
segments:
|
131
|
+
- 0
|
132
|
+
version: "0"
|
110
133
|
type: :development
|
111
|
-
|
112
|
-
version_requirements: *70203205272820
|
134
|
+
version_requirements: *id008
|
113
135
|
description: Tags organized in categories for Mongoid documents.
|
114
|
-
email:
|
136
|
+
email:
|
115
137
|
- async@mj.io
|
116
138
|
executables: []
|
139
|
+
|
117
140
|
extensions: []
|
141
|
+
|
118
142
|
extra_rdoc_files: []
|
119
|
-
|
143
|
+
|
144
|
+
files:
|
120
145
|
- lib/vidibus/category_tag/mongoid.rb
|
121
146
|
- lib/vidibus/category_tag/version.rb
|
122
147
|
- lib/vidibus/category_tag.rb
|
@@ -125,28 +150,39 @@ files:
|
|
125
150
|
- LICENSE
|
126
151
|
- README.md
|
127
152
|
- Rakefile
|
153
|
+
has_rdoc: true
|
128
154
|
homepage: https://github.com/vidibus/vidibus-category_tag
|
129
155
|
licenses: []
|
156
|
+
|
130
157
|
post_install_message:
|
131
158
|
rdoc_options: []
|
132
|
-
|
159
|
+
|
160
|
+
require_paths:
|
133
161
|
- lib
|
134
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
163
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
140
|
-
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
hash: 3
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
version: "0"
|
171
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
172
|
none: false
|
142
|
-
requirements:
|
143
|
-
- -
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
hash: 3
|
177
|
+
segments:
|
178
|
+
- 0
|
179
|
+
version: "0"
|
146
180
|
requirements: []
|
181
|
+
|
147
182
|
rubyforge_project:
|
148
|
-
rubygems_version: 1.
|
183
|
+
rubygems_version: 1.6.2
|
149
184
|
signing_key:
|
150
185
|
specification_version: 3
|
151
186
|
summary: Tags organized in categories for Mongoid documents.
|
152
187
|
test_files: []
|
188
|
+
|