pro 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c1467a440f86acd5195037d3a67bf83f8522f01
4
- data.tar.gz: f49121a776fa2160cf68e7520f2e3391e7da2fe7
3
+ metadata.gz: 841eaadb5955d7fbc015c7897e8ec4e133a2b897
4
+ data.tar.gz: 7faa5f87d627d4bdfc3d175121553e94192c167d
5
5
  SHA512:
6
- metadata.gz: 1824be9724e5ddb7fc6670e4bdc7f309f49829a00afd67095dc31b11357d605b6afbf12f587174580d2993fc8eada626b588951a413058e4cb34000be2af6b06
7
- data.tar.gz: 1d57c8743389b1bf766001dd3d33c74576764ac814a93c08e302179fcdb3f0587315d2c6a4c0dbab933c587f5a7525f71e8083374e58a5c4348369a9d04fb6f9
6
+ metadata.gz: 6f6c4be18f7868208537f0d2378801da198218a1605a027219f7eddfe6364d9d4255b4d5739fe65987ac21f321185f7cb87737533bdb864f43ac5808fb28d4a5
7
+ data.tar.gz: edfa7102fcc0f585ee579cf701f212a9700267c8a7375de24991b91b118858a450349f2f7b63cf3b09d1055205ae9a162ba358455b800b6f0150a8f748ff0203
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ spec/reports
17
17
  test/tmp
18
18
  test/version_tmp
19
19
  tmp
20
+ profile.html
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
- require "pro"
5
- require "yaml"
4
+ PROFILER_OUT=nil
6
5
 
7
- $pryAvailable = true
8
- begin
9
- require "pry"
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
- binding.pry if $pryAvailable
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
@@ -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 [Y/n]? "
52
- ans = STDIN.gets
53
- return if ans.chomp != "Y"
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} (yN): "
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Pro
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
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.2
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-06 00:00:00.000000000 Z
11
+ date: 2013-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fuzzy_match