commit-live-cli 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: '094ef290ddb865c1bdd5942e432031ed897ac209'
4
- data.tar.gz: fe88388cf5c7f52b32312ca14a59df59b1d76083
3
+ metadata.gz: 3facfba4b79747333636f5a180470f771e91c3b7
4
+ data.tar.gz: f755a77e3b337c9fb464f3cbf8b7996ea8c66850
5
5
  SHA512:
6
- metadata.gz: 36aea0f118082903a2d2b6f0988eb11d75049a9c3607a49531826193c7afe3ca1e8a229957f5c0730bfdfbe5d78ad2c023c8da6f1b3618e34733380725f0880a
7
- data.tar.gz: 5ef0995d1f99091139dfaa950d5821139bfc27102ce04a02a1a98580212edb2356be6af316638da8c402ae4d15b517b9ef5e43d55537aa9b7905ed03f04410a6
6
+ metadata.gz: e2e499c271a19b29024cb9ade4396235fac35c492beedb45a448766bb1069cac0ec0e9aa3487d99ead7178ad3b2aa229267575da561a96c9551ba23e33070c33
7
+ data.tar.gz: 785a5a967ae0be62d52e78d3b5241e471515d634146bd61f73df69eeca2945de0fbfa246f9c4f609a382a61ec3b92edf979b59e9d787033ae1bd969fa9375120
@@ -1,5 +1,6 @@
1
1
  require "commit-live/lesson/current"
2
2
  require "commit-live/lesson/status"
3
+ require "commit-live/tests/runner"
3
4
  require "commit-live/netrc-interactor"
4
5
  require "commit-live/github"
5
6
 
@@ -22,12 +23,19 @@ module CommitLive
22
23
 
23
24
  def commitAndPush
24
25
  checkRemote
25
- addChanges
26
- commitChanges
26
+ testCasePassed = CommitLive::Test.new().run(false)
27
+ if testCasePassed
28
+ addChanges
29
+ commitChanges
27
30
 
28
- push
29
- createPullRequest
30
- update_lesson_status
31
+ push
32
+ createPullRequest
33
+ update_lesson_status
34
+ else
35
+ puts "..."
36
+ puts "Please make sure all test cases pass before submitting!"
37
+ exit
38
+ end
31
39
  end
32
40
 
33
41
  private
@@ -45,19 +45,22 @@ module CommitLive
45
45
  exit 1
46
46
  end
47
47
 
48
- def run
48
+ def run(updateStatus = true)
49
49
  strategy.check_dependencies
50
50
  strategy.configure
51
51
  results = strategy.run
52
- puts 'Updating lesson status...'
53
- lessonName = repo_name(remote: 'origin')
54
- if results
55
- # test case passed
56
- CommitLive::Status.new().update('test_case_pass', lessonName)
57
- else
58
- # test case failed
59
- CommitLive::Status.new().update('test_case_fail', lessonName)
52
+ if updateStatus
53
+ puts 'Updating lesson status...'
54
+ lessonName = repo_name(remote: 'origin')
55
+ if results
56
+ # test case passed
57
+ CommitLive::Status.new().update('test_case_pass', lessonName)
58
+ else
59
+ # test case failed
60
+ CommitLive::Status.new().update('test_case_fail', lessonName)
61
+ end
60
62
  end
63
+ return results
61
64
  end
62
65
 
63
66
  def strategy
@@ -1,5 +1,5 @@
1
1
  module CommitLive
2
2
  module Cli
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commit-live-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - greyatom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler