Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'crafterm/master'

Conflicts:
	spec/sprinkle/installers/pear_spec.rb
  • Loading branch information...
commit 4115242fbf9f9797527ec05d91a54e66894d39b2 2 parents 646cf62 + 8447594
@jbottigliero jbottigliero authored
View
3  Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+
+gemspec
View
52 Gemfile.lock
@@ -0,0 +1,52 @@
+PATH
+ remote: .
+ specs:
+ sprinkle (0.4.2)
+ activesupport (>= 2.0.2)
+ capistrano (>= 2.5.5)
+ highline (>= 1.4.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.2.9)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ capistrano (2.13.5)
+ highline
+ net-scp (>= 1.0.0)
+ net-sftp (>= 2.0.0)
+ net-ssh (>= 2.0.14)
+ net-ssh-gateway (>= 1.1.0)
+ diff-lcs (1.1.3)
+ highline (1.6.15)
+ i18n (0.6.1)
+ json (1.7.5)
+ multi_json (1.3.7)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-sftp (2.0.5)
+ net-ssh (>= 2.0.9)
+ net-ssh (2.6.1)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ rake (10.0.1)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.12.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rspec-core (2.12.0)
+ rspec-expectations (2.12.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.12.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rake (>= 0.8.7)
+ rdoc (>= 3.12)
+ rspec (>= 2.5)
+ sprinkle!
View
5 README.markdown
@@ -5,8 +5,11 @@
* <http://github.com/benschwarz/passenger-stack>
* <http://github.com/trevorturk/sprinkle-packages>
* <http://www.vimeo.com/2888665>
-* <http://redartisan.lighthouseapp.com/projects/25275-sprinkle/tickets>
* <http://maxim.github.com/sprinkle-cheatsheet>
+* <http://github.com/mingalar/sprinkle-packages>
+* <http://github.com/stuartellis/spritz>
+* <http://engineering.gomiso.com/2011/08/26/forget-chef-or-puppet-automate-with-sprinkle/>
+
## DESCRIPTION:
View
31 Rakefile
@@ -1,35 +1,12 @@
require 'rubygems'
require 'rake'
require 'rspec/core/rake_task'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "sprinkle"
- gem.summary = "Ruby DSL based software provisioning tool"
- gem.description = "Ruby DSL based software provisioning tool"
- gem.email = "crafterm@redartisan.com"
- gem.rubyforge_project = 'sprinkle'
- gem.homepage = "http://github.com/crafterm/sprinkle"
- gem.authors = ["Marcus Crafter"]
- gem.add_development_dependency("rspec", ">= 2.5")
- gem.add_dependency('activesupport', '>= 2.0.2')
- gem.add_dependency('highline', '>= 1.4.0')
- gem.add_dependency('capistrano', '>= 2.5.5')
-
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
-end
+require 'rdoc/task'
task "inst" => [:clobber, :build] do
puts `gem install pkg/sprinkle-*.gem`
end
-task :spec => :check_dependencies
-
desc 'Default: run specs.'
task :default => :spec
@@ -46,13 +23,11 @@ RSpec::Core::RakeTask.new(:coverage) do |t|
t.rcov_opts = ['--exclude', 'spec']
end
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
+RDoc::Task.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "sprinkle #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
-end
+end
View
8 lib/sprinkle/installers/binary.rb
@@ -24,10 +24,14 @@ def prepare_commands #:nodoc:
def install_commands #:nodoc:
commands = [ "bash -c 'wget -cq --directory-prefix=#{@options[:archives].first} #{@binary_archive}'" ]
- commands << "bash -c 'cd #{@options[:prefix].first} && #{extract_command} #{@options[:archives].first}/#{@binary_archive.split("/").last}'"
+ commands << "bash -c \"cd #{@options[:prefix].first} && #{extract_command} '#{@options[:archives].first}/#{archive_name}'\""
end
- def extract_command(archive_name = @binary_archive.split("/").last)
+ def archive_name
+ @archive_name ||= @binary_archive.split("/").last.gsub('%20', ' ')
+ end
+
+ def extract_command
case archive_name
when /(tar.gz)|(tgz)$/
'tar xzf'
View
36 spec/sprinkle/installers/binary_spec.rb
@@ -3,25 +3,23 @@
describe Sprinkle::Installers::Binary do
include Sprinkle::Deployment
- def create_context
- binary = 'http://www.example.com/archive.tar.gz'
-
+ def create_context(source = 'http://www.example.com/archive.tar.gz')
deployment = deployment do
delivery :capistrano
- binary "http://www.example.com/archive.tar.gz" do
+ binary source do
prefix '/prefix/directory'
archives '/archives/directory'
end
end
- installer = create_binary binary do
+ installer = create_binary source do
prefix '/prefix/directory'
archives '/archives/directory'
end
installer.defaults(@deployment)
-
- [binary, deployment, installer]
+
+ [source, deployment, installer]
end
def create_binary(binary, version = nil, &block)
@@ -33,7 +31,7 @@ def create_binary(binary, version = nil, &block)
before do
@binary, @deployment, @installer = create_context
end
-
+
it "should return mkdir command to create the prefix directory" do
@installer.send(:prepare_commands)[0].should == 'mkdir -p /prefix/directory'
end
@@ -41,24 +39,34 @@ def create_binary(binary, version = nil, &block)
@installer.send(:prepare_commands)[1].should == 'mkdir -p /archives/directory'
end
end
-
-
+
+
describe "binary#install_commands" do
before do
@binary, @deployment, @installer = create_context
end
-
+
it "should return a commands to place the binary in the correct archive directory" do
@installer.send(:install_commands)[0].should =~ /--directory-prefix=\/archives\/directory/
end
-
+
it "should return a command to extract to the correct prefix folder" do
@installer.send(:install_commands)[1].should =~ /cd \/prefix\/directory/
end
it "should return a command to extract the right file in the right directory" do
- @installer.send(:install_commands)[1].should =~ / \/archives\/directory\/archive.tar.gz/
+ @installer.send(:install_commands)[1].should =~ / '\/archives\/directory\/archive.tar.gz'/
end
end
-
+
+ describe "when source contains spaces (%20's) in path" do
+ before do
+ _, _, @installer = create_context('http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2')
+ end
+
+ it "should correctly interpret the archive filename as it gets extracted downloaded to file system" do
+ @installer.send(:install_commands)[1].should =~ / '\/archives\/directory\/Sublime Text 2.0.1 x64.tar.bz2'/
+ end
+ end
+
end
View
7 spec/sprinkle/installers/pear_spec.rb
@@ -4,16 +4,11 @@
before do
@package = mock(Sprinkle::Package, :name => 'spec')
- end
-
- def create_pear(names, options = {}, &block)
- Sprinkle::Installers::Pear.new(@package, names, options, &block)
+ @installer = Sprinkle::Installers::Pear.new(@package, 'spec')
end
describe 'during installation' do
-
it 'should invoke the pear executer for all specified tasks' do
- @installer = create_pear 'spec'
@install_commands = @installer.send :install_commands
@install_commands.should == "pear install --alldeps spec"
end
View
35 sprinkle.gemspec
@@ -1,8 +1,3 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
-# -*- encoding: utf-8 -*-
-
Gem::Specification.new do |s|
s.name = %q{sprinkle}
s.version = "0.4.2"
@@ -14,10 +9,6 @@ Gem::Specification.new do |s|
s.description = %q{Ruby DSL based software provisioning tool}
s.email = %q{crafterm@redartisan.com}
s.executables = ["sprinkle"]
- s.extra_rdoc_files = [
- "README.markdown",
- "TODO"
- ]
s.files = [
"CREDITS",
"MIT-LICENSE",
@@ -149,25 +140,11 @@ Gem::Specification.new do |s|
s.rubygems_version = %q{1.4.2}
s.summary = %q{Ruby DSL based software provisioning tool}
- if s.respond_to? :specification_version then
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 2.5"])
- s.add_runtime_dependency(%q<activesupport>, [">= 2.0.2"])
- s.add_runtime_dependency(%q<highline>, [">= 1.4.0"])
- s.add_runtime_dependency(%q<capistrano>, [">= 2.5.5"])
- else
- s.add_dependency(%q<rspec>, [">= 2.5"])
- s.add_dependency(%q<activesupport>, [">= 2.0.2"])
- s.add_dependency(%q<highline>, [">= 1.4.0"])
- s.add_dependency(%q<capistrano>, [">= 2.5.5"])
- end
- else
- s.add_dependency(%q<rspec>, [">= 2.5"])
- s.add_dependency(%q<activesupport>, [">= 2.0.2"])
- s.add_dependency(%q<highline>, [">= 1.4.0"])
- s.add_dependency(%q<capistrano>, [">= 2.5.5"])
- end
+ s.add_development_dependency(%q<rspec>, [">= 2.5"])
+ s.add_development_dependency(%q<rake>, [">= 0.8.7"])
+ s.add_development_dependency(%q<rdoc>, [">= 3.12"])
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.0.2"])
+ s.add_runtime_dependency(%q<highline>, [">= 1.4.0"])
+ s.add_runtime_dependency(%q<capistrano>, [">= 2.5.5"])
end
Please sign in to comment.
Something went wrong with that request. Please try again.