vim-flavor 2.2.2 → 4.0.2

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 (68) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +12 -0
  3. data/.github/workflows/ci.yml +35 -0
  4. data/.gitmodules +2 -2
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +178 -0
  7. data/README.md +133 -45
  8. data/Rakefile +11 -0
  9. data/config/cucumber.yml +1 -0
  10. data/features/.nav +2 -1
  11. data/features/backward_compatibilities/flavorfile.feature +166 -0
  12. data/features/backward_compatibilities/lockfile.feature +22 -0
  13. data/features/branches/changing_tracking_branches.feature +0 -3
  14. data/features/branches/detect_incompatible_declarations.feature +0 -2
  15. data/features/branches/install.feature +0 -2
  16. data/features/branches/update.feature +0 -1
  17. data/features/caching/deployment.feature +1 -0
  18. data/features/flavorfile/README.md +1 -1
  19. data/features/flavorfile/comments.feature +0 -1
  20. data/features/flavorfile/groups.feature +0 -3
  21. data/features/flavorfile/repository_name.feature +2 -5
  22. data/features/flavorfile/version_constraint.feature +3 -7
  23. data/features/install_vim_flavor.md +6 -12
  24. data/features/news.md +1 -0
  25. data/features/philosophy.md +4 -4
  26. data/features/resolve_dependencies/README.md +4 -3
  27. data/features/resolve_dependencies/basics.feature +0 -4
  28. data/features/resolve_dependencies/upgrade_outdated_dependencies.feature +0 -2
  29. data/features/resolve_dependencies/version_conflict.feature +0 -2
  30. data/features/step_definitions/cli_steps.rb +6 -1
  31. data/features/step_definitions/dependency_steps.rb +2 -1
  32. data/features/step_definitions/directory_steps.rb +1 -1
  33. data/features/step_definitions/file_steps.rb +2 -2
  34. data/features/step_definitions/flavor_steps.rb +25 -9
  35. data/features/step_definitions/flavorfile_steps.rb +10 -1
  36. data/features/step_definitions/lockfile_steps.rb +14 -5
  37. data/features/support/env.rb +22 -12
  38. data/features/testing_vim_plugins/README.md +7 -6
  39. data/features/testing_vim_plugins/dependencies.feature +14 -15
  40. data/features/testing_vim_plugins/failures.feature +6 -6
  41. data/features/testing_vim_plugins/specifying_test_scripts.feature +12 -12
  42. data/features/testing_vim_plugins/typical_usage.feature +33 -10
  43. data/features/typical_usage/README.md +7 -7
  44. data/features/typical_usage/deploy_to_arbitrary_place.feature +0 -1
  45. data/features/typical_usage/install_vim_plugins.feature +0 -1
  46. data/features/typical_usage/uninstall_vim_plugins.feature +0 -1
  47. data/features/typical_usage/update_vim_plugins.feature +0 -3
  48. data/features/uninstall_vim_flavor.md +3 -4
  49. data/features/version_lock.feature +0 -1
  50. data/features/version_tag_format.feature +0 -4
  51. data/lib/vim-flavor/cli.rb +2 -2
  52. data/lib/vim-flavor/console.rb +22 -0
  53. data/lib/vim-flavor/env.rb +1 -1
  54. data/lib/vim-flavor/facade.rb +17 -48
  55. data/lib/vim-flavor/flavor.rb +1 -1
  56. data/lib/vim-flavor/flavorfile.rb +24 -1
  57. data/lib/vim-flavor/lockfile.rb +16 -1
  58. data/lib/vim-flavor/stringextension.rb +3 -11
  59. data/lib/vim-flavor/version.rb +1 -1
  60. data/lib/vim-flavor.rb +1 -1
  61. data/spec/branchversion_spec.rb +4 -4
  62. data/spec/stringextension_spec.rb +33 -2
  63. data/vim-flavor.gemspec +8 -5
  64. metadata +70 -26
  65. data/.travis.yml +0 -7
  66. data/features/news.md +0 -65
  67. data/features/step_definitions/bootstrap_script_steps.rb +0 -6
  68. 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: 75d0bb94ee0f8229e9d2500cdd40d17315585d4fe0d5fa70b3f3ae2fa2216dda
4
+ data.tar.gz: 02a54ee18922bb471666736b55b4bc783b9581b1ff35b94f5534ce9f91051a0b
5
5
  SHA512:
6
- metadata.gz: d9d6e2d307622a2a09d17e605b8308d3024a5e2a85406d9f0c3bbbcba3c18e8d385c05bf4bab46cbaf4dd93655b021dbe4df2bb56193c66c4d8f0d44a0780c73
7
- data.tar.gz: 26611b3e533b3a771b3e722b62dea4e67f8199039704a990cee311395403282ec4e345deb879a99a29bc914a17c8b3fbdea6025cdf5cf1804163f93900f70705
6
+ metadata.gz: 2ad9d76f9f2fc93b088cc2b8f9cecf5d351f027cead304e42adbd60d04ff567b4a767249f81b56c42e157fdf123ab3a280d37920efc4fa7e290790f2dbdf1187
7
+ data.tar.gz: 535d9dc0232e83c642afce3d6a608875738021ddbd12f113a64b7b4e99ed7fa3722f8772161bee025facaef3eeb42fb338fce9c9abb0fdb4255ced75ac94c2a6
@@ -0,0 +1,12 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
12
+ versioning-strategy: increase
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+ schedule:
9
+ - cron: 0 0 * * *
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ with:
17
+ fetch-depth: 0 # t/blame.vim requires all commits.
18
+ submodules: true
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
+ - name: Set up Vim
24
+ uses: thinca/action-setup-vim@v1
25
+ with:
26
+ vim_version: ${{ github.event_name == 'schedule' && 'head' || 'v8.2.3446' }}
27
+ vim_type: vim
28
+ download: never # For some reason 'available' doesn't build from source as a fallback.
29
+ - name: Set up Git
30
+ run: |
31
+ git config --global user.email 'ci@example.com'
32
+ git config --global user.name 'CI'
33
+ git config --global init.defaultBranch 'master'
34
+ - name: Run tests
35
+ run: rake ci
data/.gitmodules CHANGED
@@ -1,6 +1,6 @@
1
1
  [submodule "vendor/kana/vim-vspec"]
2
2
  path = vendor/kana/vim-vspec
3
- url = git://github.com/kana/vim-vspec
3
+ url = https://github.com/kana/vim-vspec
4
4
  [submodule "vendor/kana/vim-textobj-user"]
5
5
  path = vendor/kana/vim-textobj-user
