Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed yaml creation code

  • Loading branch information...
commit d16fc986e4a6f05f2b296d5a3c1430bf3a70e9fb 1 parent 4e66536
Tom Link authored
Showing with 5 additions and 185 deletions.
  1. +5 −41 README.markdown
  2. +0 −144 vimball.rb
46 README.markdown
View
@@ -44,11 +44,8 @@ Create a vimball and upload it to vim.org with
[vimscriptuploader.rb](http://github.org/tomtom/vimscriptuploader.rb):
rm myplugin.yml || echo ignore error
- vimball.rb -u --save-yaml -- vba myplugin.recipe
- # myplugin.yml is created by vimball.rb
- # A more sophisticated solution wouldn't remove the older yaml file
- # but compare timestamps.
- if [ -e myplugin.yml ]; then
+ if vimball.rb -u --save-yaml -- vba myplugin.recipe | grep "vimball: Save as"; then
+ vimscriptdef.rb --recipe myplugin.recipe
vimscriptuploader.rb --user foo --password bar myplugin.yml
fi
@@ -62,41 +59,6 @@ Install a vimball as a "bundle" (i.e. in its own directory under
vimball.rb --repo install myplugin.vba
-Uploading vimballs to vim.org
------------------------------
-
-vimball.rb doesn't upload files by itself but it can save a script
-definition as yaml file, which can be fed to
-[vimscriptuploader.rb](http://github.org/tomtom/vimscriptuploader.rb).
-
-In order to make this work, your scripts have to comply to the following
-convention:
-
-* At least one file must contain a `GetLatestVimScripts` tagline. If the
- file is "foo.vim", the line must look somewhat like:
-
- `" GetLatestVimScripts: 123 0 :AutoInstall: foo.vim`
-
-* At least one file must set a global `loaded_PLUGIN` variable. If the
- plugin is "bar", the corresponding line must look like:
-
- `let loaded_bar = VERSION_NUMBER`
-
- where `VERSION_NUMBER` is an integer that complies with vim's version
- numbering system (see :help v:version).
-
-* If you use tags, vimball.rb will compile the comment version from the
- commit messages since the latest tag. The following tag formats are
- supported (e.g. if the version number is 1.02): v102, 102, 1.02.
-
- If you don't use tags, version comments are limited to simple messages
- if the configuration file defines a field `history_fmt` that must
- contain one `%s`, which will be filled in with the plugin name, the
- formatted string will be posted as version comment.
-
- The MD5 checksum will be added to the version comment.
-
-
Dependencies
------------
@@ -105,4 +67,6 @@ Dependencies
<!-- 2010-11-01; @Last Change: 2010-11-01. -->
-<!-- vi: ft=markdown:tw=72:ts=4 -->
+<!--
+vi: ft=markdown:tw=72:ts=4
+-->
144 vimball.rb
View
@@ -148,21 +148,6 @@ def with_args(args)
exit
end
- opts.on('--print-version NAME', String, 'Print the plugins current version number') do |value|
- recipe = File.join(config['outdir'], "#{value}.recipe")
- puts Vimball.new(config).get_version(recipe, value)
- exit
- end
-
- opts.on('--print-saved-version NAME', String, 'Print the plugins last saved version number') do |value|
- yaml = File.join(config['outdir'], "#{value}.yml")
- if File.exist?(yaml)
- script_def = YAML.load_file(yaml)
- puts script_def['version']
- end
- exit
- end
-
opts.on('-R', '--[no-]recipe', 'On install, save the recipe in DESTDIR/vimballs/recipes') do |bool|
config['save_recipes'] = bool
end
@@ -179,10 +164,6 @@ def with_args(args)
config['update'] = bool
end
- opts.on('-y', '--save-yaml [YAML]', String, 'Save a YAML script definition that can be fed to vimscriptuploader.rb') do |value|
- config['script_def_yaml'] = value
- end
-
opts.on('-z', '--gzip', 'Save as vba.gz') do |value|
config['compress'] = value
end
@@ -377,10 +358,6 @@ def do_vba(recipe)
end
end
- if @config.has_key?('script_def_yaml')
- get_script_def(name)
- end
-
end
@@ -561,127 +538,6 @@ def filename_on_disk(name, file, filename)
end
end
-
- def get_script_def(name)
- recipe = File.join(@config['outdir'], "#{name}.recipe")
- vimball = File.join(@config['outdir'], "#{name}.vba")
- script_yml = @config['script_def_yaml'] || File.join(@config['outdir'], "#{name}.yml")
- if File.exist?(script_yml)
- script_def = YAML.load_file(script_yml)
- else
- script_def = {}
- end
-
- script_id = get_id(name, recipe)
- if script_id.nil?
- $logger.error "No Script ID found"
- elsif (script_def.has_key?('id') and script_def['id'] != script_id)
- $logger.error "Script ID mismatch: Expected #{script_def['id']} but got #{script_id}"
- return nil
- end
- script_def['id'] = script_id
-
- script_def['version'] = get_version(recipe, name)
- if script_def['version'].nil?
- return nil
- end
-
- script_def['message'] = ""
- if @repo and File.exist?(File.join(@repo, '.git'))
- FileUtils.cd(@repo) do
- tags = `git tag`.split(/\n/)
- unless tags.empty?
- tags.sort! do |a, b|
- if a =~ /^v?(\d+)$/
- a = $1
- af = a.to_f / 100
- else
- af = a.to_f
- end
- if b =~ /^v?(\d+)$/
- b = $1
- bf = b.to_f / 100
- else
- bf = b.to_f
- end
- if af == 0 and bf == 0
- a <=> b
- else
- af <=> bf
- end
- end
- latest_tag = tags.last
- $logger.debug "git log --oneline #{latest_tag}.."
- changes = `git log --oneline #{latest_tag}..`
- unless changes.empty?
- changes = changes.split(/\n/).map do |line|
- line.sub(/^\S+/, '-')
- end
- if @config['ignore_git_messages_rx']
- ignore_git_messages_rx = Regexp.new(@config['ignore_git_messages_rx'])
- changes.delete_if {|line| line =~ ignore_git_messages_rx}
- end
- script_def['message'] = changes.join("\n")
- script_def['message'] << "\n" unless script_def['message'].empty?
- end
- end
- end
- end
- # p "DBG", script_def['message']
- if script_def['message'].empty? and @config.has_key?('history_fmt')
- script_def['message'] = @config['history_fmt'] % name
- script_def['message'] << "\n"
- end
- vba = File.open(vimball, 'rb') {|io| io.read}
- script_def['message'] << "MD5 checksum: #{Digest::MD5.hexdigest(vba)}"
-
- script_def['file'] = vimball
-
- File.open(script_yml, 'w') {|io| YAML.dump(script_def, io)}
- return script_def
- end
-
-
- def get_id(name, recipe)
- File.readlines(recipe).each do |line|
- file = line.chomp
- filename = filename_on_disk(name, file, file)
- bname = File.basename(filename)
- File.readlines(filename).each do |line|
- if line.chomp =~ /^" GetLatestVimScripts: (\d+) +\d+ +(:AutoInstall: +)?#{bname}$/
- id = $1
- if id and !id.empty? and id.to_i != 0 and id =~ /[1-9]/
- $logger.debug "#{name}: Script ID is ##{id}"
- return id
- end
- end
- end
- end
- return nil
- end
-
-
- def get_version(recipe, name)
- $logger.debug "Get version number for #{name} (#{recipe})"
- File.readlines(recipe).each do |line|
- file = line.chomp
- filename = filename_on_disk(name, file, file)
- $logger.debug "Get version number in #{filename}"
- File.readlines(filename).each do |line|
- if line.chomp =~ /^let (g:)?loaded_#{name} = (\d+)$/
- version = $2.to_i
- major = version / 100
- minor = version - major * 100
- majmin = "%d.%02d" % [major, minor]
- $logger.debug "#{name}: Version number is #{majmin}"
- return majmin
- end
- end
- end
- $logger.error "Cannot find version number: #{recipe}"
- return nil
- end
-
end
Please sign in to comment.
Something went wrong with that request. Please try again.