vim-flavor 2.2.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +1 -1
  3. data/README.md +9 -14
  4. data/features/.nav +2 -1
  5. data/features/backward_compatibilities/flavorfile.feature +166 -0
  6. data/features/backward_compatibilities/lockfile.feature +22 -0
  7. data/features/branches/changing_tracking_branches.feature +0 -3
  8. data/features/branches/detect_incompatible_declarations.feature +0 -2
  9. data/features/branches/install.feature +0 -2
  10. data/features/branches/update.feature +0 -1
  11. data/features/caching/deployment.feature +1 -0
  12. data/features/flavorfile/README.md +1 -1
  13. data/features/flavorfile/comments.feature +0 -1
  14. data/features/flavorfile/groups.feature +0 -3
  15. data/features/flavorfile/repository_name.feature +0 -3
  16. data/features/flavorfile/version_constraint.feature +3 -7
  17. data/features/install_vim_flavor.md +6 -12
  18. data/features/news.md +44 -0
  19. data/features/philosophy.md +4 -4
  20. data/features/resolve_dependencies/README.md +4 -3
  21. data/features/resolve_dependencies/basics.feature +0 -4
  22. data/features/resolve_dependencies/upgrade_outdated_dependencies.feature +0 -2
  23. data/features/resolve_dependencies/version_conflict.feature +0 -2
  24. data/features/step_definitions/cli_steps.rb +6 -1
  25. data/features/step_definitions/dependency_steps.rb +2 -1
  26. data/features/step_definitions/directory_steps.rb +1 -1
  27. data/features/step_definitions/file_steps.rb +2 -2
  28. data/features/step_definitions/flavor_steps.rb +25 -9
  29. data/features/step_definitions/flavorfile_steps.rb +10 -1
  30. data/features/step_definitions/lockfile_steps.rb +14 -5
  31. data/features/support/env.rb +22 -12
  32. data/features/testing_vim_plugins/README.md +7 -6
  33. data/features/testing_vim_plugins/dependencies.feature +2 -3
  34. data/features/testing_vim_plugins/failures.feature +2 -2
  35. data/features/testing_vim_plugins/specifying_test_scripts.feature +3 -3
  36. data/features/testing_vim_plugins/typical_usage.feature +30 -7
  37. data/features/typical_usage/README.md +7 -7
  38. data/features/typical_usage/deploy_to_arbitrary_place.feature +0 -1
  39. data/features/typical_usage/install_vim_plugins.feature +0 -1
  40. data/features/typical_usage/uninstall_vim_plugins.feature +0 -1
  41. data/features/typical_usage/update_vim_plugins.feature +0 -3
  42. data/features/uninstall_vim_flavor.md +3 -4
  43. data/features/version_lock.feature +0 -1
  44. data/features/version_tag_format.feature +0 -4
  45. data/lib/vim-flavor.rb +1 -1
  46. data/lib/vim-flavor/cli.rb +2 -2
  47. data/lib/vim-flavor/console.rb +22 -0
  48. data/lib/vim-flavor/facade.rb +17 -48
  49. data/lib/vim-flavor/flavorfile.rb +24 -1
  50. data/lib/vim-flavor/lockfile.rb +15 -0
  51. data/lib/vim-flavor/stringextension.rb +3 -11
  52. data/lib/vim-flavor/version.rb +1 -1
  53. data/spec/branchversion_spec.rb +4 -4
  54. data/spec/stringextension_spec.rb +31 -0
  55. data/vim-flavor.gemspec +8 -5
  56. metadata +48 -19
  57. data/features/step_definitions/bootstrap_script_steps.rb +0 -6
  58. data/spec/facade_spec.rb +0 -57
@@ -1,3 +1,5 @@
1
+ require 'pathname'
2
+
1
3
  module Vim
2
4
  module Flavor
3
5
  class FlavorFile
@@ -16,7 +18,7 @@ module Vim
16
18
 
17
19
  def self.load_or_new(flavorfile_path)
18
20
  ff = new()
19
- ff.load(flavorfile_path) if File.exists?(flavorfile_path)
21
+ ff.load(flavorfile_path) if FileTest.exists?(flavorfile_path)
20
22
  ff
21
23
  end
22
24
 
@@ -26,6 +28,27 @@ module Vim
26
28
  ff
27
29
  end
28
30
 
