vito 0.0.4 → 0.0.5
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 +4 -4
- data/.travis.yml +11 -0
- data/README.md +32 -19
- data/Rakefile +5 -20
- data/bin/vito +1 -1
- data/lib/vito.rb +5 -1
- data/lib/vito/command_line/command.rb +21 -0
- data/lib/vito/command_line/document_flags.rb +30 -0
- data/lib/vito/command_line/options.rb +41 -0
- data/lib/vito/command_line/string.rb +35 -0
- data/lib/vito/commands/help.rb +62 -0
- data/lib/vito/commands/install.rb +17 -0
- data/lib/vito/core_ext/string.rb +33 -0
- data/lib/vito/dsl/installation.rb +5 -2
- data/lib/vito/dsl/server.rb +3 -3
- data/lib/vito/dsl_file.rb +11 -5
- data/lib/vito/operating_systems/ubuntu_10.rb +4 -0
- data/lib/vito/output.rb +3 -1
- data/lib/vito/recipe.rb +29 -4
- data/lib/vito/recipes/apache/install.rb +155 -0
- data/lib/vito/recipes/apache/service.rb +20 -0
- data/lib/vito/recipes/git/install.rb +39 -0
- data/lib/vito/recipes/passenger/install.rb +83 -0
- data/lib/vito/recipes/passenger/paths.rb +27 -0
- data/lib/vito/recipes/postgres/install.rb +106 -0
- data/lib/vito/recipes/rbenv/install.rb +54 -0
- data/lib/vito/recipes/ruby/install.rb +57 -0
- data/lib/vito/recipes/ruby/paths.rb +19 -0
- data/lib/vito/tasks/vagrant_bootstrap.rb +49 -0
- data/lib/vito/tests/vagrant_test_box.rb +44 -0
- data/lib/vito/utils/program_version.rb +2 -2
- data/lib/vito/version.rb +1 -1
- data/spec/acceptance/recipes/apache_acceptance_spec.rb +25 -0
- data/spec/acceptance/recipes/git_acceptance_spec.rb +11 -11
- data/spec/acceptance/recipes/postgres_acceptance_spec.rb +11 -11
- data/spec/acceptance/recipes/rbenv_acceptance_spec.rb +13 -13
- data/spec/acceptance/recipes/ruby_acceptance_spec.rb +15 -15
- data/spec/support/vagrant.rb +21 -16
- data/spec/vagrant_boxes/centos63/.gitkeep +0 -0
- data/{Vagrantfile → spec/vagrant_boxes/centos63/Vagrantfile} +5 -4
- data/spec/vagrant_boxes/ubuntu10/Vagrantfile +100 -0
- data/spec/vagrant_boxes/ubuntu12/Vagrantfile +100 -0
- data/spec/vito/command_line/command_spec.rb +20 -0
- data/spec/vito/command_line/options_spec.rb +50 -0
- data/spec/vito/command_line/string_spec.rb +32 -0
- data/spec/vito/commands/install_spec.rb +9 -0
- data/spec/vito/connection_spec.rb +2 -2
- data/spec/vito/core_ext/string_spec.rb +19 -0
- data/spec/vito/dsl/installation_spec.rb +2 -2
- data/spec/vito/dsl_file_spec.rb +56 -18
- data/spec/vito/output_spec.rb +2 -2
- data/spec/vito/recipe_spec.rb +53 -3
- data/spec/vito/recipes/apache/install_spec.rb +140 -0
- data/spec/vito/recipes/passenger/paths_spec.rb +18 -0
- data/spec/vito/recipes/ruby_spec.rb +5 -5
- data/spec/vito/tasks/vagrant_bootstrap_spec.rb +65 -0
- data/spec/vito/tests/vagrant_test_box_spec.rb +69 -0
- data/spec/vito/utils/program_version_spec.rb +4 -2
- data/templates/apache2/vito_site +12 -0
- data/vito.gemspec +1 -1
- data/vito.rb +7 -5
- metadata +53 -13
- data/lib/vito/recipes/git.rb +0 -37
- data/lib/vito/recipes/postgres.rb +0 -104
- data/lib/vito/recipes/rbenv.rb +0 -47
- data/lib/vito/recipes/ruby.rb +0 -43
- data/lib/vito/shell_initializer.rb +0 -21
- data/spec/vito/shell_initializer_spec.rb +0 -22
data/lib/vito/recipes/ruby.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
module Vito
|
2
|
-
module Recipes
|
3
|
-
class Ruby < Vito::Recipe
|
4
|
-
def run
|
5
|
-
if ruby_exists?
|
6
|
-
Vito::Log.write "Ruby version #{version} is already installed."
|
7
|
-
else
|
8
|
-
Vito::Log.write "Installing Ruby"
|
9
|
-
install_os_dependencies
|
10
|
-
depends_on_recipe(:rbenv)
|
11
|
-
install_ruby
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def install_ruby
|
16
|
-
string = []
|
17
|
-
string << "rbenv install #{version}"
|
18
|
-
string << "rbenv global #{version}"
|
19
|
-
string << "rbenv rehash"
|
20
|
-
string << "gem install bundler"
|
21
|
-
run_command string.join(" && ")
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def ruby_exists?
|
27
|
-
program_version("ruby -v").matches?(version)
|
28
|
-
end
|
29
|
-
|
30
|
-
def os_dependencies
|
31
|
-
%w(build-essential openssl libreadline6
|
32
|
-
libreadline6-dev zlib1g zlib1g-dev libssl-dev
|
33
|
-
libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3
|
34
|
-
libxml2-dev libxslt1-dev autoconf libc6-dev
|
35
|
-
libncurses5-dev)
|
36
|
-
end
|
37
|
-
|
38
|
-
def version
|
39
|
-
@options[:version]
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require "vito/recipes/ruby"
|
2
|
-
|
3
|
-
module Vito
|
4
|
-
class ShellInitializer
|
5
|
-
def initialize(argv)
|
6
|
-
@argv = argv
|
7
|
-
end
|
8
|
-
|
9
|
-
def run
|
10
|
-
Vito::DslFile.new(argv).run(vito_file)
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
attr_reader :argv
|
16
|
-
|
17
|
-
def vito_file
|
18
|
-
File.open("vito.rb").read
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Vito::ShellInitializer do
|
4
|
-
subject { described_class.new(:argv) }
|
5
|
-
|
6
|
-
describe "#run" do
|
7
|
-
let(:recipes) { double }
|
8
|
-
let(:dsl) { double }
|
9
|
-
let(:file) { double }
|
10
|
-
|
11
|
-
before do
|
12
|
-
File.stub(:open).with("vito.rb") { file }
|
13
|
-
file.stub(:read) { :vitorb }
|
14
|
-
end
|
15
|
-
|
16
|
-
it "uses ./vito.rb by default" do
|
17
|
-
dsl.should_receive(:run).with(:vitorb)
|
18
|
-
Vito::DslFile.stub(:new).with(:argv) { dsl }
|
19
|
-
subject.run
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|