vim-flavor 2.0.0 → 2.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed8e9b52605c8aaa5285aa081653824e1f4c0e1b
4
- data.tar.gz: c300452d28a9bdebeaa480d40d85c5a641ebda59
3
+ metadata.gz: 230788107f3767739214c5a024592a77e548af00
4
+ data.tar.gz: 8cd90f9cf955a384778a8482134aef9bca326258
5
5
  SHA512:
6
- metadata.gz: d4ae143d043e5426572b17b09e9d5006cbaadd7ba787fac00afcbed39b1b2c915ddff92519e5c66f48e4dbea89c4b91fec712f666c06ac1881a6b29a2571201e
7
- data.tar.gz: ca4552878793038715ca13b5eb46a1641dec9d7b9b99473a103548c8380ec2fcd0cf39a09785c195c27323f6cbe9e82d1c88a539bfca1741853b7c3f62f73ae1
6
+ metadata.gz: 40cf56b32c21efd4bb6fd5db6e244b500dcf683e9426fec08f76ae9e2fd14cd13def4df3e19a43bda5d6c2bbfb9178c7e006bfc2a3a62bbb0f1502913525a02f
7
+ data.tar.gz: 4e93551f2c305ccb1dab29a6561cb17ea81787cab0db76c6dac5d994fd352d3bfbae1ea15f7af3fc13f32652e8339c3a4710355078e58b9bf1c15dbeb0065af0
data/README.md CHANGED
@@ -61,7 +61,7 @@ See also
61
61
 
62
62
  ## License
63
63
 
64
- vim-flavor is released under the terms of so-called MIT/X license.
64
+ vim-flavor is released under the terms of MIT license.
65
65
  See the LICENSE file for the details.
66
66
 
67
67
 
data/features/.nav CHANGED
@@ -4,7 +4,7 @@
4
4
  - uninstall_vim_flavor.md (Uninstall vim-flavor)
5
5
  - typical_usage:
6
6
  - install_vim_plugins.feature
7
- - upgrade_vim_plugins.feature
7
+ - update_vim_plugins.feature
8
8
  - uninstall_vim_plugins.feature
9
9
  - deploy_to_arbitrary_place.feature
10
10
  - command_line:
@@ -20,6 +20,6 @@
20
20
  - version_tag_format.feature
21
21
  - branches:
22
22
  - install.feature
23
- - upgrade.feature
23
+ - update.feature
24
24
  - changing_tracking_branches.feature
25
25
  - detect_incompatible_declarations.feature
@@ -1,4 +1,4 @@
1
- Feature: Upgrade Vim plugins with specific branches
1
+ Feature: Update Vim plugins with specific branches
2
2
  In order to try out proposed changes which are not released yet,
3
3
  as a lazy Vim user,
4
4
  I want to track the latest revision of a specific branch.
@@ -6,7 +6,7 @@ Feature: Upgrade Vim plugins with specific branches
6
6
  Background:
7
7
  Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
8
8
 
9
- Scenario: Upgrade a plugin
9
+ Scenario: Update a plugin
10
10
  Given a flavorfile with:
11
11
  """ruby
12
12
  flavor '$foo_uri', branch: 'master'
@@ -17,7 +17,7 @@ Feature: Upgrade Vim plugins with specific branches
17
17
  $foo_uri ($foo_rev_102 at master)
18
18
  """
19
19
  And "foo" version "1.0.3" is released
20
- When I run `vim-flavor upgrade`
20
+ When I run `vim-flavor update`
21
21
  Then it should pass with template:
22
22
  """
23
23
  Checking versions...
@@ -1,4 +1,4 @@
1
- It would be better to install/upgrade Vim plugins as fast as possible.
1
+ It would be better to install/update Vim plugins as fast as possible.
2
2
  Since `vim-flavor` manages Vim plugins with Git, it has to clone each plugin's
3
3
  repository at first, and it also has to fetch changes from time to time.
4
4
  But network access is typically time-consuming.
@@ -41,8 +41,8 @@ Feature: Basics
41
41
  fatal: \S+ does not appear to be a git repository
42
42
  """
