Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpasternacki committed Jul 6, 2013
2 parents 95e56bd + 89eb4d0 commit ae904f0
Show file tree
Hide file tree
Showing 57 changed files with 1,463 additions and 230 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
language: ruby
bundler_args: --without development_workstation
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- ree
- jruby-18mode
- jruby-19mode
- jruby-head
- rbx-18mode
- rbx-19mode
notifications:
hipchat: secure: "bds8WNPnAmnj2ommhDk2JNclAY1Ei/bGeWONRhhKNv1zwrqMvZ7B6M5UapEZ\n6K8z70vFMrdIDEJjzuf+ATYS0BVWKnXCYaofiIfJ7V2hiBm7/xNZ15m2bIrM\nQFIMR/Lrkd+wFA0O8z6SaPjvdEgZC6im4zAAuRq7LpH3NTy6qaA="
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changes

## 0.4.0

- Dropped support for Ruby 1.8.7
- Refactored internals to avoid touching user's work tree - all
conjuring is done in a temporary shared clone, fetched and merged
from there
- Module metadata is stored in Git notes; new `vendor info` command
shows it.
- Test dependency cleanup (use up-to-date Cucumber and Minitest)
- Support for external fetching tools with predefined shortcuts for
Bundler and Berkshelf

## 0.3.0

- New command `vendor push` for pushing managed branches and tags to
Expand Down
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ group :development do
:ref => '0cbc35a07cb63f6f409bb85da6ad7d107bdab021' do
gem 'wrong'
end
gem 'minitest-ansi'

git "git://github.com/cucumber/cucumber.git",
:ref => 'd7452d0a0b7998462e28d10f9d2733947984063d' do
gem 'cucumber'
end
end

group :development_workstation do
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Or install it yourself as:

$ gem install vendorificator

Vendorificator is supported on Ruby 1.9.2 or newer. Rubinius and JRuby
in 1.9 mode are also supported.

## Usage