31
+ def self.path_from(dir_path, warn)
32
+ flavorfile_path = dir_path.to_flavorfile_path
33
+ new_path = Pathname.new(flavorfile_path).relative_path_from(Pathname.getwd())
34
+ old_path = new_path.dirname() / 'VimFlavor'
35
+
36
+ path = if FileTest.exists?(new_path)
37
+ if warn and FileTest.exists?(old_path)
38
+ Console::warn "Delete #{old_path}. #{new_path} is being read instead."
39
+ end
40
+ new_path
41
+ elsif FileTest.exists?(old_path)
42
+ if warn
43
+ Console::warn "Rename #{old_path} to #{new_path}. #{old_path} wll be ignored in future version."
44
+ end
45
+ old_path
46
+ else
47
+ new_path
48
+ end
49
+ path.to_s
50
+ end
51
+
29
52
  def load(flavorfile_path)
30
53
  instance_eval(
31
54
  File.open(flavorfile_path, 'r').read(),
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module Vim
2
4
  module Flavor
3
5
  class LockFile
@@ -7,6 +9,18 @@ module Vim
7
9
  l
8
10
  end
9
11
 
12
+ def self.path_from(dir_path, error)
13
+ lockfile_path = dir_path.to_lockfile_path
14
+ new_path = Pathname.new(lockfile_path).relative_path_from(Pathname.getwd())
15
+ old_path = new_path.dirname() / 'VimFlavor.lock'
16
+
17
+ if error and FileTest.exists?(old_path)
18
+ Console::error "#{old_path} is no longer used. Rename it to #{new_path}."
19
+ end
20
+
21
+ new_path.to_s
22
+ end
23
+
10
24
  def initialize(path)
11
25
  @path = path
12
26
  end
@@ -38,6 +52,7 @@ module Vim
38
52
  end
39
53
 
40
54
  def save()
55
+ FileUtils.mkdir_p(File.dirname(@path))
41
56
  File.open(@path, 'w') do |io|
42
57
  lines = flavors.flat_map {|f| self.class.serialize_lock_status(f)}
43
58
  lines.each do |line|
@@ -1,24 +1,16 @@
1
1
  module Vim
2
2
  module Flavor
3
3
  module StringExtension
4
- def to_bootstrap_path
5
- "#{self}/bootstrap.vim"
6
- end
7
-
8
- def to_deps_path
9
- "#{self}/deps"
10
- end
11
-
12
4
  def to_flavorfile_path
13
- "#{self}/VimFlavor"
5
+ "#{self}/Flavorfile"
14
6
  end
15
7
 
16
8
  def to_flavors_path
17
- "#{self}/flavors"
9
+ "#{self}/pack/flavors/start"
18
10
  end
19
11
 
20
12
  def to_lockfile_path
21
- "#{self}/VimFlavor.lock"
13
+ "#{self}/Flavorfile.lock"
22
14
  end
23
15
 
24
16
  def to_stash_path
@@ -1,6 +1,6 @@
1
1
  module Vim
2
2
  module Flavor
3
- VERSION = '2.2.2'
3
+ VERSION = '3.0.0'
4
4
 
5
5
  class Version
6
6
  def self.create(arg)
@@ -18,10 +18,10 @@ module Vim
18
18
  end
19
19
 
20
20
  it 'is not comparable' do
21
- expect {v1 < v2}.to raise_error
22
- expect {v1 <= v2}.to raise_error
23
- expect {v1 > v2}.to raise_error
24
- expect {v1 >= v2}.to raise_error
21
+ expect {v1 < v2}.to raise_error(NoMethodError)
22
+ expect {v1 <= v2}.to raise_error(NoMethodError)
23
+ expect {v1 > v2}.to raise_error(NoMethodError)
24
+ expect {v1 >= v2}.to raise_error(NoMethodError)
25
25
  expect(v1 <=> v2).to be_nil
26
26
  end
27
27
 
@@ -3,6 +3,37 @@ require 'spec_helper'
3
3
  module Vim
4
4
  module Flavor
5
5
  describe StringExtension do
6
+ describe '#to_flavorfile_path' do
7
+ it 'extends a given path to a flavorfile' do
8
+ expect('cwd'.to_flavorfile_path).to be == 'cwd/Flavorfile'
9
+ end
10
+ end
11
+
12
+ describe '#to_flavors_path' do
13
+ it 'extends a given path to a flavors path' do
14
+ expect('home/.vim'.to_flavors_path).to be == 'home/.vim/pack/flavors/start'
15
+ end
16
+ end
17
+
18
+ describe '#to_lockfile_path' do
19
+ it 'extends a given path to a lockfile' do
20
+ expect('cwd'.to_lockfile_path).to be == 'cwd/Flavorfile.lock'
21
+ end
22
+ end
23
+
24
+ describe '#to_stash_path' do
25
+ it 'extends a given path to a stash path' do
26
+ expect('home'.to_stash_path).to be == 'home/.vim-flavor'
27
+ expect('cwd'.to_stash_path).to be == 'cwd/.vim-flavor'
28
+ end
29
+ end
30
+
31
+ describe '#to_vimfiles_path' do
32
+ it 'extends a given path to a vimfiles path' do
33
+ expect('home'.to_vimfiles_path).to be == 'home/.vim'
34
+ end
35
+ end
36
+
6
37
  describe '#zap' do
7
38
  it 'replace unsafe characters with "_"' do
8
39
  expect('fakeclip'.zap).to be == 'fakeclip'
@@ -17,12 +17,15 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
+ spec.required_ruby_version = '~> 2.5'
20
21
 
21
- spec.add_dependency('parslet', '~> 1.7')
22
- spec.add_dependency('thor', '~> 0.19')
22
+ spec.add_dependency('parslet', '~> 1.8')
23
+ spec.add_dependency('pastel', '~> 0.7')
24
+ spec.add_dependency('thor', '~> 0.20')
23
25
 
24
- spec.add_development_dependency('aruba', '~> 0.6.0')
25
- spec.add_development_dependency('cucumber', '~> 1.3.0')
26
+ spec.add_development_dependency('aruba', '~> 0.14')
27
+ spec.add_development_dependency('cucumber', '~> 3.1')
26
28
  spec.add_development_dependency('pry')
27
- spec.add_development_dependency('rspec', '~> 2.99')
29
+ spec.add_development_dependency('relish', '~> 0.7')
30
+ spec.add_development_dependency('rspec', '~> 3.7')
28
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim-flavor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kana Natsuno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -16,56 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '1.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pastel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.7'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: thor
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '0.19'
47
+ version: '0.20'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '0.19'
54
+ version: '0.20'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: aruba
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: 0.6.0
61
+ version: '0.14'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 0.6.0
68
+ version: '0.14'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: cucumber
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: 1.3.0
75
+ version: '3.1'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: 1.3.0
82
+ version: '3.1'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: pry
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +94,34 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: relish
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.7'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.7'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rspec
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - "~>"
88
116
  - !ruby/object:Gem::Version
89
- version: '2.99'
117
+ version: '3.7'
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
122
  - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: '2.99'
124
+ version: '3.7'
97
125
  description: A tool to manage your favorite Vim plugins
98
126
  email:
99
127
  - dev@whileimautomaton.net
@@ -113,6 +141,8 @@ files:
113
141
  - bin/vim-flavor
114
142
  - features/.nav
115
143
  - features/README.md
144
+ - features/backward_compatibilities/flavorfile.feature
145
+ - features/backward_compatibilities/lockfile.feature
116
146
  - features/branches/README.md
117
147
  - features/branches/changing_tracking_branches.feature
118
148
  - features/branches/detect_incompatible_declarations.feature
@@ -137,7 +167,6 @@ files:
137
167
  - features/resolve_dependencies/basics.feature
138
168
  - features/resolve_dependencies/upgrade_outdated_dependencies.feature
139
169
  - features/resolve_dependencies/version_conflict.feature
140
- - features/step_definitions/bootstrap_script_steps.rb
141
170
  - features/step_definitions/cli_steps.rb
142
171
  - features/step_definitions/dependency_steps.rb
143
172
  - features/step_definitions/directory_steps.rb
@@ -162,6 +191,7 @@ files:
162
191
  - lib/vim-flavor.rb
163
192
  - lib/vim-flavor/branchversion.rb
164
193
  - lib/vim-flavor/cli.rb
194
+ - lib/vim-flavor/console.rb
165
195
  - lib/vim-flavor/enumerableextension.rb
166
196
  - lib/vim-flavor/env.rb
167
197
  - lib/vim-flavor/facade.rb
@@ -176,7 +206,6 @@ files:
176
206
  - lib/vim-flavor/versionconstraint.rb
177
207
  - spec/branchversion_spec.rb
178
208
  - spec/enumerableextension_spec.rb
179
- - spec/facade_spec.rb
180
209
  - spec/flavor_spec.rb
181
210
  - spec/flavorfile_spec.rb
182
211
  - spec/lockfile_spec.rb
@@ -196,9 +225,9 @@ require_paths:
196
225
  - lib
197
226
  required_ruby_version: !ruby/object:Gem::Requirement
198
227
  requirements:
199
- - - ">="
228
+ - - "~>"
200
229
  - !ruby/object:Gem::Version
201
- version: '0'
230
+ version: '2.5'
202
231
  required_rubygems_version: !ruby/object:Gem::Requirement
203
232
  requirements:
204
233
  - - ">="
@@ -206,13 +235,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
235
  version: '0'
207
236
  requirements: []
208
237
  rubyforge_project:
209
- rubygems_version: 2.4.5.1
238
+ rubygems_version: 2.7.3
210
239
  signing_key:
211
240
  specification_version: 4
212
241
  summary: A tool to manage your favorite Vim plugins
213
242
  test_files:
214
243
  - features/.nav
215
244
  - features/README.md
245
+ - features/backward_compatibilities/flavorfile.feature
246
+ - features/backward_compatibilities/lockfile.feature
216
247
  - features/branches/README.md
217
248
  - features/branches/changing_tracking_branches.feature
218
249
  - features/branches/detect_incompatible_declarations.feature
@@ -237,7 +268,6 @@ test_files:
237
268
  - features/resolve_dependencies/basics.feature
238
269
  - features/resolve_dependencies/upgrade_outdated_dependencies.feature
239
270
  - features/resolve_dependencies/version_conflict.feature
240
- - features/step_definitions/bootstrap_script_steps.rb
241
271
  - features/step_definitions/cli_steps.rb
242
272
  - features/step_definitions/dependency_steps.rb
243
273
  - features/step_definitions/directory_steps.rb
@@ -261,7 +291,6 @@ test_files:
261
291
  - features/version_tag_format.feature
262
292
  - spec/branchversion_spec.rb
263
293
  - spec/enumerableextension_spec.rb
264
- - spec/facade_spec.rb
265
294
  - spec/flavor_spec.rb
266
295
  - spec/flavorfile_spec.rb
267
296
  - spec/lockfile_spec.rb
@@ -1,6 +0,0 @@
1
- Then /^a bootstrap script (is|is not) created in "(.+)"$/ do |mode, v_vimfiles_path|
2
- p = expand(v_vimfiles_path).to_flavors_path.to_bootstrap_path
3
- steps %Q{
4
- Then a file named "#{p}" #{mode == 'is' ? 'should' : 'should not'} exist
5
- }
6
- end
@@ -1,57 +0,0 @@
1
- require 'fileutils'
2
- require 'spec_helper'
3
- require 'tmpdir'
4
-
5
- module Vim
6
- module Flavor
7
- describe Facade do
8
- describe '#create_vim_script_for_bootstrap' do
9
- around :each do |example|
10
- Dir.mktmpdir do |tmp_path|
11
- @tmp_path = tmp_path
12
- example.run
13
- end
14
- end
15
-
16
- it 'creates a bootstrap script to configure runtimepath for flavors' do
17
- flavors_path = @tmp_path.to_vimfiles_path.to_flavors_path
18
- Facade.new().create_vim_script_for_bootstrap(flavors_path)
19
-
20
- expect(File).to exist(flavors_path.to_bootstrap_path)
21
-
22
- _rtp = %x{
23
- for plugin_name in 'foo' 'bar' 'baz'
24
- do
25
- mkdir -p "#{flavors_path}/$plugin_name"
26
- done
27
- HOME='#{@tmp_path}' vim -u NONE -i NONE -n -N -e -s -c '
28
- set verbose=1
29
- let vimfiles_path = split(&runtimepath, ",")[0]
30
- runtime flavors/bootstrap.vim
31
- for path in split(&runtimepath, ",")
32
- if stridx(path, vimfiles_path) == 0
33
- echo substitute(path, vimfiles_path, "!", "")
34
- endif
35
- endfor
36
- qall!
37
- ' 2>&1
38
- }
39
- rtps =
40
- _rtp.
41
- split(/[\r\n]/).
42
- select {|p| p != ''}
43
- expect(rtps).to be == [
44
- '!',
45
- '!/flavors/bar',
46
- '!/flavors/baz',
47
- '!/flavors/foo',
48
- '!/flavors/foo/after',
49
- '!/flavors/baz/after',
50
- '!/flavors/bar/after',
51
- '!/after',
52
- ]
53
- end
54
- end
55
- end
56
- end
57
- end