populate-me 0.1.4 → 0.1.5
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 +4 -4
- data/example/config.ru +9 -8
- data/lib/populate_me/grid_fs_attachment.rb +2 -2
- data/lib/populate_me/version.rb +1 -1
- data/populate-me.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 526f9c845b23d850f5edf0d19c497710a74e4c06
|
4
|
+
data.tar.gz: 163e32750f2d8b3aa02b2d274a3f25a0bcdebab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be52a79241cb22b829f23d9157ba99e436f56253d4094f9c8a50ac4c8506c3eb4e9f4cf305195f980c465209f10be92049c80dc6dc7162b2d5840fb5f5276380
|
7
|
+
data.tar.gz: da84fd60662a5fb30a5e834b1f29f3c384d6a9217af1554a033c652f13bda65fc3b080c1ec3ab70fac045cddfd802a1104367baacd22e736c01e9ac4476e9b08
|
data/example/config.ru
CHANGED
@@ -2,21 +2,22 @@ $:.unshift File.expand_path('../../lib', __FILE__)
|
|
2
2
|
|
3
3
|
# Models ##########
|
4
4
|
|
5
|
-
require 'populate_me/
|
5
|
+
require 'populate_me/mongo'
|
6
6
|
require 'mongo'
|
7
7
|
|
8
|
-
MONGO = Mongo::
|
9
|
-
DB = MONGO
|
8
|
+
MONGO = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'blog-populate-me-test')
|
9
|
+
DB = MONGO.database
|
10
|
+
PopulateMe::Mongo.set :db, DB
|
10
11
|
|
11
12
|
# require 'populate_me/attachment'
|
12
13
|
# PopulateMe::Document.set :default_attachment_class, PopulateMe::Attachment
|
13
14
|
# require 'populate_me/file_system_attachment'
|
14
15
|
# PopulateMe::Document.set :default_attachment_class, PopulateMe::FileSystemAttachment
|
15
16
|
require 'populate_me/grid_fs_attachment'
|
16
|
-
PopulateMe::
|
17
|
+
PopulateMe::Mongo.set :default_attachment_class, PopulateMe::GridFS
|
17
18
|
PopulateMe::GridFS.set :db, DB
|
18
19
|
|
19
|
-
class BlogPost < PopulateMe::
|
20
|
+
class BlogPost < PopulateMe::Mongo
|
20
21
|
field :title, required: true
|
21
22
|
field :thumbnail, type: :attachment, variations: [
|
22
23
|
PopulateMe::Variation.new_image_magick_job(:populate_me_thumb, :jpg, "-resize '400x225^' -gravity center -extent 400x225")
|
@@ -29,14 +30,14 @@ class BlogPost < PopulateMe::Document
|
|
29
30
|
error_on(:content,'Cannot be blank') if WebUtils.blank?(self.content)
|
30
31
|
end
|
31
32
|
end
|
32
|
-
class BlogPost::Author < PopulateMe::
|
33
|
+
class BlogPost::Author < PopulateMe::Mongo
|
33
34
|
# nested
|
34
35
|
field :name
|
35
36
|
def validate
|
36
37
|
error_on(:name, 'Cannot be shit') if self.name=='shit'
|
37
38
|
end
|
38
39
|
end
|
39
|
-
class BlogPost::Comment < PopulateMe::
|
40
|
+
class BlogPost::Comment < PopulateMe::Mongo
|
40
41
|
# not nested
|
41
42
|
field :author, default: 'Anonymous'
|
42
43
|
field :content, type: :text
|
@@ -44,7 +45,7 @@ class BlogPost::Comment < PopulateMe::Document
|
|
44
45
|
position_field scope: :blog_post_id
|
45
46
|
end
|
46
47
|
|
47
|
-
class Article < PopulateMe::
|
48
|
+
class Article < PopulateMe::Mongo
|
48
49
|
field :title
|
49
50
|
field :content, type: :text
|
50
51
|
position_field
|
data/lib/populate_me/version.rb
CHANGED
data/populate-me.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_development_dependency 'rack-test', '~> 0.6'
|
27
27
|
s.add_development_dependency 'rack-cerberus', '~> 1.0'
|
28
28
|
s.add_development_dependency 'mongo', '~> 2.0'
|
29
|
-
s.add_development_dependency 'rack-grid-serve', '~> 0.0.
|
29
|
+
s.add_development_dependency 'rack-grid-serve', '~> 0.0.8'
|
30
30
|
s.add_development_dependency 'racksh', '~> 1.0'
|
31
31
|
s.add_development_dependency 'rake', '~> 10.1'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: populate-me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickael Riga
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.0.
|
131
|
+
version: 0.0.8
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.0.
|
138
|
+
version: 0.0.8
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: racksh
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
version: '0'
|
237
237
|
requirements: []
|
238
238
|
rubyforge_project:
|
239
|
-
rubygems_version: 2.
|
239
|
+
rubygems_version: 2.6.8
|
240
240
|
signing_key:
|
241
241
|
specification_version: 4
|
242
242
|
summary: PopulateMe is an admin system for web applications.
|