pro 1.1.2 → 1.1.3
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/.gitignore +1 -0
- data/bin/pro +13 -8
- data/lib/pro/commands.rb +6 -6
- data/lib/pro/indexer.rb +3 -3
- data/lib/pro/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: 841eaadb5955d7fbc015c7897e8ec4e133a2b897
|
4
|
+
data.tar.gz: 7faa5f87d627d4bdfc3d175121553e94192c167d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f6c4be18f7868208537f0d2378801da198218a1605a027219f7eddfe6364d9d4255b4d5739fe65987ac21f321185f7cb87737533bdb864f43ac5808fb28d4a5
|
7
|
+
data.tar.gz: edfa7102fcc0f585ee579cf701f212a9700267c8a7375de24991b91b118858a450349f2f7b63cf3b09d1055205ae9a162ba358455b800b6f0150a8f748ff0203
|
data/.gitignore
CHANGED
data/bin/pro
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# vi: set filetype=ruby fileencoding=UTF-8 shiftwidth=2 tabstop=2 expandtab
|
3
3
|
|
4
|
-
|
5
|
-
require "yaml"
|
4
|
+
PROFILER_OUT=nil
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
rescue LoadError
|
11
|
-
$pryAvailable = false
|
6
|
+
if PROFILER_OUT
|
7
|
+
require "ruby-prof"
|
8
|
+
RubyProf.start
|
12
9
|
end
|
13
10
|
|
11
|
+
require "pro"
|
14
12
|
|
15
13
|
HELP = <<END
|
16
14
|
pro is a command to help you manage your git repositories.
|
@@ -63,7 +61,8 @@ command = ARGV.shift || 'help'
|
|
63
61
|
|
64
62
|
case command
|
65
63
|
when 'debug'
|
66
|
-
|
64
|
+
require "pry"
|
65
|
+
binding.pry
|
67
66
|
when 'search'
|
68
67
|
puts pro.find_repo(ARGV.first)
|
69
68
|
when 'install'
|
@@ -97,3 +96,9 @@ when '-v'
|
|
97
96
|
puts "http://github.com/trishume/pro"
|
98
97
|
end
|
99
98
|
|
99
|
+
if PROFILER_OUT
|
100
|
+
result = RubyProf.stop
|
101
|
+
printer = RubyProf::GraphHtmlPrinter.new(result)
|
102
|
+
f = File.open(PROFILER_OUT, "w+")
|
103
|
+
printer.print(f)
|
104
|
+
end
|
data/lib/pro/commands.rb
CHANGED
@@ -48,9 +48,9 @@ module Pro
|
|
48
48
|
|
49
49
|
def run_command(command, confirm = true)
|
50
50
|
if confirm
|
51
|
-
print "Do you really want to run '#{command.bold}' on all repos [
|
52
|
-
ans = STDIN.gets
|
53
|
-
return
|
51
|
+
print "Do you really want to run '#{command.bold}' on all repos [Yn]? "
|
52
|
+
ans = STDIN.gets.chomp.downcase
|
53
|
+
return unless ans == 'y' || ans.empty?
|
54
54
|
end
|
55
55
|
@index.each do |r|
|
56
56
|
Dir.chdir(r.path)
|
@@ -119,7 +119,7 @@ module Pro
|
|
119
119
|
def install_cd
|
120
120
|
puts CD_INFO
|
121
121
|
print "Continue with installation (yN)? "
|
122
|
-
return unless gets.chomp == "y"
|
122
|
+
return unless gets.chomp.downcase == "y"
|
123
123
|
# get name
|
124
124
|
print "Name of pro cd command (default 'pd'): "
|
125
125
|
name = gets.strip
|
@@ -132,8 +132,8 @@ module Pro
|
|
132
132
|
path = File.expand_path(rel_path)
|
133
133
|
next unless File.exists?(path)
|
134
134
|
# ask the user if they want to add it
|
135
|
-
print "Install #{name} function to #{rel_path}
|
136
|
-
next unless gets.chomp == "y"
|
135
|
+
print "Install #{name} function to #{rel_path} [yN]: "
|
136
|
+
next unless gets.chomp.downcase == "y"
|
137
137
|
# add it on to the end of the file
|
138
138
|
File.open(path,'a') do |file|
|
139
139
|
file.puts func
|
data/lib/pro/indexer.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "pro/index"
|
2
2
|
require "colored"
|
3
|
+
require "yaml"
|
3
4
|
module Pro
|
4
5
|
# creates an index object from cache
|
5
6
|
# or by searching the file system
|
@@ -34,9 +35,10 @@ module Pro
|
|
34
35
|
|
35
36
|
# spins off a background process to update the cache file
|
36
37
|
def run_index_process
|
37
|
-
fork {
|
38
|
+
p1 = fork {
|
38
39
|
index_process unless File.exists?(INDEXER_LOCK_PATH)
|
39
40
|
}
|
41
|
+
Process.detach(p1)
|
40
42
|
end
|
41
43
|
|
42
44
|
def index_process
|
@@ -121,8 +123,6 @@ module Pro
|
|
121
123
|
repos << Repo.new(base_name,path)
|
122
124
|
Find.prune
|
123
125
|
end
|
124
|
-
# slow down
|
125
|
-
sleep(1.0/10000.0) if @low_cpu
|
126
126
|
end
|
127
127
|
repos
|
128
128
|
end
|
data/lib/pro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Hume
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fuzzy_match
|