cumuli 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/cumuli/cli.rb +2 -1
- data/lib/cumuli/cli/remote_commander.rb +22 -0
- data/lib/cumuli/cli/{remote_command.rb → remote_rake_command.rb} +3 -1
- data/lib/cumuli/project_manager/manager.rb +4 -0
- data/lib/cumuli/project_manager/project.rb +4 -2
- data/lib/cumuli/tasks/cumuli.rake +1 -1
- data/lib/cumuli/version.rb +1 -1
- data/spec/cli/{remote_command_spec.rb → remote_rake_command_spec.rb} +2 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c828aab63a3177d3992d14012d752c8c4609e5e1
|
4
|
+
data.tar.gz: 1545d8af40410e37d56963380e202ecee9d7503e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f27e860d19b2b417b63ec5955d88a1bac421a8f735db2593e9c2a446563a1bab4e89c609b97121f4555e9a0a3c0bf1b4079d715b3cdad008839dbb13c5762cb2
|
7
|
+
data.tar.gz: 14a2340512e2dcd478e61111e458acb276043b4f5915c9d876bd5f3cbda1555362de5f8a5a4a9f6bc28ed03d38b2d0420ba0e1dc27e2a68c25ef595d2d3ee53a
|
data/README.md
CHANGED
data/lib/cumuli/cli.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Cumuli
|
2
|
+
class CLI
|
3
|
+
class RemoteCommander
|
4
|
+
attr_reader :raw_command, :dir
|
5
|
+
|
6
|
+
def initialize(command, dir)
|
7
|
+
@raw_command = command
|
8
|
+
@dir = dir
|
9
|
+
end
|
10
|
+
|
11
|
+
def command
|
12
|
+
Commander.new(raw_command).build
|
13
|
+
end
|
14
|
+
|
15
|
+
def perform
|
16
|
+
Dir.chdir(dir) do
|
17
|
+
Terminal.new(command).spawn
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module Cumuli
|
2
2
|
class CLI
|
3
|
-
class
|
3
|
+
class RemoteRakeCommand
|
4
4
|
attr_reader :argv
|
5
5
|
|
6
6
|
DIR_ENV = 'DIR='
|
7
7
|
COMMAND_ENV= 'COMMAND='
|
8
8
|
|
9
9
|
def initialize(argv)
|
10
|
+
puts "argv: #{argv.inspect}"
|
10
11
|
@argv = argv
|
11
12
|
end
|
12
13
|
|
@@ -34,6 +35,7 @@ module Cumuli
|
|
34
35
|
|
35
36
|
def perform
|
36
37
|
Dir.chdir(dir) do
|
38
|
+
puts "running #{command}, at #{dir}"
|
37
39
|
Terminal.new(command).spawn
|
38
40
|
end
|
39
41
|
end
|
@@ -40,6 +40,10 @@ module Cumuli
|
|
40
40
|
@projects ||= config.map{ |name, opts| Cumuli::ProjectManager::Project.new(name, opts) }
|
41
41
|
end
|
42
42
|
|
43
|
+
def project(name)
|
44
|
+
projects.detect{|p| p.name == name}
|
45
|
+
end
|
46
|
+
|
43
47
|
def config
|
44
48
|
@config ||= YAML.load( File.read(config_path) )
|
45
49
|
end
|
@@ -96,9 +96,11 @@ module Cumuli
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def run_command(command)
|
99
|
-
|
100
|
-
|
99
|
+
puts "#{ANSI.blue_on_red} #{name}: #{command} #{ANSI.ansi}"
|
100
|
+
pid = fork do
|
101
|
+
CLI::RemoteCommander.new(command, path).perform
|
101
102
|
end
|
103
|
+
Process.wait pid
|
102
104
|
end
|
103
105
|
|
104
106
|
def setup
|
@@ -61,6 +61,6 @@ namespace :cumuli do
|
|
61
61
|
|
62
62
|
desc "run a remote command with the right ruby: rake cumuli:remote ../my_app rake db:migrate"
|
63
63
|
task :remote do |command|
|
64
|
-
Cumuli::CLI::
|
64
|
+
Cumuli::CLI::RemoteRakeCommand.new(ARGV).perform
|
65
65
|
end
|
66
66
|
end
|
data/lib/cumuli/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Cumuli::CLI::
|
3
|
+
describe Cumuli::CLI::RemoteRakeCommand do
|
4
4
|
let(:argv) { ["cumuli:remote[rake db:migrate]", "DIR=./mactivator"] }
|
5
|
-
let(:remote_command) { Cumuli::CLI::
|
5
|
+
let(:remote_command) { Cumuli::CLI::RemoteRakeCommand.new(argv) }
|
6
6
|
|
7
7
|
it "parses the directory from the arguments" do
|
8
8
|
remote_command.dir.should == "./mactivator"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cumuli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SocialChorus
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-
|
16
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: foreman
|
@@ -111,7 +111,8 @@ files:
|
|
111
111
|
- lib/cumuli/cli/args.rb
|
112
112
|
- lib/cumuli/cli/cli.rb
|
113
113
|
- lib/cumuli/cli/commander.rb
|
114
|
-
- lib/cumuli/cli/
|
114
|
+
- lib/cumuli/cli/remote_commander.rb
|
115
|
+
- lib/cumuli/cli/remote_rake_command.rb
|
115
116
|
- lib/cumuli/cli/terminal.rb
|
116
117
|
- lib/cumuli/facade.rb
|
117
118
|
- lib/cumuli/project_manager.rb
|
@@ -128,7 +129,7 @@ files:
|
|
128
129
|
- lib/cumuli/waiter.rb
|
129
130
|
- spec/cli/args_spec.rb
|
130
131
|
- spec/cli/commander_spec.rb
|
131
|
-
- spec/cli/
|
132
|
+
- spec/cli/remote_rake_command_spec.rb
|
132
133
|
- spec/cli/terminal_spec.rb
|
133
134
|
- spec/fixtures/app_set/Procfile
|
134
135
|
- spec/fixtures/app_set/config/projects.yml
|
@@ -181,7 +182,7 @@ test_files:
|
|
181
182
|
- features/support/env.rb
|
182
183
|
- spec/cli/args_spec.rb
|
183
184
|
- spec/cli/commander_spec.rb
|
184
|
-
- spec/cli/
|
185
|
+
- spec/cli/remote_rake_command_spec.rb
|
185
186
|
- spec/cli/terminal_spec.rb
|
186
187
|
- spec/fixtures/app_set/Procfile
|
187
188
|
- spec/fixtures/app_set/config/projects.yml
|