geordi 1.9.0 → 1.9.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70f9242df556d6b8259f341827cc8996f6970de1e9d51c5ff13cbc44307a7ee7
4
- data.tar.gz: 59e54eca6438f61af0c7640f88771e5f7f67008237445a0d25521b3adea4f0fd
3
+ metadata.gz: b58c675d81b07400a5d816bc1191ef4ea26a010395379a3e1e103130fa0edd14
4
+ data.tar.gz: 85a7a4a397ed51b174468b1a9f8005d9dec37a2e35ab2c765b41eb01ddbf6052
5
5
  SHA512:
6
- metadata.gz: d143f1c68d472cc9918d6de6d2271b6633d0f9f01182d835b9667d872d65c495cc85b6c2752545e670b4bc685367baeb7122a32b7e4d3265ea8cc6412629be5d
7
- data.tar.gz: ec93583e23658f4c1c69febc903f8d3d05c98b6e0e7ec7066c4c678277161fcc9d4e8f365e79e38792ee0c7a5b8bb9deec07408983c50c694a3884be254d2124
6
+ metadata.gz: aebd6912385505c157d89cda5d81f78e2f35fc172e081690832b824d4d162745c4c415b1b28fc100a0aad83623d6c91e5bbcc87f7613e3079d2260d16e0ca591
7
+ data.tar.gz: 9afd1e6b056e881fc7ad0ee13182d72ee3bb35ca34672935183a225efe850f1a42ac090df9f45722ec062d4d212a926e93cba5964ab704b1903e6c6c743339e5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (1.9.0)
4
+ geordi (1.9.1)
5
5
  thor (>= 0.18.0)
6
6
 
7
7
  GEM
data/lib/geordi/cli.rb CHANGED
@@ -14,10 +14,6 @@ module Geordi
14
14
 
15
15
  private
16
16
 
17
- def file_containing?(file, regex)
18
- File.exists?(file) and File.read(file).scan(regex).any?
19
- end
20
-
21
17
  # fix weird implementation of #invoke
22
18
  def invoke_cmd(name, *args)
23
19
  options = args.last.is_a?(Hash) ? args.pop : {}
@@ -7,7 +7,7 @@ def create_databases
7
7
 
8
8
  if File.exists?('config/database.yml')
9
9
  command = 'bundle exec rake db:create:all'
10
- command << ' parallel:create' if file_containing?('Gemfile', /parallel_tests/)
10
+ command << ' parallel:create' if Util.file_containing?('Gemfile', /parallel_tests/)
11
11
 
12
12
  Util.system! command
13
13
  else
@@ -35,7 +35,7 @@ def delete_dumps(dump_directory = nil)
35
35
  success 'No dumps to delete' if deletable_dumps.empty?
36
36
  exit 0
37
37
  end
38
- deletable_dumps.uniq!
38
+ deletable_dumps.uniq!.sort!
39
39
  note 'The following dumps can be deleted:'
40
40
  puts
41
41
  puts deletable_dumps
@@ -68,10 +68,9 @@ def deploy(target_stage = nil)
68
68
  note "Deploy to #{target_stage}"
69
69
 
70
70
  if prompt('Go ahead with the deployment?', 'n', /y|yes/)
71
- cap3 = file_containing?('Capfile', 'capistrano/setup')
72
71
  capistrano_call = "cap #{target_stage} deploy"
73
- capistrano_call << ':migrations' unless cap3 || options.no_migrations
74
- capistrano_call = "bundle exec #{capistrano_call}" if file_containing?('Gemfile', /capistrano/)
72
+ capistrano_call << ':migrations' unless Util.capistrano3? || options.no_migrations
73
+ capistrano_call = "bundle exec #{capistrano_call}" if Util.file_containing?('Gemfile', /capistrano/)
75
74
 
76
75
  invoke_cmd 'bundle_install'
77
76
 
@@ -12,7 +12,7 @@ def migrate
12
12
  announce 'Migrating'
13
13
 
14
14
  if File.directory?('db/migrate')
15
- if file_containing?('Gemfile', /parallel_tests/)
15
+ if Util.file_containing?('Gemfile', /parallel_tests/)
16
16
  note 'Development and parallel test databases'
17
17
  puts
18
18
 
@@ -12,7 +12,7 @@ def rspec(*files)
12
12
 
13
13
  announce 'Running specs'
14
14
 
