travis-cli 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
1
  require 'thor'
2
2
 
3
+ $stdout.sync = true
4
+
3
5
  module Travis
4
6
  autoload :Keychain, 'travis/keychain'
5
7
 
@@ -11,7 +13,6 @@ module Travis
11
13
  namespace 'travis'
12
14
 
13
15
  desc 'config', 'Sync config between keychain, app and local working directory'
14
- method_option :restart, :aliases => '-r', :type => :boolean, :default => true
15
16
  method_option :backup, :aliases => '-b', :type => :boolean, :default => false
16
17
 
17
18
  def config(remote)
@@ -17,7 +17,6 @@ module Travis
17
17
  def invoke
18
18
  store
19
19
  push
20
- restart if restart?
21
20
  end
22
21
 
23
22
  protected
@@ -49,20 +48,11 @@ module Travis
49
48
  run "heroku config:add travis_config=#{config} -r #{remote}", :echo => "heroku config:add travis_config=... -r #{app}"
50
49
  end
51
50
 
52
- def restart
53
- say 'Restarting the app ...'
54
- run "heroku restart -r #{remote}"
55
- end
56
-
57
51
  def backup
58
52
  say 'Backing up the old config file ...'
59
53
  run "cp #{filename} #{filename}.backup"
60
54
  end
61
55
 
62
- def restart?
63
- !!options['restart']
64
- end
65
-
66
56
  def backup?
67
57
  !!options['backup']
68
58
  end
@@ -67,7 +67,7 @@ module Travis
67
67
  end
68
68
 
69
69
  def configure
70
- Config.new(shell, remote, :restart => false).invoke
70
+ Config.new(shell, remote, {}).invoke
71
71
  end
72
72
 
73
73
  def migrate?
@@ -77,6 +77,12 @@ module Travis
77
77
  def migrate
78
78
  say 'Running migrations'
79
79
  run "heroku run rake db:migrate -r #{remote}"
80
+ restart
81
+ end
82
+
83
+ def restart
84
+ say 'Restarting the app ...'
85
+ run "heroku restart -r #{remote}"
80
86
  end
81
87
  end
82
88
  end
@@ -1,3 +1,3 @@
1
1
  module TravisCli
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -29,17 +29,5 @@ describe Travis::Cli::Config do
29
29
  command.expects(:run).with { |cmd, options| cmd =~ /heroku config:add travis_config=.* -r staging/m }
30
30
  command.invoke
31
31
  end
32
-
33
- it 'restarts the app when --restart is given' do
34
- command = Travis::Cli::Config.new(shell, 'staging', 'restart' => true)
35
- command.expects(:restart)
36
- command.invoke
37
- end
38
-
39
- it 'does not restart the app when --restart is not given' do
40
- command = Travis::Cli::Config.new(shell, 'staging', {})
41
- command.expects(:restart).never
42
- command.invoke
43
- end
44
32
  end
45
33
  end
@@ -88,6 +88,13 @@ describe Travis::Cli::Deploy do
88
88
  command.invoke
89
89
  end
90
90
 
91
+ it 'restarts the app when the database is migrated' do
92
+ command = Travis::Cli::Deploy.new(shell, 'production', 'migrate' => true)
93
+ command.stubs(:system).returns(true)
94
+ command.expects(:system).with('heroku restart -r production').returns(true)
95
+ command.invoke
96
+ end
97
+
91
98
  it 'configures the application if --configure is given' do
92
99
  command = Travis::Cli::Deploy.new(shell, 'production', 'configure' => true)
93
100
  command.stubs(:system).returns(true)
metadata CHANGED
@@ -1,49 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ prerelease:
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Travis CI
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-11 00:00:00.000000000Z
12
+ date: 2011-12-18 00:00:00.000000000 +03:00
13
+ default_executable:
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: thor
16
- requirement: &70356498144940 !ruby/object:Gem::Requirement
17
- none: false
17
+ version_requirements: &2588 !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
- type: :runtime
22
+ none: false
23
+ requirement: *2588
23
24
  prerelease: false
24
- version_requirements: *70356498144940
25
+ type: :runtime
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: rspec
27
- requirement: &70356498144320 !ruby/object:Gem::Requirement
28
- none: false
28
+ version_requirements: &2606 !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0'
33
- type: :development
33
+ none: false
34
+ requirement: *2606
34
35
  prerelease: false
35
- version_requirements: *70356498144320
36
+ type: :development
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: mocha
38
- requirement: &70356498143500 !ruby/object:Gem::Requirement
39
- none: false
39
+ version_requirements: &2624 !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
- type: :development
44
+ none: false
45
+ requirement: *2624
45
46
  prerelease: false
46
- version_requirements: *70356498143500
47
+ type: :development
47
48
  description: ! '[description]'
48
49
  email: contact@travis-ci.org
49
50
  executables:
@@ -51,45 +52,46 @@ executables:
51
52
  extensions: []
52
53
  extra_rdoc_files: []
53
54
  files:
55
+ - lib/travis_cli.rb
56
+ - lib/travis/cli.rb
57
+ - lib/travis/keychain.rb
54
58
  - lib/travis/cli/config.rb
55
59
  - lib/travis/cli/deploy.rb
56
60
  - lib/travis/cli/helper.rb
57
- - lib/travis/cli.rb
58
- - lib/travis/keychain.rb
59
61
  - lib/travis_cli/version.rb
60
- - lib/travis_cli.rb
61
62
  - spec/spec_helper.rb
63
+ - spec/travis/keychain_spec.rb
62
64
  - spec/travis/cli/config_spec.rb
63
65
  - spec/travis/cli/deploy_spec.rb
64
- - spec/travis/keychain_spec.rb
65
66
  - Gemfile
66
67
  - LICENSE
67
68
  - Rakefile
68
69
  - README.md
69
70
  - bin/travis
71
+ has_rdoc: true
70
72
  homepage: https://github.com/travis-ci/travis-cli
71
73
  licenses: []
72
- post_install_message:
74
+ post_install_message:
73
75
  rdoc_options: []
74
76
  require_paths:
75
77
  - lib
76
78
  required_ruby_version: !ruby/object:Gem::Requirement
77
- none: false
78
79
  requirements:
79
80
  - - ! '>='
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
- required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  none: false
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
85
  requirements:
85
86
  - - ! '>='
86
87
  - !ruby/object:Gem::Version
87
88
  version: '0'
89
+ none: false
88
90
  requirements: []
89
91
  rubyforge_project: ! '[none]'
90
- rubygems_version: 1.8.10
91
- signing_key:
92
+ rubygems_version: 1.5.1
93
+ signing_key:
92
94
  specification_version: 3
93
95
  summary: ! '[summary]'
94
96
  test_files: []
95
- has_rdoc:
97
+ ...