fnando-pez 0.0.6 → 0.0.7

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 CHANGED
@@ -27,3 +27,13 @@
27
27
 
28
28
  * 1 bug fix:
29
29
  * Couldn't symlink to relative paths
30
+
31
+ == 0.0.7 2008-10-03
32
+
33
+ * 1 bug fix:
34
+ * Now handling blank plugins.yml on update
35
+ * 1 minor enhancement:
36
+ * If plugins.yml already exists, it'll run update
37
+ * 2 major enhancements:
38
+ * Splitted config files in pez.yml and plugins.yml
39
+ * Prioritize ~/.pezrc, if it exists
data/bin/pez CHANGED
@@ -115,6 +115,8 @@ Main {
115
115
  mode(:setup) {
116
116
  description <<-TXT
117
117
  Create the config file.
118
+
119
+ * if the file already exist, it'll try to install all plugins listed there
118
120
  TXT
119
121
 
120
122
  examples <<-TXT
data/lib/pez/base.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Pez
2
2
  VERSION = "0.0.5"
3
- CONFIG_FILE = File.dirname(__FILE__) + '/../../templates/plugins.yml'
3
+ CONFIG_FILE = File.dirname(__FILE__) + '/../../templates/pez.yml'
4
4
 
5
5
  module Base
6
6
  def self.git?(url, options={})
@@ -52,14 +52,19 @@ module Pez
52
52
  end
53
53
 
54
54
  def self.destination
55
- File.expand_path(config[Rails.env] || 'tmp/plugins')
55
+ if File.exists?(File.expand_path('~/.pezrc'))
56
+ c = YAML.load_file(File.expand_path('~/.pezrc'))
57
+ else
58
+ c = YAML.load_file('config/pez.yml')
59
+ end
60
+ File.expand_path(c[Rails.env] || 'tmp/plugins')
56
61
  end
57
62
 
58
63
  def self.plugins(name, options={})
59
64
  if name
60
65
  [name]
61
66
  elsif options[:all]
62
- (Pez::Base.config["plugins"] || {}).keys
67
+ Pez::Base.config ? (Pez::Base.config["plugins"]).keys : []
63
68
  else
64
69
  []
65
70
  end
@@ -68,14 +73,20 @@ module Pez
68
73
 
69
74
  module Command
70
75
  def self.setup
71
- puts 'Configuration file already generated at config/plugins.yml' and return if File.exists?('config/plugins.yml')
72
-
73
- File.open('config/plugins.yml', 'w') do |f|
74
- base_path = IO.popen('pwd').read.chomp
75
- contents = File.read(CONFIG_FILE)
76
- contents.gsub!(/%base_path%/, base_path)
76
+ if File.exists?('config/plugins.yml')
77
+ puts 'Configuration file already generated at config/plugins.yml. Pez will try to install the plugins listed there.'
78
+ self.update(nil, {:all => 'all'})
79
+ else
80
+
81
+ File.open('config/pez.yml', 'w') do |f|
82
+ base_path = IO.popen('pwd').read.chomp
83
+ contents = File.read(CONFIG_FILE)
84
+ contents.gsub!(/%base_path%/, base_path)
85
+
86
+ f << contents
87
+ end unless File.exists?(File.expand_path('~/.pezrc'))
77
88
 
78
- f << contents
89
+ File.open('config/plugins.yml', 'w')
79
90
  end
80
91
  end
81
92
 
data/pez.gemspec CHANGED
@@ -13,13 +13,13 @@ Gem::Specification.new do |s|
13
13
  "License.txt",
14
14
  "README.markdown",
15
15
  "TODO.txt",
16
- "templates/plugins.yml",
16
+ "templates/pez.yml",
17
17
  "bin/pez",
18
18
  "lib/pez",
19
19
  "lib/pez/base.rb",
20
20
  "lib/pez.rb"]
21
21
  s.email = ["fnando.vieira@gmail.com"]
22
- s.version = "0.0.6"
22
+ s.version = "0.0.7"
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"
File without changes
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
@@ -46,7 +46,7 @@ files:
46
46
  - License.txt
47
47
  - README.markdown
48
48
  - TODO.txt
49
- - templates/plugins.yml
49
+ - templates/pez.yml
50
50
  - bin/pez
51
51
  - lib/pez
52
52
  - lib/pez/base.rb