santa 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/Manifest +1 -1
- data/README.md +8 -2
- data/bin/santa +4 -2
- data/lib/santa.rb +5 -2
- data/santa.gemspec +2 -2
- data/test/test_all.rb +10 -2
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Manifest
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,13 @@ You can with santa.
|
|
8
8
|
|
9
9
|
$ gem install santa
|
10
10
|
|
11
|
-
$
|
11
|
+
$ cat <<EOF > Debfile
|
12
|
+
deb "ruby1.9.1-dev"
|
13
|
+
deb "nginx", repo: "ppa:nginx/stable"
|
14
|
+
EOF
|
12
15
|
|
13
16
|
$ santa
|
14
|
-
|
17
|
+
--> sudo add-apt-repository -y ppa:nginx/stable
|
18
|
+
--> sudo apt-get update
|
19
|
+
--> sudo apt-get install -y ruby1.9.1-dev
|
20
|
+
--> sudo apt-get install -y nginx
|
data/bin/santa
CHANGED
data/lib/santa.rb
CHANGED
@@ -13,7 +13,10 @@ class Santa
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def deb(debname, opts={})
|
16
|
-
|
16
|
+
if(r = opts.delete(:repo))
|
17
|
+
repo(*r)
|
18
|
+
end
|
19
|
+
append_cmd 'apt-get', 'install', '-y', debname.to_s
|
17
20
|
end
|
18
21
|
|
19
22
|
def cmd(*cmds)
|
@@ -40,7 +43,7 @@ class Santa
|
|
40
43
|
|
41
44
|
def repo(*repos, &bl)
|
42
45
|
repos.each {|r| prepend_cmd 'add-apt-repository', '-y', r.to_s }
|
43
|
-
prepend_cmd 'apt-get', 'install', 'python-software-properties' unless executable? 'add-apt-repository'
|
46
|
+
prepend_cmd 'apt-get', 'install', '-y', 'python-software-properties' unless executable? 'add-apt-repository'
|
44
47
|
|
45
48
|
instance_eval &bl if bl
|
46
49
|
end
|
data/santa.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "santa"
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Andrew Snow"]
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.email = "andrew@modulus.org"
|
12
12
|
s.executables = ["santa"]
|
13
13
|
s.extra_rdoc_files = ["CHANGELOG", "README.md", "bin/santa", "lib/santa.rb"]
|
14
|
-
s.files = ["CHANGELOG", "README.md", "Rakefile", "bin/santa", "lib/santa.rb", "test/test_all.rb", "
|
14
|
+
s.files = ["CHANGELOG", "Manifest", "README.md", "Rakefile", "bin/santa", "lib/santa.rb", "test/test_all.rb", "santa.gemspec"]
|
15
15
|
s.homepage = "https://github.com/andys/santa"
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Santa", "--main", "README.md"]
|
17
17
|
s.require_paths = ["lib"]
|
data/test/test_all.rb
CHANGED
@@ -9,7 +9,7 @@ class TestSanta < Test::Unit::TestCase
|
|
9
9
|
|
10
10
|
def test_command
|
11
11
|
@santa.deb 'xyz'
|
12
|
-
assert_equal [["apt-get", "update"], ["apt-get", "install", "xyz"]], @santa.commands_to_run
|
12
|
+
assert_equal [["apt-get", "update"], ["apt-get", "install", "-y", "xyz"]], @santa.commands_to_run
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_add_repo
|
@@ -18,9 +18,17 @@ class TestSanta < Test::Unit::TestCase
|
|
18
18
|
deb 'xyz'
|
19
19
|
end
|
20
20
|
end
|
21
|
-
assert_equal [["add-apt-repository", "-y", "rrr"],["apt-get", "update"], ["apt-get", "install", "xyz"]], @santa.commands_to_run
|
21
|
+
assert_equal [["add-apt-repository", "-y", "rrr"],["apt-get", "update"], ["apt-get", "install", "-y", "xyz"]], @santa.commands_to_run
|
22
22
|
end
|
23
23
|
|
24
|
+
def test_add_repo
|
25
|
+
@santa.instance_eval do
|
26
|
+
deb 'xyz', repo: 'rrr'
|
27
|
+
end
|
28
|
+
assert_equal [["add-apt-repository", "-y", "rrr"],["apt-get", "update"], ["apt-get", "install", "-y", "xyz"]], @santa.commands_to_run
|
29
|
+
end
|
30
|
+
|
31
|
+
|
24
32
|
|
25
33
|
end
|
26
34
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: santa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: '0.
|
5
|
+
version: '0.2'
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrew Snow
|
@@ -23,12 +23,12 @@ extra_rdoc_files:
|
|
23
23
|
- lib/santa.rb
|
24
24
|
files:
|
25
25
|
- CHANGELOG
|
26
|
+
- Manifest
|
26
27
|
- README.md
|
27
28
|
- Rakefile
|
28
29
|
- bin/santa
|
29
30
|
- lib/santa.rb
|
30
31
|
- test/test_all.rb
|
31
|
-
- Manifest
|
32
32
|
- santa.gemspec
|
33
33
|
homepage: https://github.com/andys/santa
|
34
34
|
licenses: []
|