wipit 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.
- data/lib/wipit.rb +4 -1
- data/lib/wipit/version.rb +1 -1
- data/test/wipit_test.rb +6 -6
- metadata +3 -3
data/lib/wipit.rb
CHANGED
@@ -24,9 +24,12 @@ module Wipit
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def build(options={})
|
27
|
+
deleted_files = %x[ git ls-files --deleted ]
|
27
28
|
@command = ''
|
28
29
|
@command << "git checkout -b #{options[:branch]} && " unless options[:branch].empty?
|
29
|
-
@command << "git add .
|
30
|
+
@command << "git add ."
|
31
|
+
@command << " && git rm $(git ls-files --deleted)" unless deleted_files.empty?
|
32
|
+
@command << " && git commit -m 'WIP'"
|
30
33
|
@command << " && git push origin #{options[:branch]}" unless options[:branch].empty? || options[:push] != true
|
31
34
|
@command
|
32
35
|
end
|
data/lib/wipit/version.rb
CHANGED
data/test/wipit_test.rb
CHANGED
@@ -4,26 +4,26 @@ require 'helper'
|
|
4
4
|
class WipitTest < Test::Unit::TestCase
|
5
5
|
|
6
6
|
def test_basic_run
|
7
|
-
assert_command '', "git add . && git
|
7
|
+
assert_command '', "git add . && git commit -m 'WIP'"
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_branch_run
|
11
|
-
assert_command 'my_branch', "git checkout -b my_branch && git add . && git
|
11
|
+
assert_command 'my_branch', "git checkout -b my_branch && git add . && git commit -m 'WIP'"
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_two_branches_run
|
15
|
-
assert_command 'my_branch my_branch2', "git checkout -b my_branch2 && git add . && git
|
15
|
+
assert_command 'my_branch my_branch2', "git checkout -b my_branch2 && git add . && git commit -m 'WIP'"
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_branch_push_run
|
19
|
-
assert_command 'my_branch -p', "git checkout -b my_branch && git add . && git
|
19
|
+
assert_command 'my_branch -p', "git checkout -b my_branch && git add . && git commit -m 'WIP' && git push origin my_branch"
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_push_branch_run
|
23
|
-
assert_command '-p my_branch', "git checkout -b my_branch && git add . && git
|
23
|
+
assert_command '-p my_branch', "git checkout -b my_branch && git add . && git commit -m 'WIP' && git push origin my_branch"
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_push_run
|
27
|
-
assert_command '-p', "git add . && git
|
27
|
+
assert_command '-p', "git add . && git commit -m 'WIP'"
|
28
28
|
end
|
29
29
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wipit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Thomas Marino
|