Rename notelink to interlink

This commit is contained in:
Seongjae Lee
2015-09-27 10:45:51 -07:00
parent c5eca919ed
commit ca7c14e3b7
3 changed files with 12 additions and 12 deletions
+3 -3
View File
@@ -3,10 +3,10 @@ fs = require 'fs-plus'
Utility = require './utility'
module.exports =
class NoteLink
class Interlink
constructor: ->
@subscriptions = new CompositeDisposable
@subscriptions.add atom.commands.add 'atom-workspace', 'nvatom:openInterlink': => NoteLink.openInterlink()
@subscriptions.add atom.commands.add 'atom-workspace', 'nvatom:openInterlink': => Interlink.openInterlink()
destroy: ->
@subscriptions.dispose()
@@ -16,7 +16,7 @@ class NoteLink
return unless editor?
return unless Utility.isNote(editor.getPath())
noteTitle = NoteLink.getInterlinkUnderCursor(editor)
noteTitle = Interlink.getInterlinkUnderCursor(editor)
return unless noteTitle?
return unless noteTitle.length
+3 -3
View File
@@ -1,7 +1,7 @@
path = require 'path'
fs = require 'fs-plus'
{CompositeDisposable, Disposable} = require 'atom'
NoteLink = require './notelink'
Interlink = require './interlink'
Utility = require './utility'
module.exports =
@@ -51,11 +51,11 @@ module.exports =
@subscriptions.add atom.workspace.onWillDestroyPaneItem ({item}) => @autosave(item) unless @autodelete(item)
@noteLink = new NoteLink()
@interlink = new Interlink()
deactivate: ->
@subscriptions.dispose()
@noteLink.destroy()
@interlnk.destroy()
@notationalVelocityView.destroy()
serialize: ->
@@ -1,9 +1,9 @@
fs = require 'fs-plus'
path = require 'path'
temp = require 'temp'
NoteLink = require '../lib/notelink'
Interlink = require '../lib/interlink'
describe 'Notelink', ->
describe 'Interlink', ->
defaultDirectory = atom.config.get('nvatom.directory')
noteDirectory = null
@@ -40,7 +40,7 @@ describe 'Notelink', ->
for testitem in testdata
editor.setText testitem.text
editor.setCursorBufferPosition testitem.position
expect(NoteLink.getInterlinkUnderCursor(editor)).toBe testitem.expected
expect(Interlink.getInterlinkUnderCursor(editor)).toBe testitem.expected
it 'returns undefined for invalid text', ->
testdata = [
@@ -57,7 +57,7 @@ describe 'Notelink', ->
for testitem in testdata
editor.setText testitem.text
editor.setCursorBufferPosition testitem.position
expect(NoteLink.getInterlinkUnderCursor(editor)).toBe undefined
expect(Interlink.getInterlinkUnderCursor(editor)).toBe undefined
describe 'when openInterlink is called', ->
describe 'when the editor path is under the note directory', ->
@@ -71,7 +71,7 @@ describe 'Notelink', ->
editor.setText '[[Car]]'
editor.setCursorBufferPosition [0, 2]
editorPromise = NoteLink.openInterlink()
editorPromise = Interlink.openInterlink()
expect(editorPromise).not.toBe undefined
waitsForPromise ->
editorPromise
@@ -90,5 +90,5 @@ describe 'Notelink', ->
editor.setText '[[Car]]'
editor.setCursorBufferPosition [0, 2]
editorPromise = NoteLink.openInterlink()
editorPromise = Interlink.openInterlink()
expect(editorPromise).toBe undefined