dafuq 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +2 -0
- data/bin/dafuq +3 -1
- data/dafuq.gemspec +1 -0
- data/lib/dafuq.rb +4 -0
- data/lib/dafuq/filesystem.rb +13 -16
- data/lib/dafuq/git.rb +27 -0
- data/lib/dafuq/version.rb +1 -1
- metadata +26 -3
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -23,6 +23,8 @@ DaFuq
|
|
23
23
|
'-notail', '--no-whitespace' : Dafuq::Code.notail no_whitespace_path, recurse
|
24
24
|
'-noswap', '--no-temp-files' : Dafuq::FileSystem.noswap no_swap_path, recurse
|
25
25
|
|
26
|
+
'-gpull', '--git-pull' : Pull all the git repositories present at path, recurse
|
27
|
+
|
26
28
|
'-no-r', '--no-recurse' : non-recursive action in directories
|
27
29
|
|
28
30
|
'-v', '--verbose' : verbose
|
data/bin/dafuq
CHANGED
@@ -7,11 +7,13 @@ require 'dafuq'
|
|
7
7
|
if Arg0::Console.switch?(['-h', '--help'])
|
8
8
|
puts <<-DATA
|
9
9
|
DaFuq
|
10
|
-
v0.0.
|
10
|
+
v0.0.3
|
11
11
|
|
12
12
|
'-notail', '--no-whitespace' : Dafuq::Code.notail no_whitespace_path, recurse
|
13
13
|
'-noswap', '--no-temp-files' : Dafuq::FileSystem.noswap no_swap_path, recurse
|
14
14
|
|
15
|
+
'-gpull', '--git-pull' : Pull all the git repositories present at path, recurse
|
16
|
+
|
15
17
|
'-no-r', '--no-recurse' : non-recursive action in directories
|
16
18
|
|
17
19
|
'-v', '--verbose' : verbose
|
data/dafuq.gemspec
CHANGED
data/lib/dafuq.rb
CHANGED
@@ -26,5 +26,9 @@ module Dafuq
|
|
26
26
|
Arg0::Console.value_for(['-noswap', '--no-temp-files']).each do |no_temp_path|
|
27
27
|
Dafuq::FileSystem.noswap no_temp_path, recurse
|
28
28
|
end
|
29
|
+
|
30
|
+
Arg0::Console.value_for(['-gpull', '--git-pull']).each do |repo_base_path|
|
31
|
+
Dafuq::Git.pull repo_base_path, recurse
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end
|
data/lib/dafuq/filesystem.rb
CHANGED
@@ -1,25 +1,22 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
1
3
|
module Dafuq
|
2
4
|
module FileSystem
|
3
5
|
|
4
6
|
# 'remove Vi/Vim Backup/Swap *swp/swo/~ files, leftovers temporary'
|
5
7
|
def self.noswap(clean_path, recursive = true)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Dafuq.log_me "Deleting: #{fyl}"
|
17
|
-
rescue
|
18
|
-
Dafuq.log_me "ERROR Deleting: #{fyl}"
|
19
|
-
raise
|
20
|
-
end
|
8
|
+
clean_path = File.expand_path clean_path
|
9
|
+
file_list = FileList["#{clean_path}/#{recursive ? '**/' : ''}.*.{swo,swp}"]
|
10
|
+
file_list.each{|file|
|
11
|
+
next if File.symlink? file
|
12
|
+
begin
|
13
|
+
File.delete file
|
14
|
+
Dafuq.log_me "Deleting: #{file}"
|
15
|
+
rescue
|
16
|
+
Dafuq.log_me "ERROR Deleting: #{file}"
|
17
|
+
raise
|
21
18
|
end
|
22
|
-
|
19
|
+
}
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
data/lib/dafuq/git.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Dafuq::Git
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
module Dafuq
|
5
|
+
module Git
|
6
|
+
|
7
|
+
#
|
8
|
+
def self.repos(path, recursive=true)
|
9
|
+
path = File.expand_path path
|
10
|
+
git_configs = FileList["#{path}/#{recursive ? '**/' : ''}.git/config"]
|
11
|
+
git_configs.pathmap("%d").pathmap("%d")
|
12
|
+
end
|
13
|
+
|
14
|
+
#
|
15
|
+
def self.pull(base_path, recursive = true)
|
16
|
+
repos(base_path).each{|repo|
|
17
|
+
begin
|
18
|
+
pid = spawn("cd #{repo} ; git pull ; cd -")
|
19
|
+
Dafuq.log_me "Updating: #{repo}; PID##{pid}"
|
20
|
+
rescue
|
21
|
+
Dafuq.log_me "ERROR: updating repo at #{repo}"
|
22
|
+
raise
|
23
|
+
end
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/dafuq/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dafuq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: arg0
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 0.0.2
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 10.0.3
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 10.0.3
|
30
46
|
description: dafuq is here to handle dafuq tasks required now and then, sometimes
|
31
47
|
and often
|
32
48
|
email:
|
@@ -46,6 +62,7 @@ files:
|
|
46
62
|
- lib/dafuq.rb
|
47
63
|
- lib/dafuq/code.rb
|
48
64
|
- lib/dafuq/filesystem.rb
|
65
|
+
- lib/dafuq/git.rb
|
49
66
|
- lib/dafuq/version.rb
|
50
67
|
homepage: https://github.com/abhishekkr/dafuq
|
51
68
|
licenses: []
|
@@ -59,15 +76,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
76
|
- - ! '>='
|
60
77
|
- !ruby/object:Gem::Version
|
61
78
|
version: '0'
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
hash: 2845875572921992237
|
62
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
83
|
none: false
|
64
84
|
requirements:
|
65
85
|
- - ! '>='
|
66
86
|
- !ruby/object:Gem::Version
|
67
87
|
version: '0'
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
hash: 2845875572921992237
|
68
91
|
requirements: []
|
69
92
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.8.
|
93
|
+
rubygems_version: 1.8.25
|
71
94
|
signing_key:
|
72
95
|
specification_version: 3
|
73
96
|
summary: dafuq is this, said a lot... will be adding some of the solutions to it over
|