rollin 0.0.10 → 0.0.11
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/VERSION +1 -1
- data/lib/rollin/article.rb +2 -1
- data/spec/article_spec.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c42e39cf96b5575f103f7885c082ca34738d6f4
|
4
|
+
data.tar.gz: d8da97fee1a7a1f8489d8a4da9b9b043be626ec1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb5cd590651843b97c3d957c88cbb71111cd112c233c31512f9edb56fb27548df8317b2d4a30f3fbecda3b2b3e93c5d519130aa275af22f456e72f6175ba3b3d
|
7
|
+
data.tar.gz: 6d30a7d567ff2ffa02d8edaf9cacc7f84b5f18551383fe0047c033658c81deeb4b0c4a732370a19d284904fb87bb7656ae17cb6d4963c7f29c02922d7d260ff5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/lib/rollin/article.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
class Rollin::Article
|
2
|
-
attr_reader :year, :month, :day
|
2
|
+
attr_reader :title, :year, :month, :day
|
3
3
|
|
4
4
|
def initialize(source_file)
|
5
5
|
@source_file = source_file
|
6
6
|
filename = File.basename(@source_file)
|
7
|
+
@title = filename[11, filename.length - 11].gsub('_', ' ')
|
7
8
|
@year = filename[0, 4].to_i
|
8
9
|
@month = filename[5, 2].to_i
|
9
10
|
@day = filename[8, 2].to_i
|
data/spec/article_spec.rb
CHANGED
@@ -2,21 +2,25 @@ require './spec/spec_helper'
|
|
2
2
|
|
3
3
|
describe Rollin::Article do
|
4
4
|
subject (:article) { Rollin::Article.new('spec/fixtures/articles/2013_05_01_My_first_post.mk') }
|
5
|
+
|
6
|
+
it 'tells article title' do
|
7
|
+
article.title == 'My first post'
|
8
|
+
end
|
5
9
|
|
6
10
|
it 'compiles article body to html' do
|
7
11
|
article.body.should == "<h2>This is my first post</h2>\n\n<p>And here we go!</p>\n"
|
8
12
|
end
|
9
13
|
|
10
14
|
it 'tells article year' do
|
11
|
-
article.year == 2013
|
15
|
+
article.year.should == 2013
|
12
16
|
end
|
13
17
|
|
14
18
|
it 'tells article month' do
|
15
|
-
article.month == 5
|
19
|
+
article.month.should == 5
|
16
20
|
end
|
17
21
|
|
18
22
|
it 'tells article day' do
|
19
|
-
article.day == 1
|
23
|
+
article.day.should == 1
|
20
24
|
end
|
21
25
|
|
22
26
|
it 'tells article date' do
|