diary 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{diary}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Robin Clart"]
@@ -17,6 +17,7 @@ module Diary
17
17
  module Message
18
18
  # Red
19
19
  Error = " \e[1;31merror\e[0m"
20
+ Skip = " \e[1;31mskip\e[0m"
20
21
 
21
22
  # Green
22
23
  Published = " \e[1;32mpublished\e[0m"
@@ -153,7 +153,7 @@ module Diary
153
153
  def self.create(title, path, directory)
154
154
  FileUtils.mkdir_p("#{base_directory}/#{directory}")
155
155
  file = File.new(path, "w+")
156
- file.puts("# #{title}")
156
+ file.puts("---\ntitle: #{title}\n---\n")
157
157
  file.close
158
158
 
159
159
  puts "#{Created} #{path}"
@@ -7,6 +7,14 @@ module Diary
7
7
  def date
8
8
  @date ||= Date.parse(@dir_path)
9
9
  end
10
+
11
+ def output(force = false)
12
+ if date <= Date.today
13
+ super(force)
14
+ else
15
+ puts "#{Skip} #{file_path}"
16
+ end
17
+ end
10
18
 
11
19
  private
12
20
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Robin Clart