fnando-pez 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -37,3 +37,8 @@
37
37
  * 2 major enhancements:
38
38
  * Splitted config files in pez.yml and plugins.yml
39
39
  * Prioritize ~/.pezrc, if it exists
40
+
41
+ == 0.0.8 2008-10-07
42
+
43
+ * 1 minor enhancement:
44
+ * Sort YAML keys in to_yaml
data/README.markdown CHANGED
@@ -87,6 +87,11 @@ MAINTAINER
87
87
 
88
88
  * Nando Vieira ([http://simplesideias.com.br](http://simplesideias.com.br))
89
89
 
90
+ CONTRIBUTORS
91
+ ----------
92
+
93
+ * Arthur Zapparoli ([http://arthurgeek.net](http://arthurgeek.net))
94
+
90
95
  LICENSE:
91
96
  --------
92
97
 
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['plugins'] ||= {}
29
- c['plugins'][name] = {
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['plugins'] ||= {}
44
- c['plugins'].delete(name)
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["plugins"]).keys : []
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['plugins'][name]
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['plugins'][name]
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['plugins'][name]['repo']
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 02 23:08:10 -0300 2008"
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.7"
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.7
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-02 19:08:10 -07:00
12
+ date: 2008-10-07 09:54:10 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency