plain_record 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -1
- data/ChangeLog +5 -0
- data/Gemfile +8 -3
- data/Gemfile.lock +16 -18
- data/Rakefile +6 -4
- data/lib/plain_record/associations.rb +16 -10
- data/lib/plain_record/extra/git.rb +2 -6
- data/lib/plain_record/extra/i18n.rb +2 -4
- data/lib/plain_record/extra/image.rb +282 -0
- data/lib/plain_record/file.rb +91 -0
- data/lib/plain_record/filepath.rb +41 -42
- data/lib/plain_record/model.rb +4 -4
- data/lib/plain_record/rails.rb +38 -0
- data/lib/plain_record/resource.rb +7 -6
- data/lib/plain_record/type.rb +2 -0
- data/lib/plain_record/version.rb +1 -1
- data/lib/plain_record.rb +7 -9
- data/plain_record.gemspec +4 -1
- data/spec/associations_spec.rb +9 -4
- data/spec/file_spec.rb +88 -0
- data/spec/image_spec.rb +149 -0
- data/spec/spec_helper.rb +4 -0
- metadata +98 -29
data/lib/plain_record/model.rb
CHANGED
@@ -44,7 +44,7 @@ module PlainRecord
|
|
44
44
|
attr_accessor :virtuals
|
45
45
|
|
46
46
|
# Storage type: +:entry+ or +:list+.
|
47
|
-
attr_reader
|
47
|
+
attr_reader :storage
|
48
48
|
|
49
49
|
# Content of already loaded files.
|
50
50
|
attr_accessor :loaded
|
@@ -85,8 +85,8 @@ module PlainRecord
|
|
85
85
|
# Write all loaded entries to +file+.
|
86
86
|
def save_file(file)
|
87
87
|
if @loaded.has_key? file
|
88
|
-
File.open(file, 'w') do |io|
|
89
|
-
io
|
88
|
+
::File.open(file, 'w') do |io|
|
89
|
+
io << entries_string(@loaded[file]).slice(5..-1)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
@@ -202,7 +202,7 @@ module PlainRecord
|
|
202
202
|
|
203
203
|
# Delete file, cache and empty dirs in path.
|
204
204
|
def delete_file(file)
|
205
|
-
File.delete(file)
|
205
|
+
::File.delete(file)
|
206
206
|
@loaded.delete(file)
|
207
207
|
|
208
208
|
path = Pathname(file).dirname
|
@@ -0,0 +1,38 @@
|
|
1
|
+
=begin
|
2
|
+
Ruby on Rails integration.
|
3
|
+
|
4
|
+
Copyright (C) 2012 Andrey “A.I.” Sitnik <andrey@sitnik.ru>,
|
5
|
+
sponsored by Evil Martians.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU Lesser General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU Lesser General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU Lesser General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
=end
|
20
|
+
|
21
|
+
ActiveSupport.on_load(:after_initialize) do
|
22
|
+
PlainRecord.root = Rails.root.join('data')
|
23
|
+
PlainRecord::Extra::Image.dir = Rails.root.join('app/assets/images/data/')
|
24
|
+
PlainRecord::Extra::Image.url = 'data/'
|
25
|
+
end
|
26
|
+
|
27
|
+
module PlainRecord::RailsController
|
28
|
+
private
|
29
|
+
def plain_record_convert_images
|
30
|
+
Dir.glob(Rails.root.join('app/models/**/*.rb')) { |i| require_dependency i }
|
31
|
+
PlainRecord::Extra::Image.convert_images!
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
if Rails.env.development?
|
36
|
+
ActionController::Base.send(:include, PlainRecord::RailsController)
|
37
|
+
ActionController::Base.send(:before_filter, :plain_record_convert_images)
|
38
|
+
end
|
@@ -48,12 +48,13 @@ module PlainRecord
|
|
48
48
|
# text :content
|
49
49
|
# end
|
50
50
|
module Resource
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
51
|
+
def self.included(base)
|
52
|
+
base.send :extend, Model
|
53
|
+
base.send :extend, PlainRecord::File::Model
|
55
54
|
end
|
56
55
|
|
56
|
+
include PlainRecord::File
|
57
|
+
|
57
58
|
# Fields values.
|
58
59
|
attr_reader :data
|
59
60
|
|
@@ -102,8 +103,8 @@ module PlainRecord
|
|
102
103
|
unless self.class.path =~ /[\*\[\?\{]/
|
103
104
|
self.file = self.class.path
|
104
105
|
else
|
105
|
-
raise ArgumentError,
|
106
|
-
|
106
|
+
raise ArgumentError,
|
107
|
+
"There isn't file to save entry. Set filepath fields or file."
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
data/lib/plain_record/type.rb
CHANGED
@@ -75,6 +75,7 @@ module PlainRecord
|
|
75
75
|
Time => 'v.is_a?(String) ? Time.parse(v) : v',
|
76
76
|
Date => 'v.is_a?(String) ? Date.parse(v) : v'
|
77
77
|
}
|
78
|
+
|
78
79
|
Type.stringifies = {
|
79
80
|
String => 'v ? v.to_s : v',
|
80
81
|
Integer => 'v ? v.to_i : v',
|
@@ -82,5 +83,6 @@ module PlainRecord
|
|
82
83
|
Time => 'v ? v.strftime("%Y-%m-%d %H:%M:%S %Z") : v',
|
83
84
|
Date => 'v'
|
84
85
|
}
|
86
|
+
|
85
87
|
end
|
86
88
|
end
|
data/lib/plain_record/version.rb
CHANGED
data/lib/plain_record.rb
CHANGED
@@ -31,13 +31,15 @@ require dir + 'filepath'
|
|
31
31
|
require dir + 'association_proxy'
|
32
32
|
require dir + 'associations'
|
33
33
|
require dir + 'type'
|
34
|
+
require dir + 'file'
|
34
35
|
require dir + 'model'
|
35
36
|
require dir + 'resource'
|
36
37
|
|
37
38
|
module PlainRecord
|
38
39
|
module Extra
|
39
|
-
autoload :Git,
|
40
|
-
autoload :I18n,
|
40
|
+
autoload :Git, 'plain_record/extra/git'
|
41
|
+
autoload :I18n, 'plain_record/extra/i18n'
|
42
|
+
autoload :Image, 'plain_record/extra/image'
|
41
43
|
end
|
42
44
|
|
43
45
|
class << self
|
@@ -47,7 +49,7 @@ module PlainRecord
|
|
47
49
|
# as <tt>/content/</tt>).
|
48
50
|
def root=(value)
|
49
51
|
value = value.to_s
|
50
|
-
value += File::SEPARATOR if File::SEPARATOR != value[-1..-1]
|
52
|
+
value += ::File::SEPARATOR if ::File::SEPARATOR != value[-1..-1]
|
51
53
|
@root = value
|
52
54
|
end
|
53
55
|
|
@@ -55,13 +57,9 @@ module PlainRecord
|
|
55
57
|
#
|
56
58
|
# If you set +path+ it will be added to root path.
|
57
59
|
def root(path = '')
|
58
|
-
File.join(@root, path)
|
60
|
+
::File.join(@root, path)
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
63
|
-
if defined? Rails
|
64
|
-
ActiveSupport.on_load(:after_initialize) do
|
65
|
-
PlainRecord.root = Rails.root.join('data')
|
66
|
-
end
|
67
|
-
end
|
65
|
+
require(dir + 'rails') if defined? Rails
|
data/plain_record.gemspec
CHANGED
@@ -22,11 +22,14 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.email = 'andrey@sitnik.ru'
|
23
23
|
s.homepage = 'https://github.com/ai/plain_record'
|
24
24
|
|
25
|
+
s.add_dependency "escape", [">= 0"]
|
26
|
+
|
25
27
|
s.add_development_dependency "bundler", [">= 1.0.10"]
|
26
28
|
s.add_development_dependency "yard", [">= 0"]
|
27
29
|
s.add_development_dependency "rake", [">= 0"]
|
28
30
|
s.add_development_dependency "rspec", [">= 0"]
|
29
31
|
s.add_development_dependency "redcarpet", [">= 0"]
|
30
|
-
s.add_development_dependency "r18n-core", [">= 0"]
|
32
|
+
s.add_development_dependency "r18n-core", [">= 1.0.0"]
|
31
33
|
s.add_development_dependency "i18n", [">= 0"]
|
34
|
+
s.add_development_dependency "rmagick", [">= 0"]
|
32
35
|
end
|
data/spec/associations_spec.rb
CHANGED
@@ -9,8 +9,9 @@ describe PlainRecord::Associations do
|
|
9
9
|
|
10
10
|
class ::RatedPost
|
11
11
|
include PlainRecord::Resource
|
12
|
-
entry_in 'data
|
13
|
-
|
12
|
+
entry_in 'data/*/post.md'
|
13
|
+
virtual :name, in_filepath(1)
|
14
|
+
field :rate, one(::Rate)
|
14
15
|
end
|
15
16
|
|
16
17
|
class ::Comment
|
@@ -51,17 +52,21 @@ describe PlainRecord::Associations do
|
|
51
52
|
end
|
52
53
|
|
53
54
|
it "should load one-to-one real association" do
|
54
|
-
rate = ::RatedPost.first().rate
|
55
|
+
rate = ::RatedPost.first(:name => '3').rate
|
55
56
|
rate.should be_instance_of(::Rate)
|
56
57
|
rate.path.should == 'data/3/post.md'
|
57
58
|
rate.data.should == { 'subject' => 5, 'text' => 2 }
|
58
59
|
end
|
59
60
|
|
61
|
+
it "should return nil if one-to-one real association is empty" do
|
62
|
+
::RatedPost.first(:name => '1').rate.should be_nil
|
63
|
+
end
|
64
|
+
|
60
65
|
it "should save one-to-one real association" do
|
61
66
|
file = StringIO.new
|
62
67
|
File.should_receive(:open).with(anything(), 'w').and_yield(file)
|
63
68
|
|
64
|
-
::RatedPost.first().save()
|
69
|
+
::RatedPost.first(:name => '3').save()
|
65
70
|
|
66
71
|
file.should has_yaml({ 'title' => 'Third',
|
67
72
|
'rate' => { 'text' => 2, 'subject' => 5 } })
|
data/spec/file_spec.rb
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
+
|
3
|
+
describe PlainRecord::File do
|
4
|
+
|
5
|
+
it "should calculate file path" do
|
6
|
+
locale = 'en'
|
7
|
+
klass = Class.new do
|
8
|
+
include PlainRecord::Resource
|
9
|
+
field :name
|
10
|
+
virtual :a, file('a')
|
11
|
+
virtual :b, file { |i| "#{i.name}.#{locale}" }
|
12
|
+
end
|
13
|
+
one = klass.new
|
14
|
+
|
15
|
+
one.name = '1'
|
16
|
+
one.field_filepath(:a).should == PlainRecord.root('a')
|
17
|
+
one.field_filepath(:b).should == PlainRecord.root('1.en')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should read field from file" do
|
21
|
+
File.stub!(:exists?).and_return(true)
|
22
|
+
File.stub!(:read)
|
23
|
+
|
24
|
+
type = '1'
|
25
|
+
klass = Class.new do
|
26
|
+
include PlainRecord::Resource
|
27
|
+
virtual :a, file { type }
|
28
|
+
end
|
29
|
+
|
30
|
+
one = klass.new
|
31
|
+
File.should_receive(:read).with(PlainRecord.root('1')).and_return('A')
|
32
|
+
one.a.should == 'A'
|
33
|
+
|
34
|
+
type = '2'
|
35
|
+
File.should_receive(:read).with(PlainRecord.root('2')).and_return('B')
|
36
|
+
one.a.should == 'B'
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should return if file is not exists" do
|
40
|
+
klass = Class.new do
|
41
|
+
include PlainRecord::Resource
|
42
|
+
virtual :a, file { 'a' }
|
43
|
+
end
|
44
|
+
|
45
|
+
one = klass.new
|
46
|
+
one.a.should be_nil
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should cache new value" do
|
50
|
+
type = '1'
|
51
|
+
klass = Class.new do
|
52
|
+
include PlainRecord::Resource
|
53
|
+
virtual :a, file { type }
|
54
|
+
end
|
55
|
+
|
56
|
+
one = klass.new
|
57
|
+
one.a = 1
|
58
|
+
one.unsaved_files.should == { PlainRecord.root('1') => 1 }
|
59
|
+
one.a.should == 1
|
60
|
+
|
61
|
+
type = '2'
|
62
|
+
one.a = 2
|
63
|
+
one.unsaved_files.should == { PlainRecord.root('1') => 1,
|
64
|
+
PlainRecord.root('2') => 2 }
|
65
|
+
one.a.should == 2
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should save new value to file" do
|
69
|
+
file = ''
|
70
|
+
File.stub!(:open)
|
71
|
+
File.should_receive(:open).with(PlainRecord.root('a'), 'w').and_yield(file)
|
72
|
+
File.should_receive(:open).with(PlainRecord.root('file'), 'w').and_yield("")
|
73
|
+
|
74
|
+
klass = Class.new do
|
75
|
+
include PlainRecord::Resource
|
76
|
+
entry_in 'file'
|
77
|
+
virtual :a, file('a')
|
78
|
+
end
|
79
|
+
|
80
|
+
one = klass.new
|
81
|
+
one.a = 'B'
|
82
|
+
one.save
|
83
|
+
|
84
|
+
one.unsaved_files.should == { }
|
85
|
+
file.should == 'B'
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
data/spec/image_spec.rb
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
+
|
3
|
+
describe PlainRecord::Extra::Image do
|
4
|
+
|
5
|
+
before do
|
6
|
+
PlainRecord::Extra::Image.dir = 'images/data/'
|
7
|
+
PlainRecord::Extra::Image.url = 'data/'
|
8
|
+
|
9
|
+
@klass = Class.new do
|
10
|
+
include PlainRecord::Resource
|
11
|
+
include PlainRecord::Extra::Image
|
12
|
+
|
13
|
+
image_from { |entry, field| "#{entry.name}/#{field}.png" }
|
14
|
+
image_url { |entry, field, size| "#{field}.#{size}.png" }
|
15
|
+
|
16
|
+
field :name
|
17
|
+
virtual :logo, image(:small => '16x16')
|
18
|
+
virtual :photo, image
|
19
|
+
end
|
20
|
+
|
21
|
+
@entry = @klass.new
|
22
|
+
@entry.name = 'a'
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should throw error if there is no image_to" do
|
26
|
+
PlainRecord::Extra::Image.dir = nil
|
27
|
+
PlainRecord::Extra::Image.url = nil
|
28
|
+
|
29
|
+
lambda {
|
30
|
+
@klass.get_image_file(@entry, :logo, :small)
|
31
|
+
}.should raise_error(ArgumentError, /Image.dir/)
|
32
|
+
|
33
|
+
lambda {
|
34
|
+
PlainRecord::Extra::Image.convert_images!
|
35
|
+
}.should raise_error(ArgumentError, /Image.dir/)
|
36
|
+
|
37
|
+
lambda {
|
38
|
+
@klass.get_image_url(@entry, :logo, :small)
|
39
|
+
}.should raise_error(ArgumentError, /Image.url/)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should calculate paths" do
|
43
|
+
@klass.get_image_from(@entry, :logo).should ==
|
44
|
+
PlainRecord.root('a/logo.png')
|
45
|
+
@klass.get_image_file(@entry, :logo, :small).should ==
|
46
|
+
'images/data/logo.small.png'
|
47
|
+
@klass.get_image_url(@entry, :logo, :small).should ==
|
48
|
+
'data/logo.small.png'
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should return image data" do
|
52
|
+
@entry.logo.should_not be_exists
|
53
|
+
File.stub!(:exists?).and_return(true)
|
54
|
+
@entry.logo.should be_exists
|
55
|
+
|
56
|
+
@entry.logo.original.should == PlainRecord.root('a/logo.png')
|
57
|
+
@entry.logo.file.should be_nil
|
58
|
+
@entry.logo.url.should be_nil
|
59
|
+
@entry.logo(:small).url.should == 'data/logo.small.png'
|
60
|
+
@entry.logo(:small).file.should == 'images/data/logo.small.png'
|
61
|
+
@entry.logo(:small).size.should == '16x16'
|
62
|
+
@entry.logo(:small).width.should == 16
|
63
|
+
@entry.logo(:small).height.should == 16
|
64
|
+
@entry.logo(:small).size_name.should == :small
|
65
|
+
@entry.photo.url.should == 'data/photo..png'
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should copy image without size" do
|
69
|
+
File.stub!(:exists?)
|
70
|
+
File.should_receive(:exists?).
|
71
|
+
with(PlainRecord.root('a/logo.png')).and_return(false)
|
72
|
+
File.should_receive(:exists?).
|
73
|
+
with(PlainRecord.root('a/photo.png')).and_return(true)
|
74
|
+
|
75
|
+
FileUtils.stub!(:cp)
|
76
|
+
FileUtils.should_receive(:cp).
|
77
|
+
with(PlainRecord.root('a/photo.png'), 'images/data/photo..png')
|
78
|
+
|
79
|
+
@entry.convert_images!
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should resize image", :unless => is_rbx do
|
83
|
+
File.stub!(:exists?)
|
84
|
+
File.should_receive(:exists?).
|
85
|
+
with(PlainRecord.root('a/logo.png')).and_return(true)
|
86
|
+
|
87
|
+
thumb = double('thumb')
|
88
|
+
thumb.stub!(:write)
|
89
|
+
thumb.should_receive(:write).with('images/data/logo.small.png')
|
90
|
+
|
91
|
+
original = double('original')
|
92
|
+
original.stub!(:resize)
|
93
|
+
original.should_receive(:resize).with(16, 16).and_return(thumb)
|
94
|
+
|
95
|
+
require 'RMagick'
|
96
|
+
Magick::Image.stub!(:read)
|
97
|
+
Magick::Image.should_receive(:read).
|
98
|
+
with(PlainRecord.root('a/logo.png')).and_return([original])
|
99
|
+
|
100
|
+
@entry.convert_images!
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should remember all models, which use extention" do
|
104
|
+
PlainRecord::Extra::Image.included_in = []
|
105
|
+
|
106
|
+
one = Class.new do
|
107
|
+
include PlainRecord::Resource
|
108
|
+
include PlainRecord::Extra::Image
|
109
|
+
end
|
110
|
+
two = Class.new do
|
111
|
+
include PlainRecord::Resource
|
112
|
+
include PlainRecord::Extra::Image
|
113
|
+
end
|
114
|
+
|
115
|
+
PlainRecord::Extra::Image.included_in.should == [one, two]
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should delete all old image" do
|
119
|
+
PlainRecord::Extra::Image.included_in = [@klass]
|
120
|
+
|
121
|
+
def @klass.entry
|
122
|
+
@entry ||= self.new
|
123
|
+
end
|
124
|
+
def @klass.all
|
125
|
+
[entry]
|
126
|
+
end
|
127
|
+
|
128
|
+
Dir.stub!(:glob).and_yield('images/data/a.png')
|
129
|
+
Dir.should_receive(:glob).with('images/data/**/*')
|
130
|
+
|
131
|
+
File.stub!(:exists?).and_return(true)
|
132
|
+
File.should_receive(:exists?).with('images/data/a.png')
|
133
|
+
|
134
|
+
FileUtils.stub!(:rm_r)
|
135
|
+
FileUtils.should_receive(:rm_r).with('images/data/a.png')
|
136
|
+
|
137
|
+
@klass.entry.stub(:convert_images!)
|
138
|
+
@klass.entry.should_receive(:convert_images!)
|
139
|
+
|
140
|
+
PlainRecord::Extra::Image.convert_images!
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should return right error on wrong size" do
|
144
|
+
lambda {
|
145
|
+
@entry.logo(:no)
|
146
|
+
}.should raise_error(ArgumentError, "Field `logo` doesn't have `no` size")
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,93 +1,160 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plain_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.3'
|
5
4
|
prerelease:
|
5
|
+
version: '0.4'
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrey "A.I." Sitnik
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
+
type: :runtime
|
16
|
+
name: escape
|
17
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ! '>='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '0'
|
29
|
+
prerelease: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
type: :development
|
15
32
|
name: bundler
|
16
|
-
|
33
|
+
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 1.0.10
|
39
|
+
requirement: !ruby/object:Gem::Requirement
|
17
40
|
none: false
|
18
41
|
requirements:
|
19
42
|
- - ! '>='
|
20
43
|
- !ruby/object:Gem::Version
|
21
44
|
version: 1.0.10
|
22
|
-
type: :development
|
23
45
|
prerelease: false
|
24
|
-
version_requirements: *23439240
|
25
46
|
- !ruby/object:Gem::Dependency
|
47
|
+
type: :development
|
26
48
|
name: yard
|
27
|
-
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
28
56
|
none: false
|
29
57
|
requirements:
|
30
58
|
- - ! '>='
|
31
59
|
- !ruby/object:Gem::Version
|
32
60
|
version: '0'
|
33
|
-
type: :development
|
34
61
|
prerelease: false
|
35
|
-
version_requirements: *23438660
|
36
62
|
- !ruby/object:Gem::Dependency
|
63
|
+
type: :development
|
37
64
|
name: rake
|
38
|
-
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
39
72
|
none: false
|
40
73
|
requirements:
|
41
74
|
- - ! '>='
|
42
75
|
- !ruby/object:Gem::Version
|
43
76
|
version: '0'
|
44
|
-
type: :development
|
45
77
|
prerelease: false
|
46
|
-
version_requirements: *23438060
|
47
78
|
- !ruby/object:Gem::Dependency
|
79
|
+
type: :development
|
48
80
|
name: rspec
|
49
|
-
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
50
88
|
none: false
|
51
89
|
requirements:
|
52
90
|
- - ! '>='
|
53
91
|
- !ruby/object:Gem::Version
|
54
92
|
version: '0'
|
55
|
-
type: :development
|
56
93
|
prerelease: false
|
57
|
-
version_requirements: *23437480
|
58
94
|
- !ruby/object:Gem::Dependency
|
95
|
+
type: :development
|
59
96
|
name: redcarpet
|
60
|
-
|
97
|
+
version_requirements: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
61
104
|
none: false
|
62
105
|
requirements:
|
63
106
|
- - ! '>='
|
64
107
|
- !ruby/object:Gem::Version
|
65
108
|
version: '0'
|
66
|
-
type: :development
|
67
109
|
prerelease: false
|
68
|
-
version_requirements: *23436940
|
69
110
|
- !ruby/object:Gem::Dependency
|
111
|
+
type: :development
|
70
112
|
name: r18n-core
|
71
|
-
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
114
|
none: false
|
73
115
|
requirements:
|
74
116
|
- - ! '>='
|
75
117
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
77
|
-
|
118
|
+
version: 1.0.0
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.0.0
|
78
125
|
prerelease: false
|
79
|
-
version_requirements: *23436360
|
80
126
|
- !ruby/object:Gem::Dependency
|
127
|
+
type: :development
|
81
128
|
name: i18n
|
82
|
-
|
129
|
+
version_requirements: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
requirement: !ruby/object:Gem::Requirement
|
83
136
|
none: false
|
84
137
|
requirements:
|
85
138
|
- - ! '>='
|
86
139
|
- !ruby/object:Gem::Version
|
87
140
|
version: '0'
|
141
|
+
prerelease: false
|
142
|
+
- !ruby/object:Gem::Dependency
|
88
143
|
type: :development
|
144
|
+
name: rmagick
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
requirement: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
153
|
+
requirements:
|
154
|
+
- - ! '>='
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
89
157
|
prerelease: false
|
90
|
-
version_requirements: *23435760
|
91
158
|
description: ! " Plain Record is a data persistence, which use human editable and\n
|
92
159
|
\ readable plain text files. It's ideal for static generated sites,\n like
|
93
160
|
blog or homepage.\n"
|
@@ -116,10 +183,13 @@ files:
|
|
116
183
|
- lib/plain_record/default.rb
|
117
184
|
- lib/plain_record/extra/git.rb
|
118
185
|
- lib/plain_record/extra/i18n.rb
|
186
|
+
- lib/plain_record/extra/image.rb
|
187
|
+
- lib/plain_record/file.rb
|
119
188
|
- lib/plain_record/filepath.rb
|
120
189
|
- lib/plain_record/model.rb
|
121
190
|
- lib/plain_record/model/entry.rb
|
122
191
|
- lib/plain_record/model/list.rb
|
192
|
+
- lib/plain_record/rails.rb
|
123
193
|
- lib/plain_record/resource.rb
|
124
194
|
- lib/plain_record/type.rb
|
125
195
|
- lib/plain_record/version.rb
|
@@ -135,9 +205,11 @@ files:
|
|
135
205
|
- spec/data/authors/intern.yml
|
136
206
|
- spec/data/best/4/post.md
|
137
207
|
- spec/default_spec.rb
|
208
|
+
- spec/file_spec.rb
|
138
209
|
- spec/filepath_spec.rb
|
139
210
|
- spec/git_spec.rb
|
140
211
|
- spec/i18n_spec.rb
|
212
|
+
- spec/image_spec.rb
|
141
213
|
- spec/model_spec.rb
|
142
214
|
- spec/plain_record_spec.rb
|
143
215
|
- spec/resource_spec.rb
|
@@ -154,22 +226,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
226
|
requirements:
|
155
227
|
- - ! '>='
|
156
228
|
- !ruby/object:Gem::Version
|
157
|
-
version: '0'
|
158
229
|
segments:
|
159
230
|
- 0
|
160
|
-
hash: -
|
231
|
+
hash: -1633277468961939816
|
232
|
+
version: '0'
|
161
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
234
|
none: false
|
163
235
|
requirements:
|
164
236
|
- - ! '>='
|
165
237
|
- !ruby/object:Gem::Version
|
166
238
|
version: '0'
|
167
|
-
segments:
|
168
|
-
- 0
|
169
|
-
hash: -2998465728385447997
|
170
239
|
requirements: []
|
171
240
|
rubyforge_project:
|
172
|
-
rubygems_version: 1.8.
|
241
|
+
rubygems_version: 1.8.23
|
173
242
|
signing_key:
|
174
243
|
specification_version: 3
|
175
244
|
summary: Data persistence, which use human editable and readable plain text files.
|