tango 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tango (0.1.0)
4
+ tango (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/bin/tango CHANGED
@@ -3,8 +3,11 @@
3
3
  $LOAD_PATH << File.expand_path(File.dirname(__FILE__) + "/../lib")
4
4
  require 'tango'
5
5
 
6
- load ARGV[0]
6
+ if ARGV[0].nil?
7
+ Tango.print_usage
8
+ exit
9
+ end
7
10
 
8
- namespace_name, step_name = ARGV[1].split(".")
11
+ load "./tango.rb"
9
12
 
10
- Object.const_get(namespace_name).new.run(step_name)
13
+ eval ARGV[0]
@@ -14,6 +14,10 @@ module Tango
14
14
  in_context(Umask.new(umask), &block)
15
15
  end
16
16
 
17
+ def as_user(user, &block)
18
+ as_user(User.new(umask), &block)
19
+ end
20
+
17
21
  end
18
22
  end
19
23
  end
@@ -2,3 +2,4 @@ require 'tango/contexts/chain'
2
2
  require 'tango/contexts/directory'
3
3
  require 'tango/contexts/helpers'
4
4
  require 'tango/contexts/umask'
5
+ require 'tango/contexts/user'
data/lib/tango/runner.rb CHANGED
@@ -32,8 +32,6 @@ module Tango
32
32
  description
33
33
  end
34
34
 
35
- alias_method :run, :send
36
-
37
35
  delegate :log, :log_raw, :to => :logger
38
36
 
39
37
  def logger
@@ -0,0 +1,10 @@
1
+ require 'tango/version'
2
+
3
+ module Tango
4
+ def self.print_usage
5
+ puts <<-USAGE
6
+ Tango v#{Tango::VERSION}
7
+ usage: tango <ruby code to eval>
8
+ USAGE
9
+ end
10
+ end
data/lib/tango/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tango
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/tango.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'tango/config_files'
1
2
  require 'tango/contexts'
2
3
  require 'tango/logger'
3
4
  require 'tango/runner'
5
+ require 'tango/usage'
data/spec/runner_spec.rb CHANGED
@@ -24,7 +24,7 @@ module Tango
24
24
  end
25
25
  end
26
26
 
27
- runner.new.run "example step"
27
+ runner.new.send "example step"
28
28
  step_run.should be_true
29
29
  end
30
30
 
@@ -33,7 +33,7 @@ module Tango
33
33
 
34
34
  runner = Class.new(StubbedRunner) do
35
35
  step "outer step" do
36
- run "inner step"
36
+ send "inner step"
37
37
  end
38
38
 
39
39
  step "inner step" do
@@ -41,7 +41,7 @@ module Tango
41
41
  end
42
42
  end
43
43
 
44
- runner.new.run "outer step"
44
+ runner.new.send "outer step"
45
45
  inner_step_run.should be_true
46
46
  end
47
47
 
@@ -54,13 +54,13 @@ module Tango
54
54
  end
55
55
  end
56
56
 
57
- runner.new.run "example step", 1, 2
57
+ runner.new.send "example step", 1, 2
58
58
  end
59
59
 
60
60
  it "should pass arguments when running other steps" do
61
61
  runner = Class.new(StubbedRunner) do
62
62
  step "outer step" do
63
- run "inner step", 1, 2
63
+ send "inner step", 1, 2
64
64
  end
65
65
 
66
66
  step "inner step" do |a, b|
@@ -69,7 +69,7 @@ module Tango
69
69
  end
70
70
  end
71
71
 
72
- runner.new.run "outer step"
72
+ runner.new.send "outer step"
73
73
  end
74
74
  end
75
75
 
data/spec/shell_spec.rb CHANGED
@@ -31,6 +31,11 @@ module Tango
31
31
  result.output.should == "Hello, world!\n"
32
32
  end
33
33
 
34
+ it "catches stderr too" do
35
+ result = @stub_class.new.shell("echo 'Hello, world!' 1>&2")
36
+ result.output.should == "Hello, world!\n"
37
+ end
38
+
34
39
  it "should echo the command and its output" do
35
40
  @stub = @stub_class.new
36
41
  @stub.should_receive(:log).with("% echo Hello, world!\n\n").once.ordered
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tango
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pete Yandell
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-14 00:00:00 +10:00
19
- default_executable:
18
+ date: 2011-06-30 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: rspec
@@ -64,6 +63,7 @@ files:
64
63
  - lib/tango/met_and_meet.rb
65
64
  - lib/tango/runner.rb
66
65
  - lib/tango/shell.rb
66
+ - lib/tango/usage.rb
67
67
  - lib/tango/version.rb
68
68
  - spec/config_files_spec.rb
69
69
  - spec/contexts/chain_spec.rb
@@ -75,7 +75,6 @@ files:
75
75
  - spec/shell_spec.rb
76
76
  - tango.gemspec
77
77
  - tmp/.gitignore
78
- has_rdoc: true
79
78
  homepage: ""
80
79
  licenses: []
81
80
 
@@ -105,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
104
  requirements: []
106
105
 
107
106
  rubyforge_project: tango
108
- rubygems_version: 1.6.2
107
+ rubygems_version: 1.8.5
109
108
  signing_key:
110
109
  specification_version: 3
111
110
  summary: Experiment in deployment tools.