43
43
 
44
- Scenario: Upgrading plugins
45
- When I run `vim-flavor upgrade`
44
+ Scenario: Updating plugins
45
+ When I run `vim-flavor update`
46
46
  Then it should fail with regexp:
47
47
  """
48
48
  fatal: \S+ does not appear to be a git repository
data/features/news.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## vim-flavor 2.1.0
2
+
3
+ ### Feature additions
4
+
5
+ * `update` command is added. It is an alias of existing `upgrade` command.
6
+ Now it is recommended to use `update` rather than `upgrade`.
7
+ `upgrade` will be removed in a future version.
8
+ * `update` and `upgrade` learned to update specific plugins if repository names
9
+ are given as command-line arguments.
10
+
11
+
12
+
13
+
1
14
  ## vim-flavor 2.0.0
2
15
 
3
16
  ### Feature additions
@@ -1,7 +1,7 @@
1
- Feature: Upgrade outdated dependencies of Vim plugins
1
+ Feature: Update outdated dependencies of Vim plugins
2
2
  In order to smoothly install Vim plugins,
3
3
  as a lazy Vim user,
4
- I want to automatically upgrade outdated dependencies of Vim plugins.
4
+ I want to automatically update outdated dependencies of Vim plugins.
5
5
 
6
6
  Scenario: Some plugins use outdated dependencies
7
7
  Given a repository "L" with versions "0.1 0.2 0.3 0.4"
@@ -9,3 +9,9 @@ end
9
9
  Then /^it should (pass|fail) with template:$/ do |pass_fail, template|
10
10
  self.__send__("assert_#{pass_fail}ing_with", expand(template))
11
11
  end
12
+
13
+ When /^I run `(.*)` \(variables expanded\)$/ do |command|
14
+ steps %Q{
15
+ When I run `#{expand(command)}`
16
+ }
17
+ end
@@ -8,7 +8,7 @@ following:
8
8
  2. Copy source tree in the package into `~/.vim` etc.
9
9
  3. Generate the help tags file for the plugin.
10
10
 
11
- It is also exciting to upgrade favorite Vim plugins to the latest version,
11
+ It is also exciting to update favorite Vim plugins to the latest version,
12
12
  but I don't want to repeat the steps for each plugin. It's boring.
13
13
 
14
14
  Some plugins depend on other plugins, so that I have to install also
@@ -0,0 +1,88 @@
1
+ @typical_usage
2
+ Feature: Update Vim plugins
3
+ In order to automate boring steps,
4
+ as a lazy Vim user,
5
+ I want to use a declarative way to update my favorite Vim plugins.
6
+
7
+ Background:
8
+ Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
9
+ Given a repository "bar" with versions "1.0.0 1.0.1 1.0.2"
10
+ Given a repository "baz" with versions "1.0.0 1.0.1 1.0.2"
11
+
12
+ Scenario: Update all plugins
13
+ Given a flavorfile with:
14
+ """ruby
15
+ flavor '$foo_uri'
16
+ flavor '$bar_uri'
17
+ flavor '$baz_uri'
18
+ """
19
+ And a lockfile with:
20
+ """
21
+ $bar_uri (1.0.0)
22
+ $baz_uri (1.0.0)
23
+ $foo_uri (1.0.0)
24
+ """
25
+ When I run `vim-flavor update`
26
+ Then it should pass
27
+ And the lockfile is updated with:
28
+ """
29
+ $bar_uri (1.0.2)
30
+ $baz_uri (1.0.2)
31
+ $foo_uri (1.0.2)
32
+ """
33
+ And a bootstrap script is created in "$home/.vim"
34
+ And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
35
+ And a flavor "$bar_uri" version "1.0.2" is deployed to "$home/.vim"
36
+ And a flavor "$baz_uri" version "1.0.2" is deployed to "$home/.vim"
37
+
38
+ Scenario: Update specific plugins
39
+ Given a flavorfile with:
40
+ """ruby
41
+ flavor '$foo_uri'
42
+ flavor '$bar_uri'
43
+ flavor '$baz_uri'
44
+ """
45
+ And a lockfile with:
46
+ """
47
+ $bar_uri (1.0.0)
48
+ $baz_uri (1.0.0)
49
+ $foo_uri (1.0.0)
50
+ """
51
+ When I run `vim-flavor update $foo_uri $baz_uri` (variables expanded)
52
+ Then it should pass
53
+ And the lockfile is updated with:
54
+ """
55
+ $bar_uri (1.0.0)
56
+ $baz_uri (1.0.2)
57
+ $foo_uri (1.0.2)
58
+ """
59
+ And a bootstrap script is created in "$home/.vim"
60
+ And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
61
+ And a flavor "$bar_uri" version "1.0.0" is deployed to "$home/.vim"
62
+ And a flavor "$baz_uri" version "1.0.2" is deployed to "$home/.vim"
63
+
64
+ Scenario: Update by "upgrade", an alias of "update" for backward compatibility
65
+ Given a flavorfile with:
66
+ """ruby
67
+ flavor '$foo_uri'
68
+ flavor '$bar_uri'
69
+ flavor '$baz_uri'
70
+ """
71
+ And a lockfile with:
72
+ """
73
+ $bar_uri (1.0.0)
74
+ $baz_uri (1.0.0)
75
+ $foo_uri (1.0.0)
76
+ """
77
+ When I run `vim-flavor upgrade`
78
+ Then it should pass
79
+ And the lockfile is updated with:
80
+ """
81
+ $bar_uri (1.0.2)
82
+ $baz_uri (1.0.2)
83
+ $foo_uri (1.0.2)
84
+ """
85
+ And a bootstrap script is created in "$home/.vim"
86
+ And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
87
+ And a flavor "$bar_uri" version "1.0.2" is deployed to "$home/.vim"
88
+ And a flavor "$baz_uri" version "1.0.2" is deployed to "$home/.vim"
@@ -17,14 +17,23 @@ module Vim
17
17
  )
18
18
  end
19
19
 
20
- desc 'upgrade', 'Upgrade Vim plugins according to VimFlavor file.'
20
+ desc 'update [REPO_NAME...]',
21
+ 'Update Vim plugins according to VimFlavor file.'
21
22
  common_options_to_deploy
22
- def upgrade
23
- Facade.new().upgrade(
24
- options[:vimfiles_path] || default_vimfiles_path
23
+ def update(*repo_names)
24
+ Facade.new().update(
25
+ options[:vimfiles_path] || default_vimfiles_path,
26
+ repo_names
25
27
  )
26
28
  end
27
29
 
30
+ desc 'upgrade [REPO_NAME...]',
31
+ 'Update Vim plugins. (alias of "update")'
32
+ common_options_to_deploy
33
+ def upgrade(*repo_names)
34
+ update(*repo_names)
35
+ end
36
+
28
37
  desc 'test [FILES or DIRS]',
29
38
  'Test a Vim plugin in the current working directory.'
30
39
  def test(*files_or_dirs)
@@ -4,12 +4,17 @@ require 'shellwords'
4
4
  module Vim
5
5
  module Flavor
6
6
  class Facade
7
+ def initialize
8
+ @target_repo_names = []
9
+ end
10
+
7
11
  def install(vimfiles_path)
8
- install_or_upgrade(:install, vimfiles_path)
12
+ install_or_update(:install, vimfiles_path)
9
13
  end
10
14
 
11
- def upgrade(vimfiles_path)
12
- install_or_upgrade(:upgrade, vimfiles_path)
15
+ def update(vimfiles_path, target_repo_names)
16
+ @target_repo_names = target_repo_names
17
+ install_or_update(:update, vimfiles_path)
13
18
  end
14
19
 
15
20
  def test(files_or_dirs)
@@ -55,7 +60,7 @@ module Vim
55
60
  exit(1) unless succeeded
56
61
  end
57
62
 
58
- def install_or_upgrade(mode, vimfiles_path)
63
+ def install_or_update(mode, vimfiles_path)
59
64
  flavorfile = FlavorFile.load(Dir.getwd().to_flavorfile_path)
60
65
  lockfile = LockFile.load_or_new(Dir.getwd().to_lockfile_path)
61
66
  refresh_flavors(
@@ -87,8 +92,8 @@ module Vim
87
92
  trace "Completed.\n"
88
93
  end
89
94
 
90
- def complete(current_flavor_table, locked_flavor_table, mode, level = 1)
91
- nfs = complete_flavors(current_flavor_table, locked_flavor_table, mode, level, 'you')
95
+ def complete(current_flavor_table, locked_flavor_table, mode)
96
+ nfs = complete_flavors(current_flavor_table, locked_flavor_table, mode, 1, 'you')
92
97
 
93
98
  Hash[
94
99
  nfs.group_by {|nf| nf.repo_name}.map {|repo_name, nfg|
@@ -141,13 +146,22 @@ module Vim
141
146
  complete_a_flavor_dependencies(nf, locked_flavor_table, mode, level)
142
147
  end
143
148
 
149
+ def effective_mode(mode, repo_name)
150
+ return :install if
151
+ mode == :update and
152
+ not @target_repo_names.empty? and
153
+ not @target_repo_names.member?(repo_name)
154
+ mode
155
+ end
156
+
144
157
  def complete_a_flavor_itself(nf, lf, mode, level, requirer)
145
158
  trace "#{' ' * level}Use #{nf.repo_name} ..."
146
159
 
147
160
  already_cached = nf.cached?
148
161
  nf.clone() unless already_cached
149
162
 
150
- if mode == :install and lf and nf.satisfied_with?(lf.locked_version)
163
+ e_mode = effective_mode(mode, nf.repo_name)
164
+ if e_mode == :install and lf and nf.satisfied_with?(lf.locked_version)
151
165
  if not nf.cached_version?(lf.locked_version)
152
166
  nf.fetch()
153
167
  if not nf.cached_version?(lf.locked_version)
@@ -1,6 +1,6 @@
1
1
  module Vim
2
2
  module Flavor
3
- VERSION = '2.0.0'
3
+ VERSION = '2.1.0'
4
4
 
5
5
  class Version
6
6
  def self.create(arg)
data/vim-flavor.gemspec CHANGED
@@ -1,25 +1,28 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/vim-flavor/version', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vim-flavor/version'
3
5
 
4
- Gem::Specification.new do |gem|
5
- gem.authors = ['Kana Natsuno']
6
- gem.email = ['dev@whileimautomaton.net']
7
- gem.summary = %q{A tool to manage your favorite Vim plugins}
8
- gem.description = gem.summary
9
- gem.homepage = 'https://github.com/kana/vim-flavor'
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'vim-flavor'
8
+ spec.version = Vim::Flavor::VERSION
9
+ spec.authors = ['Kana Natsuno']
10
+ spec.email = ['dev@whileimautomaton.net']
11
+ spec.summary = %q{A tool to manage your favorite Vim plugins}
12
+ spec.description = spec.summary
13
+ spec.homepage = 'https://github.com/kana/vim-flavor'
14
+ spec.license = 'MIT'
10
15
 
11
- gem.executables = `git ls-files -- bin/*`.split(/\n/).map{ |f| File.basename(f) }
12
- gem.files = `git ls-files`.split(/\n/)
13
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split(/\n/)
14
- gem.name = 'vim-flavor'
15
- gem.require_paths = ['lib']
16
- gem.version = Vim::Flavor::VERSION
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
17
20
 
18
- gem.add_dependency('parslet', '~> 1.0')
19
- gem.add_dependency('thor', '~> 0.14')
21
+ spec.add_dependency('parslet', '~> 1.0')
22
+ spec.add_dependency('thor', '~> 0.14')
20
23
 
21
- gem.add_development_dependency('aruba', '~> 0.5')
22
- gem.add_development_dependency('cucumber', '~> 1.2')
23
- gem.add_development_dependency('pry')
24
- gem.add_development_dependency('rspec', '~> 2.8')
24
+ spec.add_development_dependency('aruba', '~> 0.5')
25
+ spec.add_development_dependency('cucumber', '~> 1.2')
26
+ spec.add_development_dependency('pry')
27
+ spec.add_development_dependency('rspec', '~> 2.8')
25
28
  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.0.0
4
+ version: 2.1.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: 2014-03-10 00:00:00.000000000 Z
11
+ date: 2014-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -117,7 +117,7 @@ files:
117
117
  - features/branches/changing_tracking_branches.feature
118
118
  - features/branches/detect_incompatible_declarations.feature
119
119
  - features/branches/install.feature
120
- - features/branches/upgrade.feature
120
+ - features/branches/update.feature
121
121
  - features/caching/README.md
122
122
  - features/caching/basics.feature
123
123
  - features/caching/deployment.feature
@@ -155,7 +155,7 @@ files:
155
155
  - features/typical_usage/deploy_to_arbitrary_place.feature
156
156
  - features/typical_usage/install_vim_plugins.feature
157
157
  - features/typical_usage/uninstall_vim_plugins.feature
158
- - features/typical_usage/upgrade_vim_plugins.feature
158
+ - features/typical_usage/update_vim_plugins.feature
159
159
  - features/uninstall_vim_flavor.md
160
160
  - features/version_lock.feature
161
161
  - features/version_tag_format.feature
@@ -187,7 +187,8 @@ files:
187
187
  - spec/versionconstraint_spec.rb
188
188
  - vim-flavor.gemspec
189
189
  homepage: https://github.com/kana/vim-flavor
190
- licenses: []
190
+ licenses:
191
+ - MIT
191
192
  metadata: {}
192
193
  post_install_message:
193
194
  rdoc_options: []
@@ -210,12 +211,13 @@ signing_key:
210
211
  specification_version: 4
211
212
  summary: A tool to manage your favorite Vim plugins
212
213
  test_files:
214
+ - features/.nav
213
215
  - features/README.md
214
216
  - features/branches/README.md
215
217
  - features/branches/changing_tracking_branches.feature
216
218
  - features/branches/detect_incompatible_declarations.feature
217
219
  - features/branches/install.feature
218
- - features/branches/upgrade.feature
220
+ - features/branches/update.feature
219
221
  - features/caching/README.md
220
222
  - features/caching/basics.feature
221
223
  - features/caching/deployment.feature
@@ -253,7 +255,7 @@ test_files:
253
255
  - features/typical_usage/deploy_to_arbitrary_place.feature
254
256
  - features/typical_usage/install_vim_plugins.feature
255
257
  - features/typical_usage/uninstall_vim_plugins.feature
256
- - features/typical_usage/upgrade_vim_plugins.feature
258
+ - features/typical_usage/update_vim_plugins.feature
257
259
  - features/uninstall_vim_flavor.md
258
260
  - features/version_lock.feature
259
261
  - features/version_tag_format.feature
@@ -1,26 +0,0 @@
1
- @typical_usage
2
- Feature: Upgrade Vim plugins
3
- In order to automate boring steps,
4
- as a lazy Vim user,
5
- I want to use a declarative way to upgrade my favorite Vim plugins.
6
-
7
- Background:
8
- Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
9
-
10
- Scenario: Upgrade with lockfile
11
- Given a flavorfile with:
12
- """ruby
13
- flavor '$foo_uri'
14
- """
15
- And a lockfile with:
16
- """
17
- $foo_uri (1.0.0)
18
- """
19
- When I run `vim-flavor upgrade`
20
- Then it should pass
21
- And the lockfile is updated with:
22
- """
23
- $foo_uri (1.0.2)
24
- """
25
- And a bootstrap script is created in "$home/.vim"
26
- And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"