fnando-pez 0.0.7 → 0.0.8
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.
- data/History.txt +5 -0
- data/README.markdown +5 -0
- data/lib/pez/base.rb +23 -8
- data/pez.gemspec +3 -3
- metadata +2 -2
data/History.txt
CHANGED
data/README.markdown
CHANGED
data/lib/pez/base.rb
CHANGED
@@ -3,6 +3,7 @@ module Pez
|
|
3
3
|
CONFIG_FILE = File.dirname(__FILE__) + '/../../templates/pez.yml'
|
4
4
|
|
5
5
|
module Base
|
6
|
+
|
6
7
|
def self.git?(url, options={})
|
7
8
|
options["type"] == "git" || url =~ /^git:/ || url =~ /\.git$/
|
8
9
|
end
|
@@ -25,8 +26,8 @@ module Pez
|
|
25
26
|
|
26
27
|
def self.add_to_config(name, url, options={})
|
27
28
|
c = config
|
28
|
-
c
|
29
|
-
c[
|
29
|
+
c ||= {}
|
30
|
+
c[name] = {
|
30
31
|
'repo' => url,
|
31
32
|
'type' => options[:type],
|
32
33
|
'revision' => options[:revision],
|
@@ -40,8 +41,8 @@ module Pez
|
|
40
41
|
|
41
42
|
def self.remove_from_config(name)
|
42
43
|
c = config
|
43
|
-
c
|
44
|
-
c
|
44
|
+
c ||= {}
|
45
|
+
c.delete(name)
|
45
46
|
|
46
47
|
File.open('config/plugins.yml', 'w+') do |f|
|
47
48
|
f << YAML::dump(c)
|
@@ -64,7 +65,7 @@ module Pez
|
|
64
65
|
if name
|
65
66
|
[name]
|
66
67
|
elsif options[:all]
|
67
|
-
Pez::Base.config ? (Pez::Base.config
|
68
|
+
Pez::Base.config ? (Pez::Base.config).keys : []
|
68
69
|
else
|
69
70
|
[]
|
70
71
|
end
|
@@ -146,7 +147,7 @@ module Pez
|
|
146
147
|
|
147
148
|
Pez::Base.plugins(name, options).each do |name|
|
148
149
|
dirname = "#{Pez::Base.destination}/#{name}"
|
149
|
-
data = c[
|
150
|
+
data = c[name]
|
150
151
|
|
151
152
|
puts "Retrieving #{name}..."
|
152
153
|
|
@@ -184,7 +185,7 @@ module Pez
|
|
184
185
|
|
185
186
|
Pez::Base.plugins(nil, {:all => 'all'}).each do |name|
|
186
187
|
dirname = "#{Pez::Base.destination}/#{name}"
|
187
|
-
data = c[
|
188
|
+
data = c[name]
|
188
189
|
|
189
190
|
if File.directory?(dirname)
|
190
191
|
system %( ln -s #{dirname} vendor/plugins/#{name} )
|
@@ -199,9 +200,23 @@ module Pez
|
|
199
200
|
|
200
201
|
Pez::Base.plugins(name, options).each do |name|
|
201
202
|
puts "Plugin: %s" % name
|
202
|
-
puts "Repository: %s" % c[
|
203
|
+
puts "Repository: %s" % c[name]['repo']
|
203
204
|
puts
|
204
205
|
end
|
205
206
|
end
|
206
207
|
end
|
208
|
+
end
|
209
|
+
|
210
|
+
class Hash
|
211
|
+
# Replacing the to_yaml function so it'll serialize hashes sorted (by their keys)
|
212
|
+
# Original from: http://snippets.dzone.com/posts/show/5811
|
213
|
+
def to_yaml( opts = {} )
|
214
|
+
YAML::quick_emit( object_id, opts ) do |out|
|
215
|
+
out.map( taguri, to_yaml_style ) do |map|
|
216
|
+
sort.each do |k, v|
|
217
|
+
map.add( k, v )
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
207
222
|
end
|
data/pez.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# WARNING : RAKE AUTO-GENERATED FILE. DO NOT MANUALLY EDIT!
|
2
2
|
# RUN : 'rake gem:update_gemspec'
|
3
|
-
|
3
|
+
|
4
4
|
Gem::Specification.new do |s|
|
5
|
-
s.date = "Thu Oct
|
5
|
+
s.date = "Thu Oct 07 13:54:10 -0300 2008"
|
6
6
|
s.authors = ["Nando Vieira"]
|
7
7
|
s.require_paths = ["lib"]
|
8
8
|
s.required_rubygems_version = ">= 0"
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
"lib/pez/base.rb",
|
20
20
|
"lib/pez.rb"]
|
21
21
|
s.email = ["fnando.vieira@gmail.com"]
|
22
|
-
s.version = "0.0.
|
22
|
+
s.version = "0.0.8"
|
23
23
|
s.homepage = "http://github.com/fnando/pez"
|
24
24
|
s.requirements = ["You'll need GIT and Subversion installed"]
|
25
25
|
s.name = "pez"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fnando-pez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-07 09:54:10 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|