vito 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +11 -0
  3. data/README.md +32 -19
  4. data/Rakefile +5 -20
  5. data/bin/vito +1 -1
  6. data/lib/vito.rb +5 -1
  7. data/lib/vito/command_line/command.rb +21 -0
  8. data/lib/vito/command_line/document_flags.rb +30 -0
  9. data/lib/vito/command_line/options.rb +41 -0
  10. data/lib/vito/command_line/string.rb +35 -0
  11. data/lib/vito/commands/help.rb +62 -0
  12. data/lib/vito/commands/install.rb +17 -0
  13. data/lib/vito/core_ext/string.rb +33 -0
  14. data/lib/vito/dsl/installation.rb +5 -2
  15. data/lib/vito/dsl/server.rb +3 -3
  16. data/lib/vito/dsl_file.rb +11 -5
  17. data/lib/vito/operating_systems/ubuntu_10.rb +4 -0
  18. data/lib/vito/output.rb +3 -1
  19. data/lib/vito/recipe.rb +29 -4
  20. data/lib/vito/recipes/apache/install.rb +155 -0
  21. data/lib/vito/recipes/apache/service.rb +20 -0
  22. data/lib/vito/recipes/git/install.rb +39 -0
  23. data/lib/vito/recipes/passenger/install.rb +83 -0
  24. data/lib/vito/recipes/passenger/paths.rb +27 -0
  25. data/lib/vito/recipes/postgres/install.rb +106 -0
  26. data/lib/vito/recipes/rbenv/install.rb +54 -0
  27. data/lib/vito/recipes/ruby/install.rb +57 -0
  28. data/lib/vito/recipes/ruby/paths.rb +19 -0
  29. data/lib/vito/tasks/vagrant_bootstrap.rb +49 -0
  30. data/lib/vito/tests/vagrant_test_box.rb +44 -0
  31. data/lib/vito/utils/program_version.rb +2 -2
  32. data/lib/vito/version.rb +1 -1
  33. data/spec/acceptance/recipes/apache_acceptance_spec.rb +25 -0
  34. data/spec/acceptance/recipes/git_acceptance_spec.rb +11 -11
  35. data/spec/acceptance/recipes/postgres_acceptance_spec.rb +11 -11
  36. data/spec/acceptance/recipes/rbenv_acceptance_spec.rb +13 -13
  37. data/spec/acceptance/recipes/ruby_acceptance_spec.rb +15 -15
  38. data/spec/support/vagrant.rb +21 -16
  39. data/spec/vagrant_boxes/centos63/.gitkeep +0 -0
  40. data/{Vagrantfile → spec/vagrant_boxes/centos63/Vagrantfile} +5 -4
  41. data/spec/vagrant_boxes/ubuntu10/Vagrantfile +100 -0
  42. data/spec/vagrant_boxes/ubuntu12/Vagrantfile +100 -0
  43. data/spec/vito/command_line/command_spec.rb +20 -0
  44. data/spec/vito/command_line/options_spec.rb +50 -0
  45. data/spec/vito/command_line/string_spec.rb +32 -0
  46. data/spec/vito/commands/install_spec.rb +9 -0
  47. data/spec/vito/connection_spec.rb +2 -2
  48. data/spec/vito/core_ext/string_spec.rb +19 -0
  49. data/spec/vito/dsl/installation_spec.rb +2 -2
  50. data/spec/vito/dsl_file_spec.rb +56 -18
  51. data/spec/vito/output_spec.rb +2 -2
  52. data/spec/vito/recipe_spec.rb +53 -3
  53. data/spec/vito/recipes/apache/install_spec.rb +140 -0
  54. data/spec/vito/recipes/passenger/paths_spec.rb +18 -0
  55. data/spec/vito/recipes/ruby_spec.rb +5 -5
  56. data/spec/vito/tasks/vagrant_bootstrap_spec.rb +65 -0
  57. data/spec/vito/tests/vagrant_test_box_spec.rb +69 -0
  58. data/spec/vito/utils/program_version_spec.rb +4 -2
  59. data/templates/apache2/vito_site +12 -0
  60. data/vito.gemspec +1 -1
  61. data/vito.rb +7 -5
  62. metadata +53 -13
  63. data/lib/vito/recipes/git.rb +0 -37
  64. data/lib/vito/recipes/postgres.rb +0 -104
  65. data/lib/vito/recipes/rbenv.rb +0 -47
  66. data/lib/vito/recipes/ruby.rb +0 -43
  67. data/lib/vito/shell_initializer.rb +0 -21
  68. data/spec/vito/shell_initializer_spec.rb +0 -22
@@ -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