-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
4,937 additions
and
8,725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.release-notes.txt | ||
command-t.recipe | ||
/.bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "vendor/vimball"] | ||
path = vendor/vimball | ||
url = git://github.com/tomtom/vimball.rb.git | ||
[submodule "vendor/vimscriptuploader"] | ||
path = vendor/vimscriptuploader | ||
url = git://github.com/tomtom/vimscriptuploader.rb.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Nicolas Alpi <[email protected]> Spyou <[email protected]> | ||
Noon Silk <[email protected]> Noon Silk <[email protected]> | ||
Noon Silk <[email protected]> Noon Silk <[email protected]> | ||
Sung Pae <[email protected]> guns <[email protected]> | ||
Sung Pae <[email protected]> guns <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--colour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source :rubygems | ||
gem 'mechanize' | ||
gem 'rake' | ||
gem 'rr' | ||
gem 'rspec', '>= 2.0.0.rc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
diff-lcs (1.1.2) | ||
mechanize (1.0.0) | ||
nokogiri (>= 1.2.1) | ||
nokogiri (1.4.4) | ||
rake (0.8.7) | ||
rr (1.0.2) | ||
rspec (2.5.0) | ||
rspec-core (~> 2.5.0) | ||
rspec-expectations (~> 2.5.0) | ||
rspec-mocks (~> 2.5.0) | ||
rspec-core (2.5.1) | ||
rspec-expectations (2.5.0) | ||
diff-lcs (~> 1.1.2) | ||
rspec-mocks (2.5.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
mechanize | ||
rake | ||
rr | ||
rspec (>= 2.0.0.rc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright 2010-2012 Wincent Colaiuta. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
rubyfiles := $(shell find ruby -name '*.rb') | ||
cfiles := $(shell find ruby -name '*.c') | ||
cheaders := $(shell find ruby -name '*.h') | ||
depends := $(shell find ruby -name depend) | ||
txtfiles := $(shell find doc -name '*.txt') | ||
vimfiles := $(shell find plugin -name '*.vim') | ||
|
||
vimball: command-t.vba | ||
|
||
command-t.recipe: $(rubyfiles) $(cfiles) $(cheaders) $(depends) $(txtfiles) $(vimfiles) | ||
echo "$^" | perl -pe 's/ /\n/g' > $@ | ||
command-t.vba: command-t.recipe | ||
vendor/vimball/vimball.rb -d . -b . vba $^ | ||
|
||
.PHONY: spec | ||
spec: | ||
rspec spec | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f command-t.vba |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
doc/command-t.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
require 'yaml' | ||
|
||
def bail_on_failure | ||
exitstatus = $?.exitstatus | ||
if exitstatus != 0 | ||
err "last command failed with exit status #{exitstatus}" | ||
exit 1 | ||
end | ||
end | ||
|
||
def version | ||
`git describe`.chomp | ||
end | ||
|
||
def rubygems_version | ||
# RubyGems will barf if we try to pass an intermediate version number | ||
# like "1.1b2-10-g61a374a", so no choice but to abbreviate it | ||
`git describe --abbrev=0`.chomp | ||
end | ||
|
||
def yellow | ||
"\033[33m" | ||
end | ||
|
||
def red | ||
"\033[31m" | ||
end | ||
|
||
def clear | ||
"\033[0m" | ||
end | ||
|
||
def warn str | ||
puts "#{yellow}warning: #{str}#{clear}" | ||
end | ||
|
||
def err str | ||
puts "#{red}error: #{str}#{clear}" | ||
end | ||
|
||
def prepare_release_notes | ||
# extract base release notes from README.txt HISTORY section | ||
File.open('.release-notes.txt', 'w') do |out| | ||
lines = File.readlines('README.txt').each { |line| line.chomp! } | ||
while line = lines.shift do | ||
next unless line =~ /^HISTORY +\*command-t-history\*$/ | ||
break unless lines.shift == '' && | ||
(line = lines.shift) && line =~ /^\d\.\d/ && | ||
lines.shift == '' | ||
while line = lines.shift and line != '' | ||
out.puts line | ||
end | ||
break | ||
end | ||
out.puts '' | ||
out.puts '# Please edit the release notes to taste.' | ||
out.puts '# Blank lines and lines beginning with a hash will be removed.' | ||
out.puts '# To abort, exit your editor with a non-zero exit status (:cquit in Vim).' | ||
end | ||
|
||
unless system "$EDITOR .release-notes.txt" | ||
err "editor exited with non-zero exit status; aborting" | ||
exit 1 | ||
end | ||
|
||
filtered = read_release_notes | ||
File.open('.release-notes.txt', 'w') do |out| | ||
out.print filtered | ||
end | ||
end | ||
|
||
def read_release_notes | ||
File.readlines('.release-notes.txt').reject do |line| | ||
line =~ /^(#.*|\s*)$/ # filter comment lines and blank lines | ||
end.join | ||
end | ||
|
||
task :default => :spec | ||
|
||
desc 'Print help on preparing a release' | ||
task :help do | ||
puts <<-END | ||
The general release sequence is: | ||
rake prerelease | ||
rake gem | ||
rake push | ||
bundle exec rake upload:all | ||
rake archive | ||
Most of the Rake tasks run fine without Bundler, and in fact, we | ||
don't want Bundler in the prerelease task because it will tamper | ||
with the environment in a way that breaks multiruby. | ||
We use Bundler for the upload task because the www.vim.org | ||
uploader uses Bundler to ensure that the Mechanize gem is available. | ||
END | ||
end | ||
|
||
task :check_bundler do | ||
unless ENV.has_key? 'BUNDLE_GEMFILE' | ||
warn 'warning: Bundler is not loaded; try running with `bundle exec rake`' | ||
end | ||
end | ||
|
||
desc 'Run specs' | ||
task :spec do | ||
system 'bundle exec rspec spec' | ||
bail_on_failure | ||
end | ||
|
||
desc 'Create vimball archive' | ||
task :vimball => :check_tag do | ||
system 'make' | ||
bail_on_failure | ||
FileUtils.cp 'command-t.vba', "command-t-#{version}.vba" | ||
end | ||
|
||
desc 'Clean compiled products' | ||
task :clean do | ||
Dir.chdir 'ruby/command-t' do | ||
system 'make clean' if File.exists?('Makefile') | ||
system 'rm -f Makefile' | ||
end | ||
end | ||
|
||
desc 'Clobber all generated files' | ||
task :clobber => :clean do | ||
system 'make clean' | ||
end | ||
|
||
desc 'Compile extension' | ||
task :make do | ||
Dir.chdir 'ruby/command-t' do | ||
ruby 'extconf.rb' | ||
system 'make clean' | ||
bail_on_failure | ||
system 'make' | ||
bail_on_failure | ||
end | ||
end | ||
|
||
namespace :make do | ||
desc 'Compile under all multiruby versions' | ||
task :all do | ||
system './compile-test.sh' | ||
bail_on_failure | ||
end | ||
end | ||
|
||
namespace :spec do | ||
desc 'Run specs under all multiruby versions' | ||
task :all do | ||
system './multi-spec.sh' | ||
bail_on_failure | ||
end | ||
end | ||
|
||
desc 'Check that the current HEAD is tagged' | ||
task :check_tag do | ||
unless system 'git describe --exact-match HEAD 2> /dev/null' | ||
warn 'current HEAD is not tagged' | ||
end | ||
end | ||
|
||
desc 'Run checks prior to release' | ||
task :prerelease => ['make:all', 'spec:all', :vimball, :check_tag] | ||
|
||
namespace :upload do | ||
desc 'Upload current vimball to Amazon S3' | ||
task :s3 => :vimball do | ||
sh 'aws put ' + | ||
"s3.wincent.com/command-t/releases/command-t-#{version}.vba " + | ||
"command-t-#{version}.vba" | ||
sh 'aws put ' + | ||
"s3.wincent.com/command-t/releases/command-t-#{version}.vba?acl " + | ||
'--public' | ||
end | ||
|
||
desc 'Upload current vimball to www.vim.org' | ||
task :vim => [:check_bundler, :vimball] do | ||
prepare_release_notes | ||
sh "vendor/vimscriptuploader/vimscriptuploader.rb \ | ||
--id 3025 \ | ||
--file command-t-#{version}.vba \ | ||
--message-file .release-notes.txt \ | ||
--version #{version} \ | ||
--config ~/.vim_org.yml \ | ||
.vim_org.yml" | ||
end | ||
|
||
desc 'Upload current vimball everywhere' | ||
task :all => [ :s3, :vim ] | ||
end | ||
|
||
desc 'Add current vimball to releases branch' | ||
task :archive => :vimball do | ||
v = version # store version before switching branches | ||
sh 'git stash && ' + | ||
'git checkout releases && ' + | ||
"git add command-t-#{v}.vba && " + | ||
"git commit -s -m 'Add #{v} release vimball' && " + | ||
'git checkout @{-1} && ' + | ||
'git stash pop || true' | ||
end | ||
|
||
desc 'Create the ruby gem package' | ||
task :gem => :check_tag do | ||
sh "gem build command-t.gemspec" | ||
end | ||
|
||
desc 'Push gem to Gemcutter ("gem push")' | ||
task :push => :gem do | ||
sh "gem push command-t-#{rubygems_version}.gem" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Gem::Specification.new do |s| | ||
s.name = "command-t" | ||
|
||
# see note in the Rakefile about how intermediate version numbers | ||
# can break RubyGems | ||
v = `git describe --abbrev=0`.chomp | ||
s.version = v | ||
|
||
s.authors = ["Wincent Colaiuta"] | ||
s.date = "2011-01-05" | ||
s.email = "[email protected]" | ||
|
||
files = | ||
["README.txt", "LICENSE", "Gemfile", "Rakefile"] + | ||
Dir.glob("{ruby,doc,plugin}/**/*") | ||
|
||
files = files.reject { |f| f =~ /\.(rbc|o|log|plist|dSYM)/ } | ||
|
||
s.files = files | ||
s.require_path = "ruby" | ||
s.extensions = "ruby/command-t/extconf.rb" | ||
|
||
s.executables = [] | ||
|
||
s.has_rdoc = false | ||
s.homepage = "https://wincent.com/products/command-t" | ||
|
||
s.summary = "The Command-T plug-in for VIM." | ||
|
||
s.description = <<-EOS | ||
Command-T provides a fast, intuitive mechanism for opening files with a | ||
minimal number of keystrokes. Its full functionality is only available when | ||
installed as a Vim plug-in, but it is also made available as a RubyGem so | ||
that other applications can make use of its searching algorithm. | ||
EOS | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh -e | ||
cd ruby/command-t | ||
for RUBY_VERSION in $(ls ~/.multiruby/install); do | ||
echo "$RUBY_VERSION: building" | ||
export PATH=~/.multiruby/install/$RUBY_VERSION/bin:$PATH | ||
ruby extconf.rb | ||
make clean | ||
make | ||
echo "$RUBY_VERSION: finished" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tags |
Oops, something went wrong.