File tree 10 files changed +221
-0
lines changed
10 files changed +221
-0
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,18 @@ PostCheckout:
541
541
flags : ['install']
542
542
include : ' bower.json'
543
543
544
+ BundleInstall :
545
+ enabled : false
546
+ description : ' Installing Bundler dependencies'
547
+ requires_files : true
548
+ required_executable : ' bundle'
549
+ install_command : ' gem install bundler'
550
+ flags : ['install']
551
+ include :
552
+ - ' Gemfile'
553
+ - ' Gemfile.lock'
554
+ - ' *.gemspec'
555
+
544
556
IndexTags :
545
557
enabled : false
546
558
description : ' Generating tags file from source'
@@ -579,6 +591,18 @@ PostCommit:
579
591
flags : ['install']
580
592
include : ' bower.json'
581
593
594
+ BundleInstall :
595
+ enabled : false
596
+ description : ' Installing Bundler dependencies'
597
+ requires_files : true
598
+ required_executable : ' bundle'
599
+ install_command : ' gem install bundler'
600
+ flags : ['install']
601
+ include :
602
+ - ' Gemfile'
603
+ - ' Gemfile.lock'
604
+ - ' *.gemspec'
605
+
582
606
GitGuilt :
583
607
enabled : false
584
608
description : ' Calculating changes in blame since last commit'
@@ -624,6 +648,18 @@ PostMerge:
624
648
flags : ['install']
625
649
include : ' bower.json'
626
650
651
+ BundleInstall :
652
+ enabled : false
653
+ description : ' Installing Bundler dependencies'
654
+ requires_files : true
655
+ required_executable : ' bundle'
656
+ install_command : ' gem install bundler'
657
+ flags : ['install']
658
+ include :
659
+ - ' Gemfile'
660
+ - ' Gemfile.lock'
661
+ - ' *.gemspec'
662
+
627
663
IndexTags :
628
664
enabled : false
629
665
description : ' Generating tags file from source'
@@ -661,6 +697,18 @@ PostRewrite:
661
697
flags : ['install']
662
698
include : ' bower.json'
663
699
700
+ BundleInstall :
701
+ enabled : false
702
+ description : ' Installing Bundler dependencies'
703
+ requires_files : true
704
+ required_executable : ' bundle'
705
+ install_command : ' gem install bundler'
706
+ flags : ['install']
707
+ include :
708
+ - ' Gemfile'
709
+ - ' Gemfile.lock'
710
+ - ' *.gemspec'
711
+
664
712
IndexTags :
665
713
enabled : false
666
714
description : ' Generating tags file from source'
Original file line number Diff line number Diff line change
1
+ require 'overcommit/hook/shared/bundle_install'
2
+
3
+ module Overcommit ::Hook ::PostCheckout
4
+ # Runs `bundle install` when a change is detected in the repository's
5
+ # dependencies.
6
+ #
7
+ # @see {Overcommit::Hook::Shared::BundleInstall}
8
+ class BundleInstall < Base
9
+ include Overcommit ::Hook ::Shared ::BundleInstall
10
+ end
11
+ end
Original file line number Diff line number Diff line change
1
+ require 'overcommit/hook/shared/bundle_install'
2
+
3
+ module Overcommit ::Hook ::PostCommit
4
+ # Runs `bundle install` when a change is detected in the repository's
5
+ # dependencies.
6
+ #
7
+ # @see {Overcommit::Hook::Shared::BundleInstall}
8
+ class BundleInstall < Base
9
+ include Overcommit ::Hook ::Shared ::BundleInstall
10
+ end
11
+ end
Original file line number Diff line number Diff line change
1
+ require 'overcommit/hook/shared/bundle_install'
2
+
3
+ module Overcommit ::Hook ::PostMerge
4
+ # Runs `bundle install` when a change is detected in the repository's
5
+ # dependencies.
6
+ #
7
+ # @see {Overcommit::Hook::Shared::BundleInstall}
8
+ class BundleInstall < Base
9
+ include Overcommit ::Hook ::Shared ::BundleInstall
10
+ end
11
+ end
Original file line number Diff line number Diff line change
1
+ require 'overcommit/hook/shared/bundle_install'
2
+
3
+ module Overcommit ::Hook ::PostRewrite
4
+ # Runs `bundle install` when a change is detected in the repository's
5
+ # dependencies.
6
+ #
7
+ # @see {Overcommit::Hook::Shared::BundleInstall}
8
+ class BundleInstall < Base
9
+ include Overcommit ::Hook ::Shared ::BundleInstall
10
+ end
11
+ end
Original file line number Diff line number Diff line change
1
+ module Overcommit ::Hook ::Shared
2
+ # Shared code used by all BundleInstall hooks. Runs `bundle install` when a
3
+ # change is detected in the repository's dependencies.
4
+ #
5
+ # @see http://bundler.io/
6
+ module BundleInstall
7
+ def run
8
+ result = execute ( command )
9
+ return :fail , result . stdout unless result . success?
10
+ :pass
11
+ end
12
+ end
13
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe Overcommit ::Hook ::PostCheckout ::BundleInstall do
4
+ let ( :config ) { Overcommit ::ConfigurationLoader . default_configuration }
5
+ let ( :context ) { double ( 'context' ) }
6
+ subject { described_class . new ( config , context ) }
7
+
8
+ let ( :result ) { double ( 'result' ) }
9
+
10
+ before do
11
+ subject . stub ( :execute ) . and_return ( result )
12
+ end
13
+
14
+ context 'when bundle install exits successfully' do
15
+ before do
16
+ result . stub ( :success? ) . and_return ( true )
17
+ end
18
+
19
+ it { should pass }
20
+ end
21
+
22
+ context 'when bundle install exits unsuccessfully' do
23
+ before do
24
+ result . stub ( success? : false , stdout : 'Could not locate Gemfile or .bundle/ directory' )
25
+ end
26
+
27
+ it { should fail_hook }
28
+ end
29
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe Overcommit ::Hook ::PostCommit ::BundleInstall do
4
+ let ( :config ) { Overcommit ::ConfigurationLoader . default_configuration }
5
+ let ( :context ) { double ( 'context' ) }
6
+ subject { described_class . new ( config , context ) }
7
+
8
+ let ( :result ) { double ( 'result' ) }
9
+
10
+ before do
11
+ subject . stub ( :execute ) . and_return ( result )
12
+ end
13
+
14
+ context 'when bundle install exits successfully' do
15
+ before do
16
+ result . stub ( :success? ) . and_return ( true )
17
+ end
18
+
19
+ it { should pass }
20
+ end
21
+
22
+ context 'when bundle install exits unsuccessfully' do
23
+ before do
24
+ result . stub ( success? : false , stdout : 'Could not locate Gemfile or .bundle/ directory' )
25
+ end
26
+
27
+ it { should fail_hook }
28
+ end
29
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe Overcommit ::Hook ::PostMerge ::BundleInstall do
4
+ let ( :config ) { Overcommit ::ConfigurationLoader . default_configuration }
5
+ let ( :context ) { double ( 'context' ) }
6
+ subject { described_class . new ( config , context ) }
7
+
8
+ let ( :result ) { double ( 'result' ) }
9
+
10
+ before do
11
+ subject . stub ( :execute ) . and_return ( result )
12
+ end
13
+
14
+ context 'when bundle install exits successfully' do
15
+ before do
16
+ result . stub ( :success? ) . and_return ( true )
17
+ end
18
+
19
+ it { should pass }
20
+ end
21
+
22
+ context 'when bundle install exits unsuccessfully' do
23
+ before do
24
+ result . stub ( success? : false , stdout : 'Could not locate Gemfile or .bundle/ directory' )
25
+ end
26
+
27
+ it { should fail_hook }
28
+ end
29
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe Overcommit ::Hook ::PostRewrite ::BundleInstall do
4
+ let ( :config ) { Overcommit ::ConfigurationLoader . default_configuration }
5
+ let ( :context ) { double ( 'context' ) }
6
+ subject { described_class . new ( config , context ) }
7
+
8
+ let ( :result ) { double ( 'result' ) }
9
+
10
+ before do
11
+ subject . stub ( :execute ) . and_return ( result )
12
+ end
13
+
14
+ context 'when bundle install exits successfully' do
15
+ before do
16
+ result . stub ( :success? ) . and_return ( true )
17
+ end
18
+
19
+ it { should pass }
20
+ end
21
+
22
+ context 'when bundle install exits unsuccessfully' do
23
+ before do
24
+ result . stub ( success? : false , stdout : 'Could not locate Gemfile or .bundle/ directory' )
25
+ end
26
+
27
+ it { should fail_hook }
28
+ end
29
+ end
You can’t perform that action at this time.
0 commit comments