evernote-editor 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -5,6 +5,10 @@
5
5
  Simple gem that provides command line creation and editing of Evernote notes.
6
6
  Uses your favorite editor and Markdown formatting.
7
7
 
8
+ ## Requirements
9
+
10
+ Only tested on OSX and Ruby 1.9.3 with `vim` and `mvim` editors. YMMV.
11
+
8
12
  ## Installation
9
13
 
10
14
  gem install evernote-editor
@@ -13,9 +13,10 @@ module EvernoteEditor
13
13
  attr_accessor :configuration
14
14
 
15
15
  def initialize(*args, opts)
16
- @title = args.flatten[0] || "Untitled note - #{Time.now}"
16
+ @title = args.flatten[0] || ""
17
17
  @tags = (args.flatten[1] || '').split(',')
18
18
  @options = opts
19
+ @sandbox = opts[:sandbox]
19
20
  @mkdout = Redcarpet::Markdown.new(Redcarpet::Render::XHTML,
20
21
  autolink: true, space_after_headers: true, no_intra_emphasis: true)
21
22
  end
@@ -25,7 +26,6 @@ module EvernoteEditor
25
26
  @options[:edit] ? edit_note : create_note
26
27
  end
27
28
 
28
-
29
29
  def configure
30
30
  FileUtils.touch(CONFIGURATION_FILE) unless File.exist?(CONFIGURATION_FILE)
31
31
  @configuration = YAML::load(File.open(CONFIGURATION_FILE)) || {}
@@ -39,7 +39,7 @@ module EvernoteEditor
39
39
  evn_client = EvernoteOAuth::Client.new(token: @configuration[:token], sandbox: @sandbox)
40
40
  note_store = evn_client.note_store
41
41
  note = Evernote::EDAM::Type::Note.new
42
- note.title = @title
42
+ note.title = @title.empty? ? "Untitled note" : @title
43
43
  note.content = note_markup(markdown)
44
44
  created_note = note_store.createNote(@configuration[:token], note)
45
45
  say "Successfully created new note '#{created_note.title}'"
@@ -1,3 +1,3 @@
1
1
  module EvernoteEditor
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evernote-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: