Skip to content

Commit

Permalink
Merge pull request #436 from vim-jp/rename-revital-of
Browse files Browse the repository at this point in the history
Rename vital#{plugin-name}#of() to vital#{plugin-name}#new()
  • Loading branch information
thinca committed Aug 9, 2016
2 parents ef3ebb9 + 4afbfcf commit da96455
Show file tree
Hide file tree
Showing 63 changed files with 110 additions and 107 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
aabb291268c0977e1444b0901e816db4467d6806
Modules: *
'vital#{plugin-name}#of()' was renamed to 'vital#{plugin-name}#new()'.
982d3cb87ef788f4607fc61f1fd20ec2e3975479
Modules: Vim.Guard
Guard.store() API has changed to take a single List instance instead of arguments, due to the
Expand Down
2 changes: 1 addition & 1 deletion autoload/vital/_vital.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let s:_plugin_name = expand('<sfile>:t:r')

function! vital#{s:_plugin_name}#new() abort
return vital#{s:_plugin_name[1:]}#of()
return vital#{s:_plugin_name[1:]}#new()
endfunction
4 changes: 2 additions & 2 deletions autoload/vital/vital.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
endfunction
endif

function! vital#{s:plugin_name}#of() abort
function! vital#{s:plugin_name}#new() abort
return s:new(s:plugin_name)
endfunction

