vim-flavor 2.2.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 57987fa1860c780989f297c608ea591c25a68a46
4
- data.tar.gz: f904afbd518b37977d0f0be9cf1137dec88e0692
2
+ SHA256:
3
+ metadata.gz: c4a7e4092417600cbc0307de9313599a143deaca2418cd5ccb16e8959e678d04
4
+ data.tar.gz: d6f6aa114fdd8f2202436e548694c8e382776ddae31bc3a3f6b2a07b27e880db
5
5
  SHA512:
6
- metadata.gz: d9d6e2d307622a2a09d17e605b8308d3024a5e2a85406d9f0c3bbbcba3c18e8d385c05bf4bab46cbaf4dd93655b021dbe4df2bb56193c66c4d8f0d44a0780c73
7
- data.tar.gz: 26611b3e533b3a771b3e722b62dea4e67f8199039704a990cee311395403282ec4e345deb879a99a29bc914a17c8b3fbdea6025cdf5cf1804163f93900f70705
6
+ metadata.gz: 638033e0aec514a1586f29e5a758159177fd7931c0709344b8f5ba8a49ce436d8ab15180e2698096c37545caf09f2050bdbfba9d098fec5a7299b4b59e93d2de
7
+ data.tar.gz: 51a1d6dd6c932d9de194a2f9054bcaf2be0d5228c26e47715793fae8dbf5399acbd82722bae13677bdd44fffe35b2ba03d7b7b1089ca27097d62e8f54ba8b309
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.5
3
+ - 2.5.0
4
4
  before_script:
5
5
  - git config --global 'user.name' 'Travis CI'
6
6
  - git config --global 'user.email' 'user@example.com'
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # vim-flavor, a tool to manage your favorite Vim plugins
2
2
 