15
- if file_containing?('Gemfile', /parallel_tests/) and files.empty?
15
+ if Util.file_containing?('Gemfile', /parallel_tests/) and files.empty?
16
16
  note 'All specs at once (using parallel_tests)'
17
17
  Util.system! 'bundle exec rake parallel:spec', :fail_message => 'Specs failed.'
18
18
 
@@ -28,7 +28,7 @@ def rspec(*files)
28
28
  command = ['bundle exec']
29
29
  # differentiate RSpec 1/2
30
30
  command << (File.exists?('script/spec') ? 'spec -c' : 'rspec')
31
- command << '-r rspec_spinner -f RspecSpinner::Bar' if file_containing?('Gemfile', /rspec_spinner/)
31
+ command << '-r rspec_spinner -f RspecSpinner::Bar' if Util.file_containing?('Gemfile', /rspec_spinner/)
32
32
  command << files.join(' ')
33
33
 
34
34
  puts
@@ -21,20 +21,19 @@ def security_update(step='prepare')
21
21
 
22
22
  success 'Successfully prepared for security update'
23
23
  puts
24
- note 'Please apply the security update now.'
24
+ note 'Please apply the security update now and commit your changes.'
25
25
  note 'When you are done, run `geordi security-update finish`.'
26
26
 
27
27
 
28
- when 'finish'
29
- announce 'Finishing security update'
30
-
28
+ when 'f', 'finish'
31
29
  # ensure everything is committed
32
- `git status --porcelain`.empty? or fail('There are uncommitted changes.')
33
- note 'Working directory clean.'
30
+ `git status --porcelain`.empty? or fail('Please commit your changes before finishing the update.')
34
31
 
32
+ announce 'Finishing security update'
33
+ note 'Working directory clean.'
35
34
  prompt('Have you successfully run all tests?', 'n', /y|yes/) or fail 'Please run tests first.'
36
35
 
37
- note 'About to: push production, checkout & pull master, merge production, push master, deploy all stages'
36
+ note 'About to: push production, checkout & pull master, merge production, push master'
38
37
  prompt('Continue?', 'n', /y|yes/) or fail 'Cancelled.'
39
38
 
40
39
  Util.system! 'git push', :show_cmd => true
@@ -43,7 +42,9 @@ def security_update(step='prepare')
43
42
  Util.system! 'git merge production', :show_cmd => true
44
43
  Util.system! 'git push', :show_cmd => true
45
44
 
46
- invoke_cmd 'capistrano', 'deploy:migrations'
45
+ announce 'Deploying all targets'
46
+ deploy = Util.capistrano3? ? 'deploy' : 'deploy:migrations'
47
+ invoke_cmd 'capistrano', deploy
47
48
 
48
49
  success 'Successfully pushed and deployed security update'
49
50
  puts
@@ -1,6 +1,6 @@
1
1
  desc 'with-rake', 'Run tests with `rake`', :hide => true
2
2
  def with_rake
3
- if file_containing?('Rakefile', /^task.+default.+(spec|test|feature)/)
3
+ if Util.file_containing?('Rakefile', /^task.+default.+(spec|test|feature)/)
4
4
  invoke_cmd 'bundle_install'
5
5
 
6
6
  announce 'Running tests with `rake`'
data/lib/geordi/util.rb CHANGED
@@ -39,7 +39,7 @@ module Geordi
39
39
  # @option fail_message: The text to print on command failure
40
40
  def system!(*commands)
41
41
  options = commands.last.is_a?(Hash) ? commands.pop : {}
42
- note_cmd commands.inspect if options[:show_cmd]
42
+ note_cmd commands.join(' ') if options[:show_cmd]
43
43
 
44
44
  if options[:confirm]
45
45
  prompt('Run this now?', 'n', /y|yes/) or fail('Cancelled.')
@@ -111,6 +111,15 @@ module Geordi
111
111
  def stripped_lines(input_string)
112
112
  input_string.lines.map(&:chomp).map(&:strip)
113
113
  end
114
+
115
+ def capistrano3?
116
+ Util.file_containing? 'Capfile', 'capistrano/setup'
117
+ end
118
+
119
+ def file_containing?(file, regex)
120
+ File.exists?(file) and File.read(file).scan(regex).any?
121
+ end
122
+
114
123
  end
115
124
  end
116
125
  end
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '1.9.0'
2
+ VERSION = '1.9.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-13 00:00:00.000000000 Z
11
+ date: 2018-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor