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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 260d432de187f7e1c10169a19cab609f7a13fcbb
4
- data.tar.gz: 1e70f58aba6fc6302ef878599ce68d569c73a5a5
3
+ metadata.gz: 4c42e39cf96b5575f103f7885c082ca34738d6f4
4
+ data.tar.gz: d8da97fee1a7a1f8489d8a4da9b9b043be626ec1
5
5
  SHA512:
6
- metadata.gz: f049fc42f97481e740cf67d9e599378ba0fa303cdc759d2f9f2c4a916cbf2c1b4d5618278707fc6fb6793de8b781d7bde8d5a1ae235e639d3dbcd309270a4e6d
7
- data.tar.gz: 283a5088555896596830c243d4e85890748bec35a6e1bbafad3a3b9e75e78cc30fc6ececbebed300c55b54da72bf00300645fb21823486d8f3f06b53f2308b14
6
+ metadata.gz: cb5cd590651843b97c3d957c88cbb71111cd112c233c31512f9edb56fb27548df8317b2d4a30f3fbecda3b2b3e93c5d519130aa275af22f456e72f6175ba3b3d
7
+ data.tar.gz: 6d30a7d567ff2ffa02d8edaf9cacc7f84b5f18551383fe0047c033658c81deeb4b0c4a732370a19d284904fb87bb7656ae17cb6d4963c7f29c02922d7d260ff5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - marano