gnuside-custom_fields 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.textile +70 -0
  4. data/config/locales/de.yml +15 -0
  5. data/config/locales/en.yml +21 -0
  6. data/config/locales/fr.yml +25 -0
  7. data/config/locales/pt-BR.yml +9 -0
  8. data/config/locales/ru.yml +15 -0
  9. data/lib/custom_fields/extensions/active_support.rb +28 -0
  10. data/lib/custom_fields/extensions/carrierwave.rb +25 -0
  11. data/lib/custom_fields/extensions/mongoid/document.rb +21 -0
  12. data/lib/custom_fields/extensions/mongoid/factory.rb +20 -0
  13. data/lib/custom_fields/extensions/mongoid/fields/i18n.rb +55 -0
  14. data/lib/custom_fields/extensions/mongoid/fields/localized.rb +39 -0
  15. data/lib/custom_fields/extensions/mongoid/fields.rb +31 -0
  16. data/lib/custom_fields/extensions/mongoid/relations/referenced/in.rb +22 -0
  17. data/lib/custom_fields/extensions/mongoid/relations/referenced/many.rb +34 -0
  18. data/lib/custom_fields/extensions/mongoid/validations/collection_size.rb +43 -0
  19. data/lib/custom_fields/extensions/mongoid/validations/macros.rb +25 -0
  20. data/lib/custom_fields/extensions/origin/smash.rb +33 -0
  21. data/lib/custom_fields/field.rb +106 -0
  22. data/lib/custom_fields/source.rb +347 -0
  23. data/lib/custom_fields/target.rb +99 -0
  24. data/lib/custom_fields/target_helpers.rb +192 -0
  25. data/lib/custom_fields/types/belongs_to.rb +65 -0
  26. data/lib/custom_fields/types/boolean.rb +55 -0
  27. data/lib/custom_fields/types/date.rb +97 -0
  28. data/lib/custom_fields/types/date_time.rb +97 -0
  29. data/lib/custom_fields/types/default.rb +103 -0
  30. data/lib/custom_fields/types/email.rb +60 -0
  31. data/lib/custom_fields/types/file.rb +74 -0
  32. data/lib/custom_fields/types/float.rb +52 -0
  33. data/lib/custom_fields/types/has_many.rb +74 -0
  34. data/lib/custom_fields/types/integer.rb +54 -0
  35. data/lib/custom_fields/types/many_to_many.rb +75 -0
  36. data/lib/custom_fields/types/money.rb +146 -0
  37. data/lib/custom_fields/types/relationship_default.rb +44 -0
  38. data/lib/custom_fields/types/select.rb +217 -0
  39. data/lib/custom_fields/types/string.rb +55 -0
  40. data/lib/custom_fields/types/tags.rb +35 -0
  41. data/lib/custom_fields/types/text.rb +65 -0
  42. data/lib/custom_fields/version.rb +6 -0
  43. data/lib/custom_fields.rb +74 -0
  44. metadata +244 -0
@@ -0,0 +1,74 @@
1
+ $:.unshift File.expand_path(File.dirname(__FILE__))
2
+
3
+ require 'active_support'
4
+ require 'carrierwave/mongoid'
5
+ require 'money'
6
+
7
+ module CustomFields
8
+
9
+ @@options = {
10
+ reserved_names: Mongoid.destructive_fields + %w(id _id send class),
11
+ default_currency: 'EUR'
12
+ }
13
+
14
+ def self.options=(options)
15
+ @@options.merge!(options)
16
+ end
17
+
18
+ def self.options
19
+ @@options
20
+ end
21
+
22
+ end
23
+
24
+ %w( version
25
+ extensions/active_support
26
+ extensions/carrierwave
27
+ extensions/mongoid/document
28
+ extensions/mongoid/factory
29
+ extensions/mongoid/relations/referenced/many
30
+ extensions/mongoid/relations/referenced/in
31
+ extensions/mongoid/fields.rb
32
+ extensions/mongoid/fields/i18n.rb
33
+ extensions/mongoid/fields/localized.rb
34
+ extensions/mongoid/validations/collection_size.rb
35
+ extensions/mongoid/validations/macros.rb
36
+ extensions/origin/smash.rb
37
+ types/default
38
+ types/string
39
+ types/text
40
+ types/email
41
+ types/date
42
+ types/date_time
43
+ types/boolean
44
+ types/file
45
+ types/select
46
+ types/integer
47
+ types/float
48
+ types/money
49
+ types/relationship_default
50
+ types/belongs_to
51
+ types/has_many
52
+ types/many_to_many
53
+ types/tags
54
+ field
55
+ source
56
+ target_helpers
57
+ target
58
+ ).each do |lib|
59
+ require_relative "./custom_fields/#{lib}"
60
+ end
61
+
62
+ # Load all the translation files
63
+ I18n.load_path += Dir[File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.yml')]
64
+
65
+ module MyBenchmark
66
+
67
+ def self.measure(caption, &block)
68
+ t1 = Time.now
69
+ returned_value = block.call
70
+ puts "[MyBenchmark] #{caption} took #{((Time.now - t1) * 1000).to_i} ms"
71
+ returned_value
72
+ end
73
+
74
+ end
metadata ADDED
@@ -0,0 +1,244 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gnuside-custom_fields
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.1
5
+ platform: ruby
6
+ authors:
7
+ - Didier Lafforgue
8
+ - Roland laurès
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-12-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: mongoid
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 3.1.5
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 3.1.5
28
+ - !ruby/object:Gem::Dependency
29
+ name: activesupport
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 3.2.13
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 3.2.13
42
+ - !ruby/object:Gem::Dependency
43
+ name: gnuside-carrierwave-mongoid
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 0.6.6
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.6.6
56
+ - !ruby/object:Gem::Dependency
57
+ name: money
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '5.0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '5.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: yard
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.7.3
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.7.3
84
+ - !ruby/object:Gem::Dependency
85
+ name: mocha
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 0.9.12
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 0.9.12
98
+ - !ruby/object:Gem::Dependency
99
+ name: rspec
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '2.6'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '2.6'
112
+ - !ruby/object:Gem::Dependency
113
+ name: simplecov
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: 0.6.1
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: 0.6.1
126
+ - !ruby/object:Gem::Dependency
127
+ name: database_cleaner
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: 0.9.1
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: 0.9.1
140
+ - !ruby/object:Gem::Dependency
141
+ name: pry
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ - !ruby/object:Gem::Dependency
155
+ name: RedCloth
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: 4.2.8
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: 4.2.8
168
+ description: Manage custom fields to a mongoid document or a collection. This module
169
+ is one of the core features we implemented in our custom cms named Locomotive.
170
+ email:
171
+ - didier@nocoffee.fr
172
+ - roland.laures@gnuside.com
173
+ executables: []
174
+ extensions: []
175
+ extra_rdoc_files:
176
+ - MIT-LICENSE
177
+ - README.textile
178
+ files:
179
+ - MIT-LICENSE
180
+ - README.textile
181
+ - lib/custom_fields/extensions/active_support.rb
182
+ - lib/custom_fields/extensions/carrierwave.rb
183
+ - lib/custom_fields/extensions/mongoid/document.rb
184
+ - lib/custom_fields/extensions/mongoid/factory.rb
185
+ - lib/custom_fields/extensions/mongoid/fields/i18n.rb
186
+ - lib/custom_fields/extensions/mongoid/fields/localized.rb
187
+ - lib/custom_fields/extensions/mongoid/fields.rb
188
+ - lib/custom_fields/extensions/mongoid/relations/referenced/in.rb
189
+ - lib/custom_fields/extensions/mongoid/relations/referenced/many.rb
190
+ - lib/custom_fields/extensions/mongoid/validations/collection_size.rb
191
+ - lib/custom_fields/extensions/mongoid/validations/macros.rb
192
+ - lib/custom_fields/extensions/origin/smash.rb
193
+ - lib/custom_fields/field.rb
194
+ - lib/custom_fields/source.rb
195
+ - lib/custom_fields/target.rb
196
+ - lib/custom_fields/target_helpers.rb
197
+ - lib/custom_fields/types/belongs_to.rb
198
+ - lib/custom_fields/types/boolean.rb
199
+ - lib/custom_fields/types/date.rb
200
+ - lib/custom_fields/types/date_time.rb
201
+ - lib/custom_fields/types/default.rb
202
+ - lib/custom_fields/types/email.rb
203
+ - lib/custom_fields/types/file.rb
204
+ - lib/custom_fields/types/float.rb
205
+ - lib/custom_fields/types/has_many.rb
206
+ - lib/custom_fields/types/integer.rb
207
+ - lib/custom_fields/types/many_to_many.rb
208
+ - lib/custom_fields/types/money.rb
209
+ - lib/custom_fields/types/relationship_default.rb
210
+ - lib/custom_fields/types/select.rb
211
+ - lib/custom_fields/types/string.rb
212
+ - lib/custom_fields/types/tags.rb
213
+ - lib/custom_fields/types/text.rb
214
+ - lib/custom_fields/version.rb
215
+ - lib/custom_fields.rb
216
+ - config/locales/de.yml
217
+ - config/locales/en.yml
218
+ - config/locales/fr.yml
219
+ - config/locales/pt-BR.yml
220
+ - config/locales/ru.yml
221
+ homepage: http://github.com/locomotivecms/custom_fields
222
+ licenses: []
223
+ metadata: {}
224
+ post_install_message:
225
+ rdoc_options: []
226
+ require_paths:
227
+ - lib
228
+ required_ruby_version: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: '0'
233
+ required_rubygems_version: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: 1.3.6
238
+ requirements: []
239
+ rubyforge_project: nowarning
240
+ rubygems_version: 2.0.3
241
+ signing_key:
242
+ specification_version: 4
243
+ summary: Custom fields extension for Mongoid
244
+ test_files: []