3
3
  [![Build Status](https://travis-ci.org/kana/vim-flavor.png)](https://travis-ci.org/kana/vim-flavor)
4
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/kana/vim-flavor)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/97414d95fb6d19c7fb72/maintainability)](https://codeclimate.com/github/kana/vim-flavor/maintainability)
5
5
 
6
6
 
7
7
 
@@ -10,13 +10,13 @@
10
10
 
11
11
  cd $YOUR_REPOSITORY_FOR_DOTFILES
12
12
 
13
- cat >VimFlavor <<'END'
13
+ cat >Flavorfile <<'END'
14
14
  # * Declare using git://github.com/kana/vim-textobj-indent.git
15
15
  # * vim-flavor fetches git://github.com/$USER/$REPO.git
16
16
  # if the argument is written in '$USER/$REPO' format.
17
17
  # * kana/vim-textobj-indent requires kana/vim-textobj-user.
18
18
  # Such dependencies are automatically installed
19
- # if the flavored plugin declares its dependencies with VimFlavor file.
19
+ # if the flavored plugin declares its dependencies with Flavorfile.
20
20
  flavor 'kana/vim-textobj-indent'
21
21
 
22
22
  # * Declare using git://github.com/vim-scripts/fakeclip.git
@@ -39,17 +39,12 @@
39
39
  flavor 'kana/vim-smarttill', '>= 0.1.0'
40
40
  END
41
41
 
42
- # Fetch the plugins declared in the VimFlavor,
43
- # create VimFlavor.lock for a snapshot of all plugins and versions,
44
- # then install the plugins and a bootstrap script into ~/.vim etc.
42
+ # Fetch the plugins declared in the Flavorfile,
43
+ # create Flavorfile.lock for a snapshot of all plugins and versions,
44
+ # then install the plugins into ~/.vim.
45
45
  vim-flavor install
46
46
 
47
- # Add the following line into the first line of your vimrc:
48
- #
49
- # runtime flavors/bootstrap.vim
50
- vim vimrc
51
-
52
- git add VimFlavor VimFlavor.lock vimrc
47
+ git add Flavorfile Flavorfile.lock
53
48
  git commit -m 'Use vim-flavor to manage my favorite Vim plugins'
54
49
 
55
50
  See also
@@ -69,8 +64,8 @@ See the LICENSE file for the details.
69
64
 
70
65
  ## Author
71
66
 
72
- * [Kana Natsuno](http://whileimautomaton.net/)
73
- (also known as [@kana1](http://twitter.com/kana1))
67
+ * [Kana Natsuno](https://whileimautomaton.net/)
68
+ (also known as [@kana1](https://twitter.com/kana1))
74
69
 
75
70
 
76
71
 
@@ -11,7 +11,7 @@
11
11
  - flavorfile:
12
12
  - version_lock.feature
13
13
  - caching:
14
- - resolve_dependencies.feature
14
+ - resolve_dependencies:
15
15
  - testing_vim_plugins:
16
16
  - typical_usage.feature
17
17
  - dependencies.feature
@@ -23,3 +23,4 @@
23
23
  - update.feature
24
24
  - changing_tracking_branches.feature
25
25
  - detect_incompatible_declarations.feature
26
+ - backward_compatibilities:
@@ -0,0 +1,166 @@
1
+ Feature: Flavorfile
2
+ In order to gradually update existing Vim plugins,
3
+ as a lazy Vim user,
4
+ I want to reuse Vim plugins which contain old name of flavorfiles without problems.
5
+
6
+ Scenario: User has old name of flavorfile is warned
7
+ Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
8
+ And an old name flavorfile with:
9
+ """ruby
10
+ flavor '$foo_uri'
11
+ """
12
+ When I run `vim-flavor install`
13
+ Then it should pass with template:
14
+ """
15
+ Warning: Rename VimFlavor to Flavorfile. VimFlavor wll be ignored in future version.
16
+ Checking versions...
17
+ Use $foo_uri ... 1.0.2
18
+ Deploying plugins...
19
+ $foo_uri 1.0.2 ... done
20
+ Completed.
21
+ """
22
+ And a lockfile is created with:
23
+ """
24
+ $foo_uri (1.0.2)
25
+ """
26
+ And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
27
+
28
+ Scenario: User has both new and old name of flavorfile is warned
29
+ Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
30
+ And a repository "bar" with versions "2.0.0 2.0.1 2.0.2"
31
+ And a flavorfile with:
32
+ """ruby
33
+ flavor '$bar_uri'
34
+ """
35
+ And an old name flavorfile with:
36
+ """ruby
37
+ flavor '$foo_uri'
38
+ """
39
+ When I run `vim-flavor install`
40
+ Then it should pass with template:
41
+ """
42
+ Warning: Delete VimFlavor. Flavorfile is being read instead.
43
+ Checking versions...
44
+ Use $bar_uri ... 2.0.2
45
+ Deploying plugins...
46
+ $bar_uri 2.0.2 ... done
47
+ Completed.
48
+ """
49
+ And a lockfile is created with:
50
+ """
51
+ $bar_uri (2.0.2)
52
+ """
53
+ And a flavor "$foo_uri" is not deployed to "$home/.vim"
54
+ And a flavor "$bar_uri" version "2.0.2" is deployed to "$home/.vim"
55
+
56
+ Scenario: Plugin contains old name of flavorfile is not warned
57
+ Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2" and an old name flavorfile:
58
+ """ruby
59
+ # No dependencies
60
+ """
61
+ And a flavorfile with:
62
+ """ruby
63
+ flavor '$foo_uri'
64
+ """
65
+ When I run `vim-flavor install`
66
+ Then it should pass with template:
67
+ """
68
+ Checking versions...
69
+ Use $foo_uri ... 1.0.2
70
+ Deploying plugins...
71
+ $foo_uri 1.0.2 ... done
72
+ Completed.
73
+ """
74
+ And a lockfile is created with:
75
+ """
76
+ $foo_uri (1.0.2)
77
+ """
78
+ And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
79
+
80
+ Scenario: Testing a Vim plugin with old name flavorfile is warned
81
+ Given a repository "kana/vim-vspec" from offline cache
82
+ And an old name flavorfile with:
83
+ """ruby
84
+ # No dependencies
85
+ """
86
+ And a file named "plugin/foo.vim" with:
87
+ """vim
88
+ let g:foo = 3
89
+ """
90
+ And a file named "t/basics.vim" with:
91
+ """vim
92
+ " Tests are written with vim-vspec.
93
+ runtime! plugin/foo.vim
94
+ describe 'g:foo'
95
+ it 'is equal to 3'
96
+ Expect g:foo == 3
97
+ end
98
+ end
99
+ """
100
+ When I run `vim-flavor test`
101
+ Then it should pass with regexp:
102
+ """
103
+ -------- Preparing dependencies
104
+ Warning: Rename VimFlavor to Flavorfile. VimFlavor wll be ignored in future version.
105
+ Checking versions...
106
+ Use kana/vim-vspec ... 1\.\d+(\.\d+)?
107
+ Deploying plugins...
108
+ kana/vim-vspec 1\.\d+(\.\d+)? ... done
109
+ Completed.
110
+ -------- Testing a Vim plugin
111
+ t/basics.vim .. ok
112
+ All tests successful.
113
+ Files=1, Tests=1, \d+ wallclock secs .*
114
+ Result: PASS
115
+ """
116
+ And a lockfile is created and matches with:
117
+ """
118
+ kana/vim-vspec \(1\.\d+(\.\d+)?\)
119
+ """
120
+ And a dependency "kana/vim-vspec" is stored in ".vim-flavor/pack/flavors/start"
121
+
122
+ Scenario: Testing a Vim plugin with both new and old name flavorfile is warned
123
+ Given a repository "kana/vim-vspec" from offline cache
124
+ And a flavorfile with:
125
+ """ruby
126
+ # No dependencies
127
+ """
128
+ And an old name flavorfile with:
129
+ """ruby
130
+ # No dependencies
131
+ """
132
+ And a file named "plugin/foo.vim" with:
133
+ """vim
134
+ let g:foo = 3
135
+ """
136
+ And a file named "t/basics.vim" with:
137
+ """vim
138
+ " Tests are written with vim-vspec.
139
+ runtime! plugin/foo.vim
140
+ describe 'g:foo'
141
+ it 'is equal to 3'
142
+ Expect g:foo == 3
143
+ end
144
+ end
145
+ """
146
+ When I run `vim-flavor test`
147
+ Then it should pass with regexp:
148
+ """
149
+ -------- Preparing dependencies
150
+ Warning: Delete VimFlavor. Flavorfile is being read instead.
151
+ Checking versions...
152
+ Use kana/vim-vspec ... 1\.\d+(\.\d+)?
153
+ Deploying plugins...
154
+ kana/vim-vspec 1\.\d+(\.\d+)? ... done
155
+ Completed.
156
+ -------- Testing a Vim plugin
157
+ t/basics.vim .. ok
158
+ All tests successful.
159
+ Files=1, Tests=1, \d+ wallclock secs .*
160
+ Result: PASS
161
+ """
162
+ And a lockfile is created and matches with:
163
+ """
164
+ kana/vim-vspec \(1\.\d+(\.\d+)?\)
165
+ """
166
+ And a dependency "kana/vim-vspec" is stored in ".vim-flavor/pack/flavors/start"
@@ -0,0 +1,22 @@
1
+ Feature: Lockfile
2
+ In order to avoid unexpected result and confusion,
3
+ as a lazy Vim user,
4
+ I want to stop vim-flavor process if obsolete file still exists.
5
+
6
+ Scenario: User has old name of lockfile
7
+ Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
8
+ And a flavorfile with:
9
+ """ruby
10
+ flavor '$foo_uri'
11
+ """
12
+ And an old name lockfile with:
13
+ """
14
+ $foo_uri (1.0.1)
15
+ """
16
+ When I run `vim-flavor install`
17
+ Then it should fail with template:
18
+ """
19
+ Error: VimFlavor.lock is no longer used. Rename it to Flavorfile.lock.
20
+ """
21
+ And a lockfile is not created
22
+ And a flavor "$foo_uri" is not deployed to "$home/.vim"
@@ -24,7 +24,6 @@ Feature: Changing tracking branches
24
24
  $foo_uri $foo_rev_102 at master ... done
25
25
  Completed.
26
26
  """
27
- And a bootstrap script is created in "$home/.vim"
28
27
  And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
29
28
 
30
29
  Scenario: Use a branch instead of a version
@@ -49,7 +48,6 @@ Feature: Changing tracking branches
49
48
  """
50
49
  $foo_uri ($foo_rev_102 at master)
51
50
  """
52
- And a bootstrap script is created in "$home/.vim"
53
51
  And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
54
52
 
55
53
  Scenario: Use a version instead of a branch
@@ -74,5 +72,4 @@ Feature: Changing tracking branches
74
72
  """
75
73
  $foo_uri (1.0.2)
76
74
  """
77
- And a bootstrap script is created in "$home/.vim"
78
75
  And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
@@ -32,7 +32,6 @@ Feature: Detect incompatible declarations
32
32
  $L_uri branch: experimental is required by $B_uri
33
33
  Please resolve the conflict.
34
34
  """
35
- And a bootstrap script is not created in "$home/.vim"
36
35
  And a flavor "$A_uri" is not deployed to "$home/.vim"
37
36
  And a flavor "$B_uri" is not deployed to "$home/.vim"
38
37
  And a flavor "$L_uri" is not deployed to "$home/.vim"
@@ -66,7 +65,6 @@ Feature: Detect incompatible declarations
66
65
  $L_uri ~> 0.2 is required by $B_uri
67
66
  Please resolve the conflict.
68
67
  """
69
- And a bootstrap script is not created in "$home/.vim"
70
68
  And a flavor "$A_uri" is not deployed to "$home/.vim"
71
69
  And a flavor "$B_uri" is not deployed to "$home/.vim"
72
70
  And a flavor "$L_uri" is not deployed to "$home/.vim"
@@ -24,7 +24,6 @@ Feature: Install Vim plugins with specific branches
24
24
  """
25
25
  $foo_uri ($foo_rev_102 at master)
26
26
  """
27
- And a bootstrap script is created in "$home/.vim"
28
27
  And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
29
28
 
30
29
  Scenario: Install a plugin according to a lockfile
@@ -47,5 +46,4 @@ Feature: Install Vim plugins with specific branches
47
46
  $foo_uri $foo_rev_102 at master ... skipped (already deployed)
48
47
  Completed.
49
48
  """
50
- And a bootstrap script is created in "$home/.vim"
51
49
  And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
@@ -26,5 +26,4 @@ Feature: Update Vim plugins with specific branches
26
26
  $foo_uri $foo_rev_103 at master ... done
27
27
  Completed.
28
28
  """
29
- And a bootstrap script is created in "$home/.vim"
30
29
  And a flavor "$foo_uri" version "1.0.3" is deployed to "$home/.vim"
@@ -9,6 +9,7 @@ Feature: Deployment
9
9
  """ruby
10
10
  flavor '$foo_uri', '~> 1.0'
11
11
  """
12
+
12
13
  Scenario: Deploy plugins which are not deployed yet
13
14
  Given a flavor "$foo_uri" is not deployed to "$home/.vim"
14
15
  When I run `vim-flavor install`
@@ -1,6 +1,6 @@
1
1
  Flavorfile is a DSL to declare which versions of Vim plugins to use.
2
2
  Whenever `vim-flavor` is invoked to manage Vim plugins,
3
- `vim-flavor` reads a file `VimFlavor` in the current working directory,
3
+ `vim-flavor` reads a file `Flavorfile` in the current working directory,
4
4
  and evaluates it as a flavorfile.
5
5
 
6
6
 
@@ -19,5 +19,4 @@ Feature: Comments
19
19
  And a lockfile is created with:
20
20
  """
21
21
  """
22
- And a bootstrap script is created in "$home/.vim"
23
22
  But a flavor "$foo_uri" is not deployed to "$home/.vim"
@@ -19,7 +19,6 @@ Feature: Groups
19
19
  """
20
20
  $foo_uri (1.2)
21
21
  """
22
- And a bootstrap script is created in "$home/.vim"
23
22
  And a flavor "$foo_uri" version "1.2" is deployed to "$home/.vim"
24
23
  But a flavor "$bar_uri" is not deployed to "$home/.vim"
25
24
 
@@ -35,7 +34,6 @@ Feature: Groups
35
34
  """
36
35
  $foo_uri (1.2)
37
36
  """
38
- And a bootstrap script is created in "$home/.vim"
39
37
  And a flavor "$foo_uri" version "1.2" is deployed to "$home/.vim"
40
38
  But a flavor "$bar_uri" is not deployed to "$home/.vim"
41
39
 
@@ -52,6 +50,5 @@ Feature: Groups
52
50
  And a lockfile is created with:
53
51
  """
54
52
  """
55
- And a bootstrap script is created in "$home/.vim"
56
53
  But a flavor "$foo_uri" is not deployed to "$home/.vim"
57
54
  But a flavor "$bar_uri" is not deployed to "$home/.vim"
@@ -16,7 +16,6 @@ Feature: Repository name
16
16
  """
17
17
  vspec (0.0.4)
18
18
  """
19
- And a bootstrap script is created in "$home/.vim"
20
19
  And a flavor "vspec" version "0.0.4" is deployed to "$home/.vim"
21
20
 
22
21
  Scenario: Declare using a Vim plugin from GitHub
@@ -32,7 +31,6 @@ Feature: Repository name
32
31
  """
33
32
  kana/vim-vspec (0.0.4)
34
33
  """
35
- And a bootstrap script is created in "$home/.vim"
36
34
  And a flavor "kana/vim-vspec" version "0.0.4" is deployed to "$home/.vim"
37
35
 
38
36
  Scenario: Declare using a Vim plugin from an arbitrary URI
@@ -48,5 +46,4 @@ Feature: Repository name
48
46
  """
49
47
  $vspec_uri (0.0.4)
50
48
  """
51
- And a bootstrap script is created in "$home/.vim"
52
49
  And a flavor "$vspec_uri" version "0.0.4" is deployed to "$home/.vim"
@@ -3,10 +3,9 @@ Feature: Version constraint
3
3
  as a lazy Vim user,
4
4
  I want to declare desirable versions of Vim plugins.
5
5
 
6
- Note that vim-flavor assumes that plugins follow [the versioning policies of
7
- RubyGems](http://docs.rubygems.org/read/chapter/7#page26), to determine
8
- compatibility of plugins. See also [Philosophy](../philosophy) for the
9
- details.
6
+ Note that vim-flavor assumes that plugins follow [Semantic Versioning
7
+ 2.0.0](https://semver.org/spec/v2.0.0.html), to determine compatibility of
8
+ plugins. See also [Philosophy](../philosophy) for the details.
10
9
 
11
10
  Background:
12
11
  Given a repository "foo" with versions "1.0 1.1 1.2 2.0"
@@ -22,7 +21,6 @@ Feature: Version constraint
22
21
  """
23
22
  $foo_uri (2.0)
24
23
  """
25
- And a bootstrap script is created in "$home/.vim"
26
24
  And a flavor "$foo_uri" version "2.0" is deployed to "$home/.vim"
27
25
 
28
26
  Scenario: Declare using a Vim plugin not older than a specific version
@@ -36,7 +34,6 @@ Feature: Version constraint
36
34
  """
37
35
  $foo_uri (2.0)
38
36
  """
39
- And a bootstrap script is created in "$home/.vim"
40
37
  And a flavor "$foo_uri" version "2.0" is deployed to "$home/.vim"
41
38
 
42
39
  Scenario: Declare using the latest and compatible version of a Vim plugin
@@ -50,5 +47,4 @@ Feature: Version constraint
50
47
  """
51
48
  $foo_uri (1.2)
52
49
  """
53
- And a bootstrap script is created in "$home/.vim"
54
50
  And a flavor "$foo_uri" version "1.2" is deployed to "$home/.vim"