musako 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3603e0dc8aeef9fb670e4783148994caed93efd2
4
- data.tar.gz: 2e3fa8590404773d6874886fc2413e54d61e9071
3
+ metadata.gz: 1ec8a375b4e6516a076749d69645bbefd4fce8fd
4
+ data.tar.gz: 9077d56583da25999560410123c6cb649fd9e85a
5
5
  SHA512:
6
- metadata.gz: 785d32b4d4ac4d7b5ae1f22c9322f510c5e165a99540acd4569cc0fb1081fb6157f172e4a344ff49f7982fbdad16b3035b497cd6085f69ad588c444428347094
7
- data.tar.gz: 65d5b68b1aed58b0a782052b1d99e69eaf3d7b4a8ed708a2f191b574541113b79664d337e2b46872f62c29e62e322cb26d95b7ba44ff38f9f3b9f62e72479a44
6
+ metadata.gz: ad48076369d02726375c0c4ce8e137ad65b03e547d633311b13f93824844e6e2c9105ece12472c6632065759a12e69d004c20e0c323876f53fbc578e45bd70b6
7
+ data.tar.gz: 8efe509c0742abfbd8ecb6e0689417e05cac7d8ba956a4bf5e8408ade9b75a723ea62f8bcd763b29b86f0ac1bd7de5760de658cb440aa2f02d1b6afe0397362d
@@ -1,3 +1,4 @@
1
+ require 'date'
1
2
  require 'slim'
2
3
  require 'redcarpet'
3
4
 
@@ -51,12 +52,15 @@ module Musako
51
52
  end
52
53
 
53
54
  def set_meta_data(title)
54
- time = self.file_updated_at
55
+ buf = self.file_name.split("-")
56
+
57
+ name = (buf.size > 1) ? buf[1] : buf[0]
58
+ date = DateTime.parse(buf[0]) rescue self.file_updated_at
55
59
 
56
60
  @title = title
57
- @date = time
58
- @iso_date = time.strftime("%FT%T%z")
59
- @url = File.join("#{time.year}/#{time.month}/#{time.day}", self.file_name)
61
+ @date = date
62
+ @iso_date = date.strftime("%FT%T%z")
63
+ @url = File.join("#{date.year}/#{date.month}/#{date.day}", name)
60
64
  @path = self.file_path
61
65
  end
62
66
  end
@@ -1,3 +1,3 @@
1
1
  module Musako
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - yo_waka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-21 00:00:00.000000000 Z
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slim