winter_rakeutils 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/winter_rakeutils.rb +28 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 044a7da13bd5236d55efb46de753eef199257f5c
4
+ data.tar.gz: a81bf2e95dcaf858492e06cf312d0596857b1894
5
+ SHA512:
6
+ metadata.gz: 8224c890fb07459f6613215c83717b104bdb0801a0a851da516f64ec7a17cff7cae76707647de58f0401fe0e3b48365488e3a776ef4f67bdf4fa97f4de2a489a
7
+ data.tar.gz: 08516fb13ee2c72796260b71265d6471f6f69c07caf6711f0383d3f080177612170a8addbefa39eb356493dfa02afc621f0f1ca14063440a8ce1a0ee8e5f4f01
@@ -0,0 +1,28 @@
1
+ module WinterRakeUtils
2
+ def git_working_dir_clean?
3
+ `git status`.lines.each do |line|
4
+ if line.index "Changes to be committed"
5
+ return false
6
+ end
7
+ end
8
+ return true
9
+ end
10
+
11
+ def ensure_dir d
12
+ unless File.exists? d
13
+ mkdir_p d
14
+ unless File.exists? d
15
+ sleep 0.01
16
+ ensure_dir d
17
+ end
18
+ end
19
+ end
20
+
21
+ def git_commit_push msg = "auto"
22
+ sh "git add -A"
23
+ unless git_working_dir_clean?
24
+ sh "git commit -m #{msg}"
25
+ sh "git push"
26
+ end
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: winter_rakeutils
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Winter Young
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-03-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Winter Young's rake utils
14
+ email: 513805252@qq.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/winter_rakeutils.rb
20
+ homepage: https://github.com/winteryoung/winter-rakeutils
21
+ licenses:
22
+ - Apache-2.0
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.1
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Winter rake utils
44
+ test_files: []