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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42f2220f89f952c7401ffdc12925c578e4fe9faf
4
- data.tar.gz: 93e24073b5c31ae06e4346688cd90d362efc4455
3
+ metadata.gz: c828aab63a3177d3992d14012d752c8c4609e5e1
4
+ data.tar.gz: 1545d8af40410e37d56963380e202ecee9d7503e
5
5
  SHA512:
6
- metadata.gz: 81c947e7f4f98a13c0058aa68681bf500c8228134d89dc21891c2b2bc388f3fa4b4473df6ae37d288ee0befeac145953143f1295990088fdd7c495f85c31d01b
7
- data.tar.gz: a692b04f8c00d32ae3b6de2abe6551d07f2fb22af043b545104490fee4465fda1c3c7bbe613ce6eccbe2c2c80749ec562a6220b23cd5a8cbd7d4e3083ac9d1c8
6
+ metadata.gz: f27e860d19b2b417b63ec5955d88a1bac421a8f735db2593e9c2a446563a1bab4e89c609b97121f4555e9a0a3c0bf1b4079d715b3cdad008839dbb13c5762cb2
7
+ data.tar.gz: 14a2340512e2dcd478e61111e458acb276043b4f5915c9d876bd5f3cbda1555362de5f8a5a4a9f6bc28ed03d38b2d0420ba0e1dc27e2a68c25ef595d2d3ee53a
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Code Climate](https://codeclimate.com/github/socialchorus/cumuli.png)](https://codeclimate.com/github/socialchorus/cumuli)
2
+
1
3
  # Cumuli
2
4
 
3
5
  In the land of Service Oriented Architecture, knowing whether everything
@@ -2,4 +2,5 @@ require "cumuli/cli/args"
2
2
  require "cumuli/cli/cli"
3
3
  require "cumuli/cli/commander"
4
4
  require "cumuli/cli/terminal"
5
- require "cumuli/cli/remote_command"
5
+ require "cumuli/cli/remote_rake_command"
6
+ require "cumuli/cli/remote_commander"
@@ -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 RemoteCommand
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
- fork do
100
- CLI::RemoteCommand.new([command, "DIR=#{path}"]).perform
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::RemoteCommand.new(ARGV).perform
64
+ Cumuli::CLI::RemoteRakeCommand.new(ARGV).perform
65
65
  end
66
66
  end
@@ -1,3 +1,3 @@
1
1
  module Cumuli
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Cumuli::CLI::RemoteCommand do
3
+ describe Cumuli::CLI::RemoteRakeCommand do
4
4
  let(:argv) { ["cumuli:remote[rake db:migrate]", "DIR=./mactivator"] }
5
- let(:remote_command) { Cumuli::CLI::RemoteCommand.new(argv) }
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.1
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-07-27 00:00:00.000000000 Z
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/remote_command.rb
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/remote_command_spec.rb
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/remote_command_spec.rb
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