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 +4 -4
- data/lib/commit-live/lesson/git-helper.rb +13 -5
- data/lib/commit-live/tests/runner.rb +12 -9
- data/lib/commit-live/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3facfba4b79747333636f5a180470f771e91c3b7
|
4
|
+
data.tar.gz: f755a77e3b337c9fb464f3cbf8b7996ea8c66850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
26
|
-
|
26
|
+
testCasePassed = CommitLive::Test.new().run(false)
|
27
|
+
if testCasePassed
|
28
|
+
addChanges
|
29
|
+
commitChanges
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
data/lib/commit-live/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|