6
- url = git://github.com/kana/vim-textobj-user
6
+ url = https://github.com/kana/vim-textobj-user
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,178 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+
9
+
10
+
11
+ ## [Unreleased](https://github.com/kana/vim-flavor/compare/v4.0.2...master)
12
+
13
+
14
+
15
+
16
+ ## [4.0.2](https://github.com/kana/vim-flavor/compare/v4.0.1...v4.0.2) - 2022-01-11
17
+
18
+ ### Fixed
19
+
20
+ * Remove deprecated usage of `.exists?` style methods ([#66](https://github.com/kana/vim-flavor/pull/66))
21
+
22
+
23
+
24
+
25
+ ## [4.0.1](https://github.com/kana/vim-flavor/compare/v4.0.0...v4.0.1) - 2021-11-02
26
+
27
+ ### Changed
28
+
29
+ * **BREAKING**: Use `https://github.com/...` instead of `git://github.com/...`
30
+ to clone Vim plugin repositories. This change is required because
31
+ [GitHub deprecates `git://`](https://github.blog/2021-09-01-improving-git-protocol-security-github/)
32
+ since 2021-11-02.
33
+
34
+ This is a breaking change if you installed Vim plugins with vim-flavor v4.0.0
35
+ or older. You'll see the following error in that case:
36
+
37
+ fatal: remote error:
38
+ The unauthenticated git protocol on port 9418 is no longer supported.
39
+
40
+ There are two ways to fix this errors:
41
+
42
+ (A) Delete local clones:
43
+
44
+ rm -rf ~/.vim-flavor
45
+
46
+ (B) Change `remote.origin.url` of each local clone:
47
+
48
+ for d in ~/.vim-flavor/repos/*/
49
+ do
50
+ cd "$d" &&
51
+ git config remote.origin.url "$(git config remote.origin.url | sed 's!^git://!https://!')"
52
+ done
53
+
54
+ ### Fixed
55
+
56
+ - Update some tests not to fail with `vX.X.X` style version tags.
57
+
58
+
59
+
60
+
61
+ ## [4.0.0](https://github.com/kana/vim-flavor/compare/v3.0.0...v4.0.0) - 2021-09-22
62
+
63
+ ### Changed
64
+
65
+ * **BREAKING**: Ruby 3.0 or later is required now.
66
+
67
+
68
+
69
+
70
+ ## [3.0.0](https://github.com/kana/vim-flavor/compare/v2.2.2...v3.0.0) - 2018-03-24
71
+
72
+ ### Improved
73
+
74
+ * Steps to start using vim-flavor are simplified. Especially, it is not
75
+ necessary to edit vimrc.
76
+
77
+ ### Changed
78
+
79
+ * **BREAKING**: Vim 8.0 or later is required now.
80
+ * **BREAKING**: Deployment format is changed. It might be necessary to
81
+ manually delete some directories and files. See also the follwoing migration
82
+ guide.
83
+ * The name of configuration file is changed.
84
+ * Old name is `VimFlavor`.
85
+ * New name is `Flavorfile`.
86
+ * Note that old name is still supported for backward compatibility. Old
87
+ name file is used if there is no new name file. But it is highly
88
+ recommended to rename.
89
+ * The name of lock file is changed.
90
+ * Old name is `VimFlavor.lock`.
91
+ * New name is `Flavorfile.lock`.
92
+ * To avoid unexpected result and confusion, vim-flavor stops its process as
93
+ soon as possible if old name lockfile exists.
94
+
95
+ ### Migration guide from version 2
96
+
97
+ * Delete `~/.vim/flavors` directory.
98
+ * Delete `runtime flavors/bootstrap.vim` line from your vimrc.
99
+ * In your dotfiles repository:
100
+ * Rename `VimFlavor` as `Flavorfile`.
101
+ * Rename `VimFlavor.lock` as `Flavorfile.lock`.
102
+ * If you use vim-flavor for Vim plugin development, do the following steps in
103
+ that Vim plugin repository:
104
+ * Update `Gemfile` to uses vim-flavor 3.0 or later,
105
+ e.g., `gem 'vim-flavor', '~> 3.0'`.
106
+ * Rename `VimFlavor` as `Flavorfile`.
107
+ * Delete `.vim-flavor` directory. It is used to stash runtime dependencies to
108
+ run tests for your Vim plugin.
109
+ * Note that you must not commit `Flavorfile.lock` for your Vim plugin. It
110
+ makes your plugin hard to use with other plugins.
111
+
112
+
113
+
114
+
115
+ ## [2.2.2](https://github.com/kana/vim-flavor/compare/v2.2.1...v2.2.2) - 2018-01-31
116
+
117
+ ### Fixed
118
+
119
+ * Fixed `install`, `update` and `test` to work even if these commands are
120
+ invoked from non-bash shell.
121
+
122
+
123
+
124
+
125
+ ## [2.2.1](https://github.com/kana/vim-flavor/compare/v2.2.0...v2.2.1) - 2015-04-24
126
+
127
+ ### Fixed
128
+
129
+ * Fixed not to fail fetching repositories which have non-fastforward updates.
130
+
131
+
132
+
133
+
134
+ ## [2.2.0](https://github.com/kana/vim-flavor/compare/v2.1.1...v2.2.0) - 2015-04-18
135
+
136
+ ### Improved
137
+
138
+ * `test` runs `*.vim` and `*.t` in a single step, to get a simplified result.
139
+ * `test` uses [vim-vspec](https://github.com/kana/vim-vspec) 1.5 or later by
140
+ default.
141
+ * `test` supports `--update-dependencies` to update dependencies before running
142
+ tests.
143
+
144
+
145
+
146
+
147
+ ## [2.1.1](https://github.com/kana/vim-flavor/compare/2.1.0...v2.1.1) - 2015-02-25
148
+
149
+ ### Improved
150
+
151
+ * `install` and `update` skip checking versions of plugins which are
152
+ development dependencies.
153
+
154
+
155
+
156
+
157
+ ## [2.1.0](https://github.com/kana/vim-flavor/compare/2.0.0...2.1.0) - 2014-04-19
158
+
159
+ ### Improved
160
+
161
+ * `update` command is added. It is an alias of existing `upgrade` command.
162
+ Now it is recommended to use `update` rather than `upgrade`.
163
+ `upgrade` will be removed in a future version.
164
+ * `update` and `upgrade` learned to update specific plugins if repository names
165
+ are given as command-line arguments.
166
+
167
+
168
+
169
+
170
+ ## [2.0.0](https://github.com/kana/vim-flavor/compare/1.1.5...2.0.0) - 2014-03-10
171
+
172
+ ### Improved
173
+
174
+ * [Branches](./branches) are supported.
175
+
176
+ ### Changed
177
+
178
+ * **BREAKING**: Ruby 2.0.0 or later is required now.
data/README.md CHANGED
@@ -1,76 +1,164 @@
1
1
  # vim-flavor, a tool to manage your favorite Vim plugins
2
2
 
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)
3
+ [![CI](https://github.com/kana/vim-flavor/actions/workflows/ci.yml/badge.svg)](https://github.com/kana/vim-flavor/actions/workflows/ci.yml)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/97414d95fb6d19c7fb72/maintainability)](https://codeclimate.com/github/kana/vim-flavor/maintainability)
5
5
 
6
6
 
7
7
 
8
8
 
9
- ## Getting started
9
+ # Getting started
10
10
 
11
- cd $YOUR_REPOSITORY_FOR_DOTFILES
11
+ ## Create `Flavorfile`
12
12
 
13
- cat >VimFlavor <<'END'
14
- # * Declare using git://github.com/kana/vim-textobj-indent.git
15
- # * vim-flavor fetches git://github.com/$USER/$REPO.git
16
- # if the argument is written in '$USER/$REPO' format.
17
- # * kana/vim-textobj-indent requires kana/vim-textobj-user.
18
- # Such dependencies are automatically installed
19
- # if the flavored plugin declares its dependencies with VimFlavor file.
20
- flavor 'kana/vim-textobj-indent'
13
+ This file contains a set of declarations about what Vim plugins you want to
14
+ install. For example:
21
15
 
22
- # * Declare using git://github.com/vim-scripts/fakeclip.git
23
- # * vim-flavor fetches git://github.com/vim-scripts/$REPO.git
24
- # if the argument is written in '$REPO' format.
25
- flavor 'fakeclip'
16
+ ```ruby
17
+ # Install a Vim plugin from `https://github.com/kana/vim-textobj-indent`.
18
+ #
19
+ # Note that kana/vim-textobj-indent requires kana/vim-textobj-user.
20
+ # Such dependencies are automatically installed if the former plugin
21
+ # declares its dependencies with Flavorfile.
22
+ flavor 'kana/vim-textobj-indent'
26
23
 
27
- # * Declare using git://github.com/kana/vim-altr.git
28
- # * vim-flavor fetches the URI
29
- # if the argument seems to be a URI.
30
- flavor 'git://github.com/kana/vim-altr.git'
24
+ # Install a Vim plugin from `https://github.com/vim-scripts/fakeclip`.
25
+ flavor 'fakeclip'
31
26
 
32
- # * Declare using kana/vim-smartchr 0.1.0 or later and older than 0.2.0.
33
- flavor 'kana/vim-smartchr', '~> 0.1.0'
27
+ # Install a Vim plugin from the specified URI.
28
+ flavor 'https://github.com/kana/vim-altr.git'
34
29
 
35
- # * Declare using kana/vim-smartword 0.1 or later and older than 1.0.
36
- flavor 'kana/vim-smartword', '~> 0.1'
30
+ # You can also specify which version of Vim plugin should be installed.
31
+ # For example:
32
+ flavor 'kana/vim-smartword', '~> 0.1' # 0.1 or later, but older than 0.2
33
+ flavor 'kana/vim-smartchr', '~> 0.2.4' # 0.2.4 or later, but older than 0.3.0
34
+ flavor 'kana/vim-smarttill', '>= 0.3.6' # 0.3.6 or later
37
35
 
38
- # * Declare using kana/vim-smarttill 0.1.0 or later.
39
- flavor 'kana/vim-smarttill', '>= 0.1.0'
40
- END
36
+ # vim-flavor, by design, requires Vim plugins to follow semantic versioning
37
+ # and to create version tags (like `v1.2.3`) in their repositories.
38
+ #
39
+ # For repositories without versioning, branches can be specified.
40
+ flavor 'chriskempson/base16-vim', branch: 'master'
41
+ ```
41
42
 
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.
45
- vim-flavor install
43
+ ## Install Vim plugins (for the first time)
46
44
 
47
- # Add the following line into the first line of your vimrc:
48
- #
49
- # runtime flavors/bootstrap.vim
50
- vim vimrc
45
+ Run the following command:
51
46
 
52
- git add VimFlavor VimFlavor.lock vimrc
53
- git commit -m 'Use vim-flavor to manage my favorite Vim plugins'
47
+ ```bash
48
+ vim-flavor install
49
+ ```
54
50
 
55
- See also
56
- [the documentation on relish](https://www.relishapp.com/kana/vim-flavor) or
57
- `features/` directory for the details.
51
+ This command does the following stuffs:
58
52
 
53
+ 1. Fetches Vim plugins declared in the `Flavorfile`.
54
+ 2. Creates `Flavorfile.lock` file. It contains information about what
55
+ versions of plugins to be installed.
56
+ 3. Copies the fetched plugins into `~/.vim/pack/flavors/start`, then updates
57
+ help tags for each plugin.
59
58
 
59
+ It's recommended to commit `Flavorfile` and `Flavorfile.lock` after
60
+ installation.
60
61
 
62
+ ```bash
63
+ git add Flavorfile Flavorfile.lock
64
+ git commit -m 'Use vim-flavor to manage my favorite Vim plugins'
65
+ ```
61
66
 
62
- ## License
67
+ ## Install Vim plugins (from another machine)
68
+
69
+ Suppose that you work with several PCs and/or servers, and you want to use the
70
+ same configuration, including Vim plugins, on all of them.
71
+
72
+ Firstly, let's synchronize your configuration files:
73
+
74
+ ```bash
75
+ cd ~/your/dotfiles/repository
76
+ git pull
77
+ ```
78
+
79
+ Now you have the same `Flavorfile` and `Flavorfile.lock` created by the
80
+ previous step.
81
+
82
+ Then run the following command:
83
+
84
+ ```bash
85
+ vim-flavor install
86
+ ```
87
+
88
+ This time `vim-flavor` installs the same versions of Vim plugins as recorded
89
+ in `Flavorfile.lock`, even if newer versions are available.
90
+
91
+ ## Update Vim plugins
92
+
93
+ To update Vim plugins, run the following command:
94
+
95
+ ```bash
96
+ vim-flavor update
97
+ ```
98
+
99
+ This is similar to `vim-flavor install`, but vim-flavor tries checking and
100
+ installing newer versions of Vim plugins.
101
+
102
+ This command usually updates `Flavorfile.lock`. So that you have to commit it
103
+ again.
104
+
105
+ ```bash
106
+ git add Flavorfile.lock
107
+ git commit -m 'Update Vim plugins'
108
+ ```
109
+
110
+
111
+
112
+
113
+ # References
114
+
115
+ See [`features/`](./features) directory for the details.
116
+ The same [documents](https://www.relishapp.com/kana/vim-flavor) are available
117
+ also on relish.
118
+
119
+
120
+
121
+
122
+ # Changelog
123
+
124
+ See [CHANGELOG.md](./CHANGELOG.md).
125
+
126
+
127
+
128
+
129
+ # License
63
130
 
64
131
  vim-flavor is released under the terms of MIT license.
65
- See the LICENSE file for the details.
132
+ See the [LICENSE](./LICENSE) file for the details.
133
+
134
+
135
+
136
+
137
+ # Development
138
+
139
+ ## Set up
140
+
141
+ 1. Install [rbenv](https://github.com/rbenv/rbenv).
142
+ 2. Run the following commands in your clone of vim-flavor repository:
143
+
144
+ ```bash
145
+ git submodule update --init
146
+ rbenv install
147
+ bundle install
148
+ ```
149
+
150
+ ## Run tests
151
+
152
+ ```bash
153
+ rake test
154
+ ```
66
155
 
67
156
 
68
157
 
69
158
 
70
- ## Author
159
+ # Author
71
160
 
72
- * [Kana Natsuno](http://whileimautomaton.net/)
73
- (also known as [@kana1](http://twitter.com/kana1))
161
+ * [kana](https://github.com/kana)
74
162
 
75
163
 
76
164
 
data/Rakefile CHANGED
@@ -1,6 +1,12 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
3
 
4
+ task :ci => [:dump, :test]
5
+
6
+ task :dump do
7
+ sh 'vim --version'
8
+ end
9
+
4
10
  task :test => [:spec, :cucumber]
5
11
 
6
12
  task :spec do
@@ -10,3 +16,8 @@ end
10
16
  task :cucumber do
11
17
  sh 'bundle exec cucumber --format=progress'
12
18
  end
19
+
20
+ task :update_online_documents do
21
+ # Only authorized members can push to relish.
22
+ sh 'bundle exec relish push kana/vim-flavor'
23
+ end
@@ -0,0 +1 @@
1
+ default: --publish-quiet
data/features/.nav CHANGED
@@ -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 ... v?\d+\.\d+(\.\d+)?
107
+ Deploying plugins...
108
+ kana/vim-vspec v?\d+.\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 \(v?\d+.\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 ... v?\d+.\d+(\.\d+)?
153
+ Deploying plugins...
154
+ kana/vim-vspec v?\d+.\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 \(v?\d+.\d+(\.\d+)?\)
165
+ """
166
+ And a dependency "kana/vim-vspec" is stored in ".vim-flavor/pack/flavors/start"