Vendorificator is a command-line tool. The command is called `vendor`
Expand Down Expand Up @@ -240,6 +243,36 @@ git 'git://github.com/user/cookbook.git',
end
```

#### tool

Runs a shell command to download dependencies, and then stores them in
a pristine branch. You can use this to leverage platform-specific
tools (Bundler for Ruby gems, pip for Python packages, Berkshelf for
Chef cookbooks, etc), and keep track of downloaded modules with
Vendorificator. Takes the same arguments as `vendor`, plus:

* `:command` -- command to run to download files
* `:specs` -- files specifying what to download; these will be kept
on the vendor branch together with downloaded dependencies

Two convenience shortcuts are provided, `rubygems_bundler`, and
`chef_berkshelf`. They take no arguments. Their definitions are
examples as well:

```ruby
tool 'rubygems', # <- rubygems_bundler
:path => 'cache',
:specs => [ 'Gemfile', 'Gemfile.lock' ],
:command => 'bundle package --all'
```

```ruby
tool 'cookbooks', # <- chef_berkshelf
:path => 'cookbooks',
:specs => [ 'Berksfile', 'Berksfile.lock' ],
:command => 'berks install --path vendor/cookbooks'
```

## Contributing

1. Fork it
Expand Down
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Bundler.setup
require "bundler/gem_tasks"
require 'rake/testtask'

begin
require 'berkshelf/version'
rescue LoadError
end

namespace :relish do
desc "Publish documentation to Relish"
task :push do
Expand All @@ -25,6 +30,8 @@ begin
desc 'Run Cucumber features'
Cucumber::Rake::Task.new(:features) do |t|
t.fork = false
t.cucumber_opts = %w{--format progress}
t.cucumber_opts += %w{--tags ~@berkshelf} unless defined?(Berkshelf)
end
rescue LoadError
desc 'Cucumber rake task not available'
Expand Down
2 changes: 1 addition & 1 deletion cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
default: --format progress
default: --format pretty
14 changes: 14 additions & 0 deletions features/download.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: simple file download

Scenario: just URL as name
Given a repository with following Vendorfile:
"""ruby
download 'http://test-assets.3ofcoins.net.s3-website-us-east-1.amazonaws.com/testrepo-0.1.tar.gz'
"""
When I successfully run `vendor sync`
Then following has been conjured:
| Name | testrepo-0.1.tar.gz |
And there's a git commit note including "ea207a" in "download_checksum"
And there's a git commit note including "20480" in "download_filesize"
And there's a git commit note including "test-assets.3ofcoins" in "download_url"

29 changes: 27 additions & 2 deletions features/environment.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature: Environment management.

Scenario:
Scenario: Pushing to remote repo
Given a repository with following Vendorfile:
"""ruby
vendor 'generated', :version => '0.23' do |v|
Expand All @@ -12,6 +12,31 @@ Scenario:
And I successfully run `vendor push`
Then branch "vendor/generated" exists in the remote repo
And tag "vendor/generated/0.23" exists in the remote repo
And notes ref "vendor" exists in the remote repo
And there's a git commit note including "master" in "current_branch"

Scenario: Getting module information
Given a repository with following Vendorfile:
"""ruby
vendor 'generated', :version => '0.23' do |v|
File.open('README', 'w') { |f| f.puts "Hello, World!" }
end
"""
And a remote repository
When I successfully run `vendor sync`
And I successfully run `vendor info generated`
Then the last output should match /Module merged version: 0.23/
And the last output should match /unparsed_args/


Scenario: Getting revision information
Given a repository with following Vendorfile:
"""ruby
vendor 'generated', :version => '0.23' do |v|
File.open('README', 'w') { |f| f.puts "Hello, World!" }
end
"""
And a remote repository
When I successfully run `vendor sync`
And I successfully run `vendor info HEAD\^2`
Then the last output should match /master, vendor\/generated/
Then the last output should match /:unparsed_args/
1 change: 1 addition & 0 deletions features/fixtures/rubygems/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!*.gem
Binary file added features/fixtures/rubygems/Marshal.4.8
Binary file not shown.
2 changes: 2 additions & 0 deletions features/fixtures/rubygems/Marshal.4.8.Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x��T]k�@MK���[lY-*C|l6-ꄖ��7iS_�Pb�����pf"]|� ��}�x3��Q�k_LB����q�bWl�=��T�� *�p�cNx��jG��9R����wq�&�����,U�*���V�d�v�oo_gr�:J+>e��DDB"��m�a���v���w ��}4jAT���6�� (�T �����C��9�i`�-�}�|��q���mj�PN^fSg/�p YU�[ �ż��H��5�Uє
�c�a-@�R #�~1[8�P��~{i��2����'�e�^O��`6��_�+�r�Er�j6v��6����z�I��{��K�^������{��=#,Vst��:3����n�g��@Fߔt�=F-h-�K����Qg/���MWQ���Y^�9���ʼ�W:� ^���48��`�h�67�/?���S��ԛ'��\m��-O���_���/��1�-�~�U%N
46 changes: 46 additions & 0 deletions features/fixtures/rubygems/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require 'bundler/setup'
require 'rake/clean'

CLEAN.include 'src/*.gem'
CLOBBER.include '*.4.8'
CLOBBER.include '*.4.8.gz'
CLOBBER.include '*.4.8.Z'
CLOBBER.include 'gems/'
CLOBBER.include 'quick/'

# Target directory
directory 'gems'

# Run `gem` command without bundler's environment to avoid indexing
# whole bundle
def gem(command, dir='.')
Dir.chdir(dir) do
Bundler.with_clean_env do
sh "gem #{command}"
end
end
end

# Build all gems in src/
GEMS = Dir['src/*.gemspec'].map do |gemspec|
gem_name = File.basename(gemspec, '.gemspec')
gem_filename = "#{gem_name}-0.gem"

file "gems/#{gem_filename}" => [ gemspec, 'gems' ] do
gem "build #{File.basename(gemspec)}", 'src'
mv "src/#{gem_filename}", "gems/#{gem_filename}"
end
end

# Fetch a "Hello, World" gem
GEMS << file("gems/hello-0.0.1.gem" => 'gems') do
gem 'fetch hello', 'gems'
end

# Regenerate index
file 'specs.4.8' => GEMS do
gem "generate_index"
end

#
task :default => 'specs.4.8'
Binary file added features/fixtures/rubygems/gems/first-0.gem
Binary file not shown.
Binary file added features/fixtures/rubygems/gems/hello-0.0.1.gem
Binary file not shown.
Binary file added features/fixtures/rubygems/gems/second-0.gem
Binary file not shown.
Binary file added features/fixtures/rubygems/latest_specs.4.8
Binary file not shown.
Binary file added features/fixtures/rubygems/latest_specs.4.8.gz
Binary file not shown.
Binary file added features/fixtures/rubygems/prerelease_specs.4.8
Binary file not shown.
Binary file added features/fixtures/rubygems/prerelease_specs.4.8.gz
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
x�=O�
�0�PbJ�)�ɥD7ST��蒩֓F�gڂn>���C�����~�δ�l!�tWB,�"�jQ䝷iq'p�ě{3Dњ ��Ҵ@���t�Y���s��ě�dž���`�x�����k"ū�-��p�︔����hk�����A^s���h�>�ېvA�'���7� �+� KD�UE�J
Y�� �X��}��d�����F�
Binary file not shown.
Binary file added features/fixtures/rubygems/specs.4.8
Binary file not shown.
Binary file added features/fixtures/rubygems/specs.4.8.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions features/fixtures/rubygems/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Test gems
=========

The gems `first` and `second` (on which `first` depends) are used for tests.
16 changes: 16 additions & 0 deletions features/fixtures/rubygems/src/first.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Gem::Specification.new do |gem|
gem.name = "first"
gem.version = '0'
gem.authors = ["Test"]
gem.email = ["[email protected]"]
gem.summary = "First test gem"
gem.description = "First test gem, the"
gem.homepage = "http://example.com/"

gem.files = [ 'README.md' ]
gem.executables = []
gem.test_files = []
gem.require_paths = [ 'lib' ]

gem.add_dependency "second"
end
14 changes: 14 additions & 0 deletions features/fixtures/rubygems/src/second.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Gem::Specification.new do |gem|
gem.name = "second"
gem.version = '0'
gem.authors = ["Test"]
gem.email = ["[email protected]"]
gem.summary = "Second test gem"
gem.description = "Second test gem, the"
gem.homepage = "http://example.com/"

gem.files = [ 'README.md' ]
gem.executables = []
gem.test_files = []
gem.require_paths = [ 'lib' ]
end
Loading

0 comments on commit ae904f0

Please sign in to comment.