rb-dayone 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.1.7 /
2
+
3
+ * The dayone binary can now add entries to your journal
4
+ * [FIXED] Managed to break the gem's include in 0.1.6, and because I'm a terrible amateur at all this, didn't pick up on it.
5
+
1
6
  == 0.1.6 / 2012-08-13
2
7
 
3
8
  * Updated documentation so YARD would generate nice rdocs
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # rb-dayone
2
2
 
3
- A means to create DayOne entries in ruby.
3
+ A means to create DayOne entries in ruby. Also, my first public ruby gem!
4
4
 
5
5
  Examples
6
6
  --------
@@ -22,6 +22,10 @@ When you're ready to save your entry, just run the `create!` method:
22
22
 
23
23
  e.create!
24
24
 
25
+ Alternatively, run from the command line:
26
+
27
+ dayone add --text "#Hello, world" --starred
28
+
25
29
  Install
26
30
  -------
27
31
 
@@ -32,12 +36,12 @@ Author
32
36
 
33
37
  Original author: Jan-Yves Ruzicka
34
38
 
35
- Roadmap
39
+ To do
36
40
  -------
37
41
 
38
42
  * Image support
39
43
  * Location support?
40
- * Auto-location detection
44
+ * Auto-journal detection
41
45
 
42
46
  License
43
47
  -------
data/bin/dayone CHANGED
@@ -35,4 +35,26 @@ command :set do |c|
35
35
  exit 1
36
36
  end
37
37
  end
38
+ end
39
+
40
+ command :add do |c|
41
+ c.syntax = "add [--text=\"Entry text\"] [--starred]"
42
+ c.description = "Add an entry to your DayOne journal."
43
+ c.summary = <<-end
44
+ Add an entry to your DayOne journal. By default will add an unstarred entry - use the --starred flag to change this.
45
+
46
+ If you don't specify the --text tag, it will read text from STDIN and use this as the journal entry.
47
+ end
48
+
49
+ c.option "--text STRING", String, "Specify the journal entry text. If not specified, will read from STDIN"
50
+ c.option "--starred", "Mark the entry starrd"
51
+
52
+ c.action do |args, opts|
53
+ require 'rb-dayone'
54
+ entry_text = opts.text || $stdin.read.strip
55
+ starred = opts.starred
56
+
57
+ entry = DayOne::Entry.new entry_text, starred:starred
58
+ entry.create!
59
+ end
38
60
  end
data/lib/rb-dayone.rb CHANGED
@@ -45,4 +45,6 @@ Error: DayOne journal file has not been located.
45
45
  Please set this using the command `dayone --set location
46
46
  before continuing.
47
47
  end
48
- end
48
+ end
49
+
50
+ require 'rb-dayone/entry'
data/rb-dayone.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  #{'-'*80}
21
21
  Thank you for installing rb-dayone!
22
22
 
23
- To finish setup, run `dayone --set location <location>` to specify where your DayOne journal is stored.
23
+ To finish setup, run `dayone set location <location>` to specify where your DayOne journal is stored.
24
24
  #{'-'*80}
25
25
  end
26
26
 
data/spec/entry_spec.rb CHANGED
@@ -7,7 +7,7 @@ describe DayOne::Entry do
7
7
 
8
8
  after :all do
9
9
  Dir['spec/entries/*.doentry'].each{ |f| FileUtils.rm(f) }
10
- FileUtils.rm('spec/entries')
10
+ FileUtils.rmdir('spec/entries')
11
11
  end
12
12
 
13
13
  describe "#to_xml" do
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-dayone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,7 +54,7 @@ post_install_message: ! '-------------------------------------------------------
54
54
  Thank you for installing rb-dayone!
55
55
 
56
56
 
57
- To finish setup, run `dayone --set location <location>` to specify where your DayOne
57
+ To finish setup, run `dayone set location <location>` to specify where your DayOne
58
58
  journal is stored.
59
59
 
60
60
  --------------------------------------------------------------------------------