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,10 +1,10 @@
1
1
  ## Required softwares
2
2
 
3
- * [Git](http://git-scm.com/) 1.7.9 or later
4
- * [Ruby](http://www.ruby-lang.org/) 2.0.0 or later
5
- * Recommendation: Use [RVM](http://beginrescueend.com/) or other tools
3
+ * [Git](https://git-scm.com/) 2.10.1 or later
4
+ * [Ruby](https://www.ruby-lang.org/) 2.5.0 or later
5
+ * Recommendation: Use [RVM](https://rvm.io/) or other tools
6
6
  for ease of installation across different envinronments.
7
- * [Vim](http://www.vim.org/) 7.3 or later
7
+ * [Vim](https://www.vim.org/) 8.0 or later
8
8
  * Note that Vim should be compiled as normal, big or huge version
9
9
  to use most of plugins.
10
10
 
@@ -26,14 +26,8 @@
26
26
 
27
27
  cd $YOUR_REPOSITORY_FOR_DOTFILES
28
28
 
29
- # Add the following line into the first line of your vimrc:
30
- #
31
- # runtime flavors/bootstrap.vim
32
- vim vimrc
33
-
34
- touch VimFlavor VimFlavor.lock
35
-
36
- git add VimFlavor VimFlavor.lock vimrc
29
+ touch Flavorfile Flavorfile.lock
30
+ git add Flavorfile Flavorfile.lock
37
31
  git commit -m 'Use vim-flavor to manage my favorite Vim plugins'
38
32
 
39
33
 
@@ -1,3 +1,47 @@
1
+ ## vim-flavor 3.0.0
2
+
3
+ ### Enhancements
4
+
5
+ * Steps to start using vim-flavor are simplified. Especially, it is not
6
+ necessary to edit vimrc.
7
+
8
+ ### Incompatible changes
9
+
10
+ * Vim 8.0 or later is required now.
11
+ * Deployment format is changed. It might be necessary to manually delete some
12
+ directories and files. See also the follwoing migration guide.
13
+ * The name of configuration file is changed.
14
+ * Old name is `VimFlavor`.
15
+ * New name is `Flavorfile`.
16
+ * Note that old name is still supported for backward compatibility. Old
17
+ name file is used if there is no new name file. But it is highly
18
+ recommended to rename.
19
+ * The name of lock file is changed.
20
+ * Old name is `VimFlavor.lock`.
21
+ * New name is `Flavorfile.lock`.
22
+ * To avoid unexpected result and confusion, vim-flavor stops its process as
23
+ soon as possible if old name lockfile exists.
24
+
25
+ ### Migration guide from version 2
26
+
27
+ * Delete `~/.vim/flavors` directory.
28
+ * Delete `runtime flavors/bootstrap.vim` line from your vimrc.
29
+ * In your dotfiles repository:
30
+ * Rename `VimFlavor` as `Flavorfile`.
31
+ * Rename `VimFlavor.lock` as `Flavorfile.lock`.
32
+ * If you use vim-flavor for Vim plugin development, do the following steps in
33
+ that Vim plugin repository:
34
+ * Update `Gemfile` to uses vim-flavor 3.0 or later,
35
+ e.g., `gem 'vim-flavor', '~> 3.0'`.
36
+ * Rename `VimFlavor` as `Flavorfile`.
37
+ * Delete `.vim-flavor` directory. It is used to stash runtime dependencies to
38
+ run tests for your Vim plugin.
39
+ * Note that you must not commit `Flavorfile.lock` for your Vim plugin. It
40
+ makes your plugin hard to use with other plugins.
41
+
42
+
43
+
44
+
1
45
  ## vim-flavor 2.2.2
2
46
 
3
47
  ### Bug Fixes
@@ -8,11 +8,11 @@ vim-flavor can install plugins which meet the following conditions:
8
8
  This is an intentional design. Because:
9
9
  * [vim-scripts.org](http://vim-scripts.org/) provides
10
10
  [comprehensive Git mirrors](https://github.com/vim-scripts) for
11
- [plugins uploaded to www.vim.org](http://www.vim.org/scripts/index.php).
11
+ [plugins uploaded to www.vim.org](https://www.vim.org/scripts/index.php).
12
12
  * Experimental plugins which are not uploaded to www.vim.org
13
13
  are usually found in [GitHub](https://github.com/).
14
- * Plugins must follow [the versioning policies of
15
- RubyGems](http://docs.rubygems.org/read/chapter/7#page26) and have "version"
14
+ * Plugins must follow [Semantic Versioning
15
+ 2.0.0](https://semver.org/spec/v2.0.0.html) and have "version"
16
16
  tags in their repositories. For example, if there is the version 1.2.3 of
17
17
  a plugin, its repository must have the tag `1.2.3`, and the files of the
18
18
  version 1.2.3 can be checked out via the tag `1.2.3`. In other words,
@@ -35,7 +35,7 @@ vim-flavor can install plugins which meet the following conditions:
35
35
  * Git mirrors by vim-scripts.org have proper directory structures even if
36
36
  the original plugins are uploaded to www.vim.org without proper directory
37
37
  structures. (A good example is
38
- [a.vim](http://www.vim.org/scripts/script.php?script_id=31) and
38
+ [a.vim](https://www.vim.org/scripts/script.php?script_id=31) and
39
39
  [its mirror](https://github.com/vim-scripts/a.vim).)
40
40
  * Other Git repositories might not have proper directory structures.
41
41
  Such plugins are not ready to use for everyone.
@@ -14,12 +14,13 @@ overlooked.
14
14
 
15
15
  So that `vim-flavor` automatically resolves dependencies of Vim plugins. If
16
16
  a plugin declares its dependencies as a [flavorfile](flavorfile) and saves it
17
- as `VimFlavor`, `vim-flavor` reads the file and automatically installs
17
+ as `Flavorfile`, `vim-flavor` reads the file and automatically installs
18
18
  dependencies according to the file.
19
19
 
20
20
  `vim-flavor` also takes care about versions of Vim plugins. If two plugins
21
- require the same plugin but required versions are not compatible to others,
22
- installation will be stopped to avoid using Vim with a broken configuration.
21
+ require the same plugin but required versions are not compatible to each
22
+ other, installation will be stopped to avoid using Vim with a broken
23
+ configuration.
23
24
 
24
25
 
25
26
 
@@ -34,7 +34,6 @@ Feature: Resolve dependencies of Vim plugins
34
34
  $foo_uri (1.1)
35
35
  $qux_uri (2.1)
36
36
  """
37
- And a bootstrap script is created in "$home/.vim"
38
37
  And a flavor "$foo_uri" version "1.1" is deployed to "$home/.vim"
39
38
  And a flavor "$bar_uri" version "2.1" is deployed to "$home/.vim"
40
39
  And a flavor "$qux_uri" version "2.1" is deployed to "$home/.vim"
@@ -72,7 +71,6 @@ Feature: Resolve dependencies of Vim plugins
72
71
  $foo_uri (1.1)
73
72
  $qux_uri (1.1)
74
73
  """
75
- And a bootstrap script is created in "$home/.vim"
76
74
  And a flavor "$foo_uri" version "1.1" is deployed to "$home/.vim"
77
75
  And a flavor "$bar_uri" version "2.1" is deployed to "$home/.vim"
78
76
  And a flavor "$qux_uri" version "1.1" is deployed to "$home/.vim"
@@ -112,7 +110,6 @@ Feature: Resolve dependencies of Vim plugins
112
110
  $foo_uri (2.1)
113
111
  $qux_uri (2.1)
114
112
  """
115
- And a bootstrap script is created in "$home/.vim"
116
113
  And a flavor "$foo_uri" version "2.1" is deployed to "$home/.vim"
117
114
  And a flavor "$bar_uri" version "2.1" is deployed to "$home/.vim"
118
115
  And a flavor "$qux_uri" version "2.1" is deployed to "$home/.vim"
@@ -145,6 +142,5 @@ Feature: Resolve dependencies of Vim plugins
145
142
  $bar_uri (2.1)
146
143
  $foo_uri (2.1)
147
144
  """
148
- And a bootstrap script is created in "$home/.vim"
149
145
  And a flavor "$foo_uri" version "2.1" is deployed to "$home/.vim"
150
146
  And a flavor "$bar_uri" version "2.1" is deployed to "$home/.vim"
@@ -40,7 +40,6 @@ Feature: Update outdated dependencies of Vim plugins
40
40
  $B_uri (0.0)
41
41
  $L_uri (0.4)
42
42
  """
43
- And a bootstrap script is created in "$home/.vim"
44
43
  And a flavor "$A_uri" version "0.0" is deployed to "$home/.vim"
45
44
  And a flavor "$B_uri" version "0.0" is deployed to "$home/.vim"
46
45
  And a flavor "$L_uri" version "0.4" is deployed to "$home/.vim"
@@ -81,7 +80,6 @@ Feature: Update outdated dependencies of Vim plugins
81
80
  $L_uri (0.5)
82
81
  $X_uri (0.0)
83
82
  """
84
- And a bootstrap script is created in "$home/.vim"
85
83
  And a flavor "$A_uri" version "0.0" is deployed to "$home/.vim"
86
84
  And a flavor "$B_uri" version "0.0" is deployed to "$home/.vim"
87
85
  And a flavor "$L_uri" version "0.5" is deployed to "$home/.vim"
@@ -31,7 +31,6 @@ Feature: Version conflict
31
31
  $foo_uri ~> 2.0 is required by $qux_uri
32
32
  Please resolve the conflict.
33
33
  """
34
- And a bootstrap script is not created in "$home/.vim"
35
34
  And a flavor "$foo_uri" is not deployed to "$home/.vim"
36
35
  And a flavor "$bar_uri" is not deployed to "$home/.vim"
37
36
  And a flavor "$qux_uri" is not deployed to "$home/.vim"
@@ -59,6 +58,5 @@ Feature: Version conflict
59
58
  $foo_uri >= 2.0 is required by you
60
59
  Please resolve the conflict.
61
60
  """
62
- And a bootstrap script is not created in "$home/.vim"
63
61
  And a flavor "$foo_uri" is not deployed to "$home/.vim"
64
62
  And a flavor "$bar_uri" is not deployed to "$home/.vim"
@@ -7,7 +7,12 @@ Then 'it should pass' do
7
7
  end
8
8
 
9
9
  Then /^it should (pass|fail) with template:$/ do |pass_fail, template|
10
- self.__send__("assert_#{pass_fail}ing_with", expand(template))
10
+ expect(last_command_started).to have_output(an_output_string_including(expand(template)))
11
+ if pass_fail == 'pass'
12
+ expect(last_command_started).to be_successfully_executed
13
+ else
14
+ expect(last_command_started).not_to be_successfully_executed
15
+ end
11
16
  end
12
17
 
13
18
  When /^I run `(.*)` \(variables expanded\)$/ do |command|
@@ -1,5 +1,6 @@
1
1
  Then /^a dependency "(.*)" is stored in "(.*)"$/ do |repo_name, deps_path|
2
+ cache_path = "#{deps_path}/#{repo_name.zap}"
2
3
  steps %Q{
3
- Then a directory named "#{deps_path}/#{repo_name.zap}" should exist
4
+ Then a directory named "#{path_for_step(cache_path)}" should exist
4
5
  }
5
6
  end
@@ -1,5 +1,5 @@
1
1
  When /^I delete the directory "([^"]*)"$/ do |dir_name|
2
- in_current_dir do
2
+ cd('.') do
3
3
  # FileUtils#rmdir cannot delete non-empty directories.
4
4
  # TODO: Use aruba's "I remove the directory" step.
5
5
  # Currently its implementation cannot delete git repositories.
@@ -1,9 +1,9 @@
1
1
  Given /^an executable file named "(.*)" with:$/ do |file_path, content|
2
2
  steps %Q{
3
- Given a file named "#{file_path}" with:
3
+ Given a file named "#{path_for_step(file_path)}" with:
4
4
  """
5
5
  #{content}
6
6
  """
7
7
  }
8
- File.chmod(0755, File.join([current_dir, file_path]))
8
+ File.chmod(0755, File.join([expand_path('.'), file_path]))
9
9
  end
@@ -18,7 +18,11 @@ Given /^the repository "([^"]*)" has versions "([^"]*)"$/ do |basename, versions
18
18
  end
19
19
 
20
20
  Given /^the repository "([^"]*)" has versions "([^"]*)" and a flavorfile:$/ do |basename, versions, flavorfile_content|
21
- add_new_versions_to_repo(basename, versions, flavorfile_content)
21
+ add_new_versions_to_repo(basename, versions, flavorfile_content, :new)
22
+ end
23
+
24
+ Given /^the repository "([^"]*)" has versions "([^"]*)" and an old name flavorfile:$/ do |basename, versions, flavorfile_content|
25
+ add_new_versions_to_repo(basename, versions, flavorfile_content, :old)
22
26
  end
23
27
 
24
28
  Given /^a (?:(?:GitHub|local) )?repository "([^"]*)" with versions "([^"]*)"$/ do |basename, versions|
@@ -38,6 +42,16 @@ Given /^a (?:(?:GitHub|local) )?repository "([^"]*)" with versions "([^"]*)" and
38
42
  }
39
43
  end
40
44
 
45
+ Given /^a (?:(?:GitHub|local) )?repository "([^"]*)" with versions "([^"]*)" and an old name flavorfile:$/ do |basename, versions, flavorfile_content|
46
+ steps %Q{
47
+ Given a repository "#{basename}"
48
+ And the repository "#{basename}" has versions "#{versions}" and an old name flavorfile:
49
+ """
50
+ #{flavorfile_content}
51
+ """
52
+ }
53
+ end
54
+
41
55
  Given /^"([^"]*)" version "([^"]*)" is released$/ do |basename, version|
42
56
  steps %Q{
43
57
  Given the repository "#{basename}" has versions "#{version}"
@@ -58,21 +72,22 @@ Given /^a repository "([^"]*)" from offline cache$/ do |repo_name|
58
72
  repository_path = make_repo_path(repo_name).sub(expand('$tmp/'), '')
59
73
  sh <<-"END"
60
74
  {
61
- git clone --quiet --no-checkout 'vendor/#{repo_name}' '#{current_dir}/#{repository_path}'
75
+ git clone --quiet --no-checkout 'vendor/#{repo_name}' '#{expand_path('.')}/#{repository_path}'
62
76
  } >/dev/null
63
77
  END
64
78
  end
65
79
 
66
80
  Given /^I disable network to the original repository of "([^"]*)"$/ do |basename|
67
81
  steps %Q{
68
- Given I delete the directory "#{make_repo_path(basename)}"
82
+ Given I delete the directory "#{path_for_step(make_repo_path(basename))}"
69
83
  }
70
84
  end
71
85
 
72
86
  When /^I create a file named "([^"]*)" in "([^"]*)" deployed to "([^"]*)"$/ do |file_name, v_repo_name, v_vimfiles_path|
73
87
  flavor_path = make_flavor_path(expand(v_vimfiles_path), expand(v_repo_name))
88
+ file_path = "#{flavor_path}/#{file_name}"
74
89
  steps %Q{
75
- When I write to "#{flavor_path}/#{file_name}" with:
90
+ When I write to "#{path_for_step(file_path)}" with:
76
91
  """
77
92
  """
78
93
  }
@@ -82,24 +97,24 @@ Then /^a flavor "([^"]*)" version "([^"]*)" is deployed to "([^"]*)"$/ do |v_rep
82
97
  flavor_path = make_flavor_path(expand(v_vimfiles_path), expand(v_repo_name))
83
98
  basename = expand(v_repo_name).split('/').last.sub(/^vim-/, '')
84
99
  steps %Q{
85
- Then the file "#{flavor_path}/doc/#{basename}.txt" should contain:
100
+ Then the file "#{path_for_step(flavor_path)}/doc/#{basename}.txt" should contain:
86
101
  """
87
102
  *#{basename}* #{version}
88
103
  """
89
- Then a file named "#{flavor_path}/doc/tags" should exist
104
+ Then a file named "#{path_for_step(flavor_path)}/doc/tags" should exist
90
105
  }
91
106
  end
92
107
 
93
108
  Then /^a flavor "([^"]*)" is not deployed to "([^"]*)"$/ do |v_repo_name, v_vimfiles_path|
94
109
  flavor_path = make_flavor_path(expand(v_vimfiles_path), expand(v_repo_name))
95
110
  steps %Q{
96
- Then a directory named "#{flavor_path}" should not exist
111
+ Then a directory named "#{path_for_step(flavor_path)}" should not exist
97
112
  }
98
113
  end
99
114
 
100
115
  Then /^"([^"]*)" version "([^"]*)" is (?:(not) )?cached$/ do |v_repo_name, version, p|
101
116
  d = make_cached_repo_path(expand(v_repo_name), expand('$home').to_stash_path)
102
- (system <<-"END").should == (p != 'not')
117
+ expect(system <<-"END").to equal(p != 'not')
103
118
  {
104
119
  cd '#{d}' &&
105
120
  git rev-list --quiet '#{version}'
@@ -109,7 +124,8 @@ end
109
124
 
110
125
  Then /^a file named "([^"]*)" (should(?: not)?) exist in "([^"]*)" deployed to "([^"]*)"$/ do |file_name, should, v_repo_name, v_vimfiles_path|
111
126
  flavor_path = make_flavor_path(expand(v_vimfiles_path), expand(v_repo_name))
127
+ file_path = "#{flavor_path}/#{file_name}"
112
128
  steps %Q{
113
- Then a file named "#{flavor_path}/#{file_name}" #{should} exist
129
+ Then a file named "#{path_for_step(file_path)}" #{should} exist
114
130
  }
115
131
  end
@@ -1,6 +1,15 @@
1
1
  Given 'a flavorfile with:' do |content|
2
2
  steps %Q{
3
- Given a file named "#{'.'.to_flavorfile_path}" with:
3
+ Given a file named "#{path_for_step(expand_path('.').to_flavorfile_path)}" with:
4
+ """
5
+ #{expand(content)}
6
+ """
7
+ }
8
+ end
9
+
10
+ Given 'an old name flavorfile with:' do |content|
11
+ steps %Q{
12
+ Given a file named "#{path_for_step("#{expand_path('.')}/VimFlavor")}" with:
4
13
  """
5
14
  #{expand(content)}
6
15
  """
@@ -1,6 +1,15 @@
1
1
  Given 'a lockfile with:' do |content|
2
2
  steps %Q{
3
- Given a file named "#{'.'.to_lockfile_path}" with:
3
+ Given a file named "#{path_for_step(expand_path('.').to_lockfile_path)}" with:
4
+ """
5
+ #{expand(content)}
6
+ """
7
+ }
8
+ end
9
+
10
+ Given 'an old name lockfile with:' do |content|
11
+ steps %Q{
12
+ Given a file named "#{path_for_step("#{expand_path('.')}/VimFlavor.lock")}" with:
4
13
  """
5
14
  #{expand(content)}
6
15
  """
@@ -18,7 +27,7 @@ end
18
27
 
19
28
  Given 'I delete the lockfile' do
20
29
  steps %Q{
21
- Given I remove the file "#{'.'.to_lockfile_path}"
30
+ Given I remove the file "#{path_for_step(expand_path('.').to_lockfile_path)}"
22
31
  }
23
32
  end
24
33
 
@@ -34,7 +43,7 @@ end
34
43
  Then /^(?:a|the) lockfile is (?:created|updated) with:$/ do |content|
35
44
  # For some reason, Cucumber drops the last newline from every docstring...
36
45
  steps %Q{
37
- Then the file "#{'.'.to_lockfile_path}" should contain exactly:
46
+ Then the file "#{path_for_step(expand_path('.').to_lockfile_path)}" should contain exactly:
38
47
  """
39
48
  #{content == '' ? '' : expand(content) + "\n"}
40
49
  """
@@ -42,11 +51,11 @@ Then /^(?:a|the) lockfile is (?:created|updated) with:$/ do |content|
42
51
  end
43
52
 
44
53
  Then /^(?:a|the) lockfile is (?:created|updated) and matches with:$/ do |content|
45
- check_file_content('.'.to_lockfile_path, /#{content}/, true)
54
+ expect(path_for_step(expand_path('.').to_lockfile_path)).to have_file_content(/#{content}/)
46
55
  end
47
56
 
48
57
  Then /^(?:a|the) lockfile is not created$/ do
49
58
  steps %Q{
50
- Then a file named "#{'.'.to_lockfile_path}" should not exist
59
+ Then a file named "#{path_for_step(expand_path('.').to_lockfile_path)}" should not exist
51
60
  }
52
61
  end
@@ -1,13 +1,17 @@
1
1
  require 'aruba/api'
2
2
  require 'aruba/cucumber'
3
3
  require 'fileutils'
4
+ require 'pathname'
4
5
  require 'vim-flavor'
5
6
 
6
7
  class FakeUserEnvironment
7
8
  include Vim::Flavor::ShellUtility
8
9
 
9
- def add_new_versions_to_repo(basename, versions, flavorfile_content = nil)
10
+ def add_new_versions_to_repo(basename, versions, flavorfile_content = nil, naming_style = :new)
10
11
  repository_path = make_repo_path(basename)
12
+ flavorfile_path = naming_style == :new ?
13
+ repository_path.to_flavorfile_path :
14
+ "#{repository_path}/VimFlavor"
11
15
  doc_name = basename.split('/').last.sub(/^vim-/, '')
12
16
  sh <<-"END"
13
17
  {
@@ -19,10 +23,10 @@ class FakeUserEnvironment
19
23
  git add doc
20
24
  #{
21
25
  %Q{
22
- cat <<'FF' >#{'.'.to_flavorfile_path}
26
+ cat <<'FF' >#{flavorfile_path}
23
27
  #{expand(flavorfile_content)}
24
28
  FF
25
- git add #{'.'.to_flavorfile_path}
29
+ git add #{flavorfile_path}
26
30
  } if flavorfile_content
27
31
  }
28
32
  git commit -m "Version $v"
@@ -44,6 +48,16 @@ FF
44
48
  }
45
49
  end
46
50
 
51
+ def path_for_step(path)
52
+ cwd = Pathname.new(expand_path('.'))
53
+ pathd = Pathname.new(path)
54
+ if not pathd.absolute?
55
+ pathd = cwd + pathd
56
+ end
57
+
58
+ pathd.relative_path_from(cwd).to_s
59
+ end
60
+
47
61
  def make_cached_repo_path(repo_name, stash_path)
48
62
  "#{stash_path}/repos/#{repo_name.zap}"
49
63
  end
@@ -68,22 +82,18 @@ end
68
82
  Before do
69
83
  variable_table['version'] = Vim::Flavor::VERSION
70
84
 
71
- variable_table['tmp'] = File.absolute_path(current_dir)
85
+ variable_table['tmp'] = File.absolute_path(expand_path('.'))
72
86
 
73
87
  steps %Q{
74
88
  Given a directory named "home"
75
89
  }
76
- variable_table['home'] = File.absolute_path(File.join([current_dir, 'home']))
90
+ variable_table['home'] = File.absolute_path(File.join([expand_path('.'), 'home']))
77
91
 
78
92
  @aruba_timeout_seconds = 5
79
- end
80
93
 
81
- Aruba.configure do |config|
82
- config.before_cmd do |cmd|
83
- set_env 'VIM_FLAVOR_HOME', variable_table['home']
84
- set_env 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
85
- set_env 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
86
- end
94
+ set_environment_variable 'VIM_FLAVOR_HOME', variable_table['home']
95
+ set_environment_variable 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
96
+ set_environment_variable 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
87
97
  end
88
98
 
89
99
  World do