Expand Down Expand Up @@ -170,7 +170,7 @@ function! s:_import(name) abort dict
let s:loaded[a:name] = export_module
if has_key(module, '_vital_loaded')
try
call module._vital_loaded(vital#{s:plugin_name}#of())
call module._vital_loaded(vital#{s:plugin_name}#new())
catch
unlet s:loaded[a:name]
throw 'vital: fail to call ._vital_loaded(): ' . v:exception
Expand Down
2 changes: 1 addition & 1 deletion autoload/vitalizer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let s:LOADER_FILES = [
\ 'autoload/vital/vital.vim',
\ 'autoload/vital/_vital.vim',
\ ]
let s:V = vital#vital#of()
let s:V = vital#vital#new()
let s:P = s:V.import('Prelude')
let s:L = s:V.import('Data.List')
let s:S = s:V.import('Data.String')
Expand Down
2 changes: 1 addition & 1 deletion test/Bitwise.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Bitwise
Before all
let B = vital#of('vital').import('Bitwise')
let B = vital#vital#new().import('Bitwise')
End

Describe .lshift()
Expand Down
2 changes: 1 addition & 1 deletion test/ConcurrentProcess.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let s:suite = themis#suite('ConcurrentProcess')
let s:assert = themis#helper('assert')

function! s:suite.before()
let s:CP = vital#of('vital').import('ConcurrentProcess')
let s:CP = vital#vital#new().import('ConcurrentProcess')
endfunction

function! s:suite.before_each() abort
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Base64.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.Base64
Before all
let B = vital#of('vital').import('Data.Base64')
let B = vital#vital#new().import('Data.Base64')
End

Describe .encode()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/BigNum.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let s:suite = themis#suite('Data.BigNum')
let s:assert = themis#helper('assert')

function! s:suite.before()
let s:BigNum = vital#of('vital').import('Data.BigNum')
let s:BigNum = vital#vital#new().import('Data.BigNum')
endfunction

function! s:suite.after()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Closure.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.Closure
Before all
let C = vital#of('vital').import('Data.Closure')
let C = vital#vital#new().import('Data.Closure')
End

Describe .build()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Counter.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.Counter
Before all
let Counter = vital#of('vital').import('Data.Counter')
let Counter = vital#vital#new().import('Data.Counter')
End

Describe .new()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Dict.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.Dict
Before all
let D = vital#of('vital').import('Data.Dict')
let D = vital#vital#new().import('Data.Dict')
End

Describe .make()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/LazyList.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.LazyList
Before all
let LazyList = vital#of('vital').import('Data.LazyList')
let LazyList = vital#vital#new().import('Data.LazyList')
End

Describe .from_list()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/List.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.List
Before all
let List = vital#of('vital').import('Data.List')
let List = vital#vital#new().import('Data.List')
End

Describe .pop()
Expand Down
4 changes: 2 additions & 2 deletions test/Data/Optional.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.Optional
Before all
let O = vital#of('vital').import('Data.Optional')
let O = vital#vital#new().import('Data.Optional')
End

Describe .none()
Expand Down Expand Up @@ -169,7 +169,7 @@ Describe Data.Optional
" Note:
" This is workaround because 'O' is defined in outer 'Before all'
" and it can't be refered here.
let O = vital#of('vital').import('Data.Optional')
let O = vital#vital#new().import('Data.Optional')

if a:b == 0
return O.none()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/OrderedSet.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Data.OrderedSet
Before all
let OrderedSet = vital#of('vital').import('Data.OrderedSet')
let OrderedSet = vital#vital#new().import('Data.OrderedSet')
End

Describe .push()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Set.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let s:suite = themis#suite('Data.Set')
let s:assert = themis#helper('assert')

function! s:suite.before()
let s:S = vital#of('vital').import('Data.Set')
let s:S = vital#vital#new().import('Data.Set')
let s:xs = s:S.set([1,2,3,4,5])
let s:ys = s:S.set([3,4,5,6,7])
call themis#func_alias({'set': s:S.set()})
Expand Down
2 changes: 1 addition & 1 deletion test/Data/String.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let s:suite = themis#suite('Data.String')
let s:assert = themis#helper('assert')

function! s:suite.before()
let s:String = vital#of('vital').import('Data.String')
let s:String = vital#vital#new().import('Data.String')
endfunction

function! s:suite.after()
Expand Down
2 changes: 1 addition & 1 deletion test/Data/String.vimspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Describe Data.String
Before all
let Vital = vital#of('vital')
let Vital = vital#vital#new()
let Path = Vital.import('System.Filepath')
let String = Vital.import('Data.String')
End
Expand Down
2 changes: 1 addition & 1 deletion test/Data/String/Interpolation.vimspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Describe Data.String.Interpolation

Before all
let g:I = vital#of('vital').import('Data.String.Interpolation')
let g:I = vital#vital#new().import('Data.String.Interpolation')

function! InterpolationFunc() abort
let year = 2015
Expand Down
2 changes: 1 addition & 1 deletion test/Database/SQLite.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ scriptencoding utf-8

Describe Database.SQLite
Before all
let SQLite = vital#of('vital').import('Database.SQLite')
let SQLite = vital#vital#new().import('Database.SQLite')
End

Describe .is_available()
Expand Down
2 changes: 1 addition & 1 deletion test/DateTime.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe DateTime
Before all
let DT = vital#of('vital').import('DateTime')
let DT = vital#vital#new().import('DateTime')
" TODO set timezone for test here
End

Expand Down
2 changes: 1 addition & 1 deletion test/Interpreter/Brainf__k.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ scriptencoding utf-8

Describe Interpreter.Brainf__k
Before all
let BF = vital#of('vital').import('Interpreter.Brainf__k')
let BF = vital#vital#new().import('Interpreter.Brainf__k')
End

Describe .run_vim_parse_execute()
Expand Down
2 changes: 1 addition & 1 deletion test/Locale/Message.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let s:text_path = 'test/Locale/MessageText/%s.txt'

Describe Locale.Message
Before all
let M = vital#of('vital').import('Locale.Message')
let M = vital#vital#new().import('Locale.Message')
End

Before each
Expand Down
2 changes: 1 addition & 1 deletion test/Math.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let s:suite = themis#suite('Math')
let s:assert = themis#helper('assert')

function! s:suite.before()
let s:M = vital#of('vital').import('Math')
let s:M = vital#vital#new().import('Math')
endfunction

function! s:suite.modulo()
Expand Down
2 changes: 1 addition & 1 deletion test/OptionParser.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endfunction
Describe OptionParser

Before all
let O = vital#of('vital').import('OptionParser')
let O = vital#vital#new().import('OptionParser')
End

Describe .new()
Expand Down
2 changes: 1 addition & 1 deletion test/Prelude.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ scriptencoding utf-8

Describe Prelude
Before all
let P = vital#of('vital').import('Prelude')
let P = vital#vital#new().import('Prelude')
End

Describe .is_numeric()
Expand Down
2 changes: 1 addition & 1 deletion test/Process.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ scriptencoding utf-8

Describe Process
Before all
let Process = vital#of('vital').import('Process')
let Process = vital#vital#new().import('Process')
End

Describe .system()
Expand Down
4 changes: 2 additions & 2 deletions test/ProcessManager.vimspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Describe ProcessManager
Before all
let PM = vital#of('vital').import('ProcessManager')
let PM = vital#vital#new().import('ProcessManager')
End

Describe .is_available()
It behaves the same as has_vimproc()
let P = vital#of('vital').import('Process')
let P = vital#vital#new().import('Process')
Assert Equals(P.has_vimproc(), PM.is_available())
End
End
Expand Down
2 changes: 1 addition & 1 deletion test/Random.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Random
Before all
let R = vital#of('vital').import('Random')
let R = vital#vital#new().import('Random')
End

Describe .next()
Expand Down
2 changes: 1 addition & 1 deletion test/Random/Mt19937ar.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Random.Mt19937ar
Before all
let M = vital#of('vital').import('Random.Mt19937ar')
let M = vital#vital#new().import('Random.Mt19937ar')
End

After all
Expand Down
2 changes: 1 addition & 1 deletion test/Random/Xor128.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Random.Xor128
Before all
let X = vital#of('vital').import('Random.Xor128')
let X = vital#vital#new().import('Random.Xor128')
End

Describe .rand()
Expand Down
2 changes: 1 addition & 1 deletion test/System/Cache.vimspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Use vim-themis to execute this test
let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:F = s:V.import('System.File')

Describe System.Cache
Expand Down
2 changes: 1 addition & 1 deletion test/System/Cache/Base.vimspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Use vim-themis to execute this test
let s:V = vital#of('vital')
let s:V = vital#vital#new()

Describe System.Cache.Base
let s:C = s:V.import('System.Cache.Base')
Expand Down
2 changes: 1 addition & 1 deletion test/System/Cache/Dummy.vimspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Use vim-themis to execute this test
let s:V = vital#of('vital')
let s:V = vital#vital#new()

Describe System.Cache.Dummy
let s:C = s:V.import('System.Cache.Dummy')
Expand Down
2 changes: 1 addition & 1 deletion test/System/Cache/File.vimspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Use vim-themis to execute this test
let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:F = s:V.import('System.File')
let s:P = s:V.import('System.Filepath')

Expand Down
2 changes: 1 addition & 1 deletion test/System/Cache/Memory.vimspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Use vim-themis to execute this test
let s:V = vital#of('vital')
let s:V = vital#vital#new()

Describe System.Cache.Memory
let s:C = s:V.import('System.Cache.Memory')
Expand Down
2 changes: 1 addition & 1 deletion test/System/Cache/SingleFile.vimspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Use vim-themis to execute this test
let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:F = s:V.import('System.File')
let s:P = s:V.import('System.Filepath')

Expand Down
2 changes: 1 addition & 1 deletion test/System/Filepath.vimspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:is_windows = has('win16') || has('win32') || has('win64') || has('win95')

Describe System.Filepath
Expand Down
2 changes: 1 addition & 1 deletion test/System/Process.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scriptencoding utf-8

let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:Prelude = s:V.import('Prelude')
let s:Path = s:V.import('System.Filepath')
let s:Guard = s:V.import('Vim.Guard')
Expand Down
2 changes: 1 addition & 1 deletion test/System/Process/Mock.vimspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let s:V = vital#of('vital')
let s:V = vital#vital#new()

Describe System.Process.Mock
Before
Expand Down
2 changes: 1 addition & 1 deletion test/System/Process/System.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scriptencoding utf-8

let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:Prelude = s:V.import('Prelude')
let s:Path = s:V.import('System.Filepath')
let s:testdata = './test/_testdata/System/Process/'
Expand Down
2 changes: 1 addition & 1 deletion test/System/Process/Vimproc.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scriptencoding utf-8

let s:V = vital#of('vital')
let s:V = vital#vital#new()
let s:Prelude = s:V.import('Prelude')
let s:Path = s:V.import('System.Filepath')
let s:ProcessVimproc = s:V.import('System.Process.Vimproc')
Expand Down
2 changes: 1 addition & 1 deletion test/Text/CSV.vimspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Describe Text.CSV
Before all
let CSV = vital#of('vital').import('Text.CSV')
let CSV = vital#vital#new().import('Text.CSV')
let testdata_dir = expand('<sfile>:p:h') . '/test/_testdata/Text/CSV'
let sample_file_in = testdata_dir . '/csv-sample-in.txt'
let sample_file_out = testdata_dir . '/csv-sample-out.txt'
Expand Down
2 changes: 1 addition & 1 deletion test/Text/INI.vimspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let s:V = vital#of('vital')
let s:V = vital#vital#new()
call s:V.unload()
let s:I = s:V.import('Text.INI')
let s:P = s:V.import('System.Filepath')
Expand Down
2 changes: 1 addition & 1 deletion test/Text/LTSV.vimspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Describe Text.LTSV
Before all
let LTSV = vital#of('vital').import('Text.LTSV')
let LTSV = vital#vital#new().import('Text.LTSV')
let sample_file = g:root . '/test/_testdata/Text/LTSV/sample.ltsv'
let expect_data = [
\ {'name': 'Web.HTTP', 'maintainer': 'mattn'},
Expand Down
2 changes: 1 addition & 1 deletion test/Text/Lexer.vimspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Describe Text.Lexer
Before all
let Lexer = vital#of('vital').import('Text.Lexer')
let Lexer = vital#vital#new().import('Text.Lexer')
let patterns = [
\ ['WHITE_SPACES','\s\+'],
\ ['WORD','[a-zA-Z]\+'],
Expand Down

0 comments on commit da96455

Please sign in to comment.