gill 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gill/cli.rb CHANGED
@@ -81,11 +81,12 @@ module Gill
81
81
  #
82
82
  # @param [String] args The category and repository name to remove.
83
83
  #
84
- def CLI.remove(args)
84
+ def CLI.remove(repo_name)
85
85
  begin
86
- # Raise exception if the params are not seperated by a `#`.
87
- raise(SyntaxError, "Invalid Syntax. Arguments must be separated by `#`") unless args =~ /\#/
88
- Remove.new(args).remove_repo
86
+
87
+ Gill.config.find_repo_paths_by_name(repo_name, false) do |repo,path,category|
88
+ Remove.new("#{category}##{repo}").remove_repo
89
+ end
89
90
 
90
91
  rescue => e
91
92
  STDERR.puts "Error: #{e}"
data/lib/gill/config.rb CHANGED
@@ -162,11 +162,12 @@ module Gill
162
162
  #
163
163
  # @return [String] Repository Path
164
164
  #
165
- def find_repo_paths_by_name(repo_name)
166
- Gill.config.categories.each do |key,value|
167
- value.each do |k,v|
168
- STDOUT.puts "#{k} => #{green(v[:path])}" if repo_name =~ /#{k.to_s}/
169
- end
165
+ def find_repo_paths_by_name(repo_name,pretty_print=true,&block)
166
+ repos = Dir[File.join(Gill.config.source_path, '**', "*#{repo_name}*")]
167
+ repos.each do |path|
168
+ next unless Gill.config.paths.include?(path)
169
+ yield [basename(path),path,basename(parent(path))] if block && !pretty_print
170
+ STDOUT.puts "#{basename(path)} => #{green(path)}" if pretty_print
170
171
  end
171
172
  end
172
173
 
data/lib/gill/git.rb CHANGED
@@ -83,7 +83,7 @@ module Gill
83
83
  # Update/Bundle Repository
84
84
  #
85
85
  def update
86
- paths = Dir[File.join(Gill.config.source_path,'**',@repo_name)]
86
+ paths = Dir[File.join(Gill.config.source_path, '**', "*#{@repo_name}*")]
87
87
  paths.each do |path|
88
88
  if Gill.config.paths.include?(path)
89
89
  ask "Update #{basename(path)} => #{green(path)}?", :default => true do
data/lib/gill/remove.rb CHANGED
@@ -66,8 +66,10 @@ module Gill
66
66
 
67
67
  def remove_repository_files
68
68
  find_parents_for_repo(cached_repo_path)
69
-
70
- ask "Are you sure you want to remove the repository: #{@repo_name}?", :default => false do
69
+ remove_question =<<-QUESTION
70
+ Are you sure you want to remove the repository: #{@repo_name} => #{@repo_path}?
71
+ QUESTION
72
+ ask remove_question.strip, :default => false do
71
73
  STDOUT.puts green("#{@repo_name.capitalize} removed successfully.")
72
74
  FileUtils.rm_rf(cached_repo_path)
73
75
  end
data/lib/gill/version.rb CHANGED
@@ -2,6 +2,6 @@ module Gill
2
2
 
3
3
  # VERSION
4
4
  # @return [String] Gill Version Number
5
- VERSION = '1.1.0'
5
+ VERSION = '1.2.0'
6
6
 
7
7
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 1.1.0
9
+ version: 1.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dustin Willis Webber
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-26 00:00:00 -04:00
17
+ date: 2010-09-05 00:00:00 -04:00
18
18
  default_executable: gill
19
19
  dependencies: []
20
20
 
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- hash: 2163447694756148579
80
+ hash: 3789058096501109421
81
81
  segments:
82
82
  - 0
83
83
  version: "0"