geminstaller 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.loadpath +5 -0
- data/History.txt +5 -0
- data/Manifest.txt +4 -0
- data/TODO.txt +3 -3
- data/ci/cruisecontrol +50 -0
- data/lib/geminstaller/application.rb +1 -1
- data/lib/geminstaller/arg_parser.rb +2 -0
- data/lib/geminstaller/config_builder.rb +13 -8
- data/lib/geminstaller/dependency_injector.rb +1 -0
- data/lib/geminstaller/gem_runner_proxy.rb +13 -2
- data/lib/geminstaller/geminstaller_access_error.rb +4 -0
- data/lib/geminstaller/geminstaller_error.rb +2 -2
- data/lib/geminstaller/requires.rb +1 -0
- data/lib/geminstaller.rb +1 -1
- data/website/src/analytics.page +6 -0
- data/website/src/default.template +2 -0
- data/website/src/documentation/index.page +1 -1
- data/website/src/index.page +5 -1
- metadata +14 -6
data/.loadpath
ADDED
data/History.txt
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
== 0.x.y / yyyy-mm-dd
|
2
2
|
|
3
|
+
== 0.2.4 / 2007-10-21
|
4
|
+
* Look for config file at config/geminstaller.yml as well as geminstaller.yml
|
5
|
+
* Make startup message ('Installing Gems...') debug level instead of info
|
6
|
+
* Add custom descriptive error if user gets access permission error when installing a gem
|
7
|
+
|
3
8
|
== 0.2.3 / 2007-08-03
|
4
9
|
* remove Autogem#process_gem debug statement
|
5
10
|
* Don't reset test_gem_home in test_gem_home_spec, shaves about 18 seconds off suite
|
data/Manifest.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
.loadpath
|
1
2
|
COPYING
|
2
3
|
History.txt
|
3
4
|
LICENSE
|
@@ -6,6 +7,7 @@ README.txt
|
|
6
7
|
Rakefile
|
7
8
|
TODO.txt
|
8
9
|
bin/geminstaller
|
10
|
+
ci/cruisecontrol
|
9
11
|
geminstaller.yml
|
10
12
|
lib/geminstaller.rb
|
11
13
|
lib/geminstaller/application.rb
|
@@ -26,6 +28,7 @@ lib/geminstaller/gem_list_checker.rb
|
|
26
28
|
lib/geminstaller/gem_runner_proxy.rb
|
27
29
|
lib/geminstaller/gem_source_index_proxy.rb
|
28
30
|
lib/geminstaller/gem_spec_manager.rb
|
31
|
+
lib/geminstaller/geminstaller_access_error.rb
|
29
32
|
lib/geminstaller/geminstaller_error.rb
|
30
33
|
lib/geminstaller/hoe_extensions.rb
|
31
34
|
lib/geminstaller/install_processor.rb
|
@@ -51,6 +54,7 @@ start_local_gem_server.sh
|
|
51
54
|
test/test_all.rb
|
52
55
|
website/config.yaml
|
53
56
|
website/metainfo.yaml
|
57
|
+
website/src/analytics.page
|
54
58
|
website/src/code/index.page
|
55
59
|
website/src/community/index.page
|
56
60
|
website/src/community/links.page
|
data/TODO.txt
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
+
=============== Unfiled =============
|
2
|
+
* Dynamically detect posix platform and check if gem repo is completely writeable. Ignorable prompt?
|
1
3
|
* Figure out how to suppress webrick messages from embedded gem server
|
2
4
|
* Allow array or eval'able string of gems to be passed as --gems arg or instead of args
|
3
5
|
* Add @options[:gems], should be parsed from command line
|
4
6
|
=============== 0.2.6
|
5
|
-
* Understand environment.rb vs boot.rb. Add doc references.
|
6
|
-
* Catch permission errors, and print descriptive instructions on how to handle sudo. "Uh Oh! A gem installation failed because it did not have permission to write to the filesystem. If you want to have automated GemInstaller goodness, you'll have to fix this. Don't worry, it's easy! You have three basic choices: ..."
|
7
|
+
* Understand environment.rb vs boot.rb (bottom line: env is not processed before Initializer, so can't be used to load rails gems). Add doc references.
|
7
8
|
* docs - clean up sudo section. Should be clearer about sudoers entry, and make sure that NOPASSWD is the last entry.
|
8
9
|
* Faq - mention sudo
|
9
10
|
* Faq - mention Zed's questions
|
10
11
|
* design - dependency management is good. Maven got it right, if not for the jelly...
|
11
|
-
* search for config/geminstaller.yml by default
|
12
12
|
* Investigate gem_plugin. Plugin for mongrel???
|
13
13
|
================ 0.2.8 release ===================
|
14
14
|
* Rename API: deprecate 'autogem' and rename to 'loadgems'; change current 'run' to 'install'; add new 'run' which automatically calls both 'install' and 'gem', add 'no-loadgems' option (only applicable when invoked programatically) to supress automatic 'loadgems
|
data/ci/cruisecontrol
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
CRUISECONTROL_DIR=/home/woolley/workspace/geminstaller_ci
|
2
|
+
CRUISECONTROL_CMD=$CRUISECONTROL_DIR/cruise
|
3
|
+
PIDFILE=/tmp/cruisecontrol.pid
|
4
|
+
|
5
|
+
if [ "$CRUISECONTROL_USER" = "" ] ; then
|
6
|
+
CRUISECONTROL_USER=cruisecontrol
|
7
|
+
fi
|
8
|
+
|
9
|
+
if [ "$JAVA_HOME" = "" ] ; then
|
10
|
+
export JAVA_HOME=/usr/java/jdk
|
11
|
+
fi
|
12
|
+
export PATH=$PATH:$JAVA_HOME/bin
|
13
|
+
|
14
|
+
case "$1" in
|
15
|
+
start)
|
16
|
+
echo -n "Starting CruiseControl"
|
17
|
+
cd $CRUISECONTROL_DIR
|
18
|
+
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile --user $CRUISECONTROL_USER --chuid $CRUISECONTROL_USER --chdir /home/woolley/workspace/geminstaller_ci --exec $CRUISECONTROL_CMD -- start >> /var/log/cruisecontrol/cruisecontrol.log 2>&1 &
|
19
|
+
echo "."
|
20
|
+
;;
|
21
|
+
stop)
|
22
|
+
echo "Stopping CruiseControl"
|
23
|
+
PARPID=`cat $PIDFILE`
|
24
|
+
if [ "$PARPID" = "" ] ; then
|
25
|
+
echo "No pidfile found for cruisecontrol, nothing to stop"
|
26
|
+
exit 1
|
27
|
+
fi
|
28
|
+
start-stop-daemon --stop --quiet --pidfile $PIDFILE
|
29
|
+
echo "."
|
30
|
+
CHILDPIDS=`ps -ea -o "pid ppid args" | grep -v grep | grep "${PARPID}" | grep -v "^ ${PARPID}" | \
|
31
|
+
sed -e 's/^ *//' -e 's/ .*//'`
|
32
|
+
if [ "${CHILDPIDS}" != "" ]; then
|
33
|
+
echo "Killing child processes: $CHILDPIDS"
|
34
|
+
kill -9 ${CHILDPIDS}
|
35
|
+
echo "Done killing child processes."
|
36
|
+
else
|
37
|
+
echo "No child processes killed."
|
38
|
+
fi
|
39
|
+
;;
|
40
|
+
restart)
|
41
|
+
$0 stop
|
42
|
+
sleep 2
|
43
|
+
$0 start
|
44
|
+
;;
|
45
|
+
*)
|
46
|
+
echo "Usage: /etc/init.d/cruisecontrol {start|stop|restart}"
|
47
|
+
exit 1
|
48
|
+
esac
|
49
|
+
|
50
|
+
exit 0
|
@@ -19,6 +19,8 @@ module GemInstaller
|
|
19
19
|
@options[:geminstaller_output] = [:error,:install,:info]
|
20
20
|
@options[:rubygems_output] = [:stderr]
|
21
21
|
@output = ""
|
22
|
+
@unparsed_geminstaller_output_flags = nil
|
23
|
+
@unparsed_rubygems_output_flags = nil
|
22
24
|
opts = OptionParser.new do |opts|
|
23
25
|
opts.banner = "Usage: geminstaller [options]"
|
24
26
|
|
@@ -4,23 +4,27 @@ require File.expand_path("#{dir}/requires.rb")
|
|
4
4
|
module GemInstaller
|
5
5
|
class ConfigBuilder
|
6
6
|
attr_reader :config_file_paths_array
|
7
|
-
attr_writer :file_reader
|
8
|
-
attr_writer :yaml_loader
|
9
|
-
attr_writer :config_file_paths
|
7
|
+
attr_writer :file_reader, :yaml_loader, :config_file_paths, :output_filter
|
10
8
|
|
11
|
-
def
|
12
|
-
|
9
|
+
def initialize(default_config_file_paths_array = ['geminstaller.yml','config/geminstaller.yml'])
|
10
|
+
@default_config_file_paths_array = default_config_file_paths_array
|
13
11
|
end
|
14
|
-
|
12
|
+
|
15
13
|
def build_config
|
16
|
-
@config_file_paths
|
17
|
-
@config_file_paths_array = @config_file_paths.split(",")
|
14
|
+
@config_file_paths_array = @config_file_paths ? @config_file_paths.split(",") : @default_config_file_paths_array
|
18
15
|
merged_defaults = {}
|
19
16
|
merged_gems = {}
|
17
|
+
file_found = false
|
20
18
|
@config_file_paths_array.each do |path|
|
19
|
+
if File.exists?(path)
|
20
|
+
file_found = true
|
21
|
+
else
|
22
|
+
next
|
23
|
+
end
|
21
24
|
file_contents = @file_reader.read(path)
|
22
25
|
next unless file_contents
|
23
26
|
next if file_contents.empty?
|
27
|
+
@output_filter.geminstaller_output(:debug,"Found GemInstaller config file at: #{File.expand_path(path)}\n")
|
24
28
|
file_contents_erb = ERB.new(%{#{file_contents}})
|
25
29
|
yaml = @yaml_loader.load(file_contents_erb.result)
|
26
30
|
merged_defaults.merge!(yaml['defaults']) unless yaml['defaults'].nil?
|
@@ -30,6 +34,7 @@ module GemInstaller
|
|
30
34
|
merged_gems[gem_key] = gem
|
31
35
|
end
|
32
36
|
end
|
37
|
+
raise GemInstaller::MissingFileError.new("No config files found at any of these paths: #{@config_file_paths_array.join(', ')}") unless file_found
|
33
38
|
merged_yaml = {}
|
34
39
|
merged_yaml['defaults'] = merged_defaults
|
35
40
|
merged_yaml['gems'] = merged_gems.values
|
@@ -43,6 +43,7 @@ module GemInstaller
|
|
43
43
|
@config_builder = GemInstaller::ConfigBuilder.new
|
44
44
|
@config_builder.file_reader = @file_reader
|
45
45
|
@config_builder.yaml_loader = @yaml_loader
|
46
|
+
@config_builder.output_filter = @output_filter
|
46
47
|
|
47
48
|
@gem_source_index = Gem::SourceIndex.new
|
48
49
|
@gem_source_index_proxy = GemInstaller::GemSourceIndexProxy.new
|
@@ -35,8 +35,19 @@ module GemInstaller
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def raise_error_with_output(exit_error, args, listener)
|
38
|
-
|
39
|
-
|
38
|
+
error_class = exit_error.class
|
39
|
+
error_message = exit_error.message
|
40
|
+
gem_command_output = listener.read!
|
41
|
+
if gem_command_output.join('') =~ /Errno::EACCES/
|
42
|
+
error_message = access_error_message + "\n" + error_message
|
43
|
+
error_class = GemInstaller::GemInstallerAccessError
|
44
|
+
end
|
45
|
+
descriptive_exit_message = exit_error.descriptive_exit_message(error_message, 'gem', args, gem_command_output)
|
46
|
+
raise error_class.new(descriptive_exit_message)
|
47
|
+
end
|
48
|
+
|
49
|
+
def access_error_message
|
50
|
+
"You don't have permission to install a gem.\nThis is not a problem with GemInstaller.\nYou probably want use the --sudo option or run GemInstaller as sudo,\nor install your gems to a non-root-owned location.\nSee http://geminstaller.rubyforge.org/documentation/documentation.html#dealing_with_sudo\n"
|
40
51
|
end
|
41
52
|
end
|
42
53
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module GemInstaller
|
2
2
|
class GemInstallerError < RuntimeError
|
3
|
-
def descriptive_exit_message(message, command, args,
|
3
|
+
def descriptive_exit_message(message, command, args, gem_command_output)
|
4
4
|
args_string = args.join(" ")
|
5
5
|
descriptive_exit_message = "\n=========================================================\n"
|
6
6
|
descriptive_exit_message += "#{message}\n"
|
7
7
|
descriptive_exit_message += "Gem command was:\n #{command} #{args_string}\n\n"
|
8
8
|
descriptive_exit_message += "Gem command output was:\n"
|
9
|
-
descriptive_exit_message +=
|
9
|
+
descriptive_exit_message += gem_command_output.join("\n")
|
10
10
|
descriptive_exit_message += "\n=========================================================\n\n"
|
11
11
|
end
|
12
12
|
end
|
@@ -60,6 +60,7 @@ require File.expand_path("#{dir}/gem_runner_proxy")
|
|
60
60
|
require File.expand_path("#{dir}/gem_source_index_proxy")
|
61
61
|
require File.expand_path("#{dir}/gem_spec_manager")
|
62
62
|
require File.expand_path("#{dir}/geminstaller_error")
|
63
|
+
require File.expand_path("#{dir}/geminstaller_access_error")
|
63
64
|
require File.expand_path("#{dir}/install_processor")
|
64
65
|
require File.expand_path("#{dir}/missing_dependency_finder")
|
65
66
|
require File.expand_path("#{dir}/missing_file_error")
|
data/lib/geminstaller.rb
CHANGED
@@ -21,7 +21,7 @@ gems:
|
|
21
21
|
|
22
22
|
h2. Using GemInstaller with Ruby on Rails
|
23
23
|
|
24
|
-
* Create geminstaller.yml in the RAILS_ROOT/config directory. Include entries for your Rails version, and any other gems your app needs (Note: If you are too lazy to make your config file manually, or don't know what gems you need, see the tutorial on "Bootstrapping your GemInstaller Config with the <code>--print-rogue-gems</code> option":tutorials#bootstrapping_your_geminstaller_config):
|
24
|
+
* Create geminstaller.yml in the RAILS_ROOT/config directory. Include entries for your Rails version, and any other gems your app needs (Note: If you are too lazy to make your config file manually, or don't know what gems you need, see the tutorial on "Bootstrapping your GemInstaller Config with the <code>--print-rogue-gems</code> option":tutorials.html#bootstrapping_your_geminstaller_config):
|
25
25
|
|
26
26
|
<pre>
|
27
27
|
\---
|
data/website/src/index.page
CHANGED
@@ -34,12 +34,16 @@ GemInstaller was created by "Chad Woolley":http://www.thewoolleyweb.com.
|
|
34
34
|
|
35
35
|
h2(#known_bugs). Known Bugs
|
36
36
|
|
37
|
-
Currently (as of version 0.2.
|
37
|
+
Currently (as of version 0.2.4), the only _major_ known bug is related to auto-installing the Rails or Mongrel gems via boot.rb during startup of Mongrel or Webrick. The simple workaround is to run GemInstaller manually or just restart Rails anytime GemInstaller auto-installs a Rails/Mongrel gem upgrade during app startup. For Rails and other deployable apps, you can also "run GemInstaller from Capistrano":documentation/tutorials.html#running_geminstaller_from_capistrano to avoid this problem in demo/production environments. Researching and fixing this problem is a top priority. I bet there's another bug or twoo, so please "report them if you find them":http://rubyforge.org/tracker/?group_id=1902!
|
38
38
|
|
39
39
|
There's also some leakage of gem doc warning messages even if you turn down --rubygems-output, but these can be ignored (these same messages show up when installing gems manually). This should be fixed soon.
|
40
40
|
|
41
41
|
h2(#history). History
|
42
42
|
|
43
|
+
* 0.2.4
|
44
|
+
** Look for config file at config/geminstaller.yml as well as geminstaller.yml
|
45
|
+
** make startup message ('Installing Gems...') debug level instead of info
|
46
|
+
** Add custom descriptive error if user gets access permission error when installing a gem
|
43
47
|
* 0.2.3 - Fix debug statement left in, upgrade rspec, improvements to test suite
|
44
48
|
* 0.2.2 - Fix performance problems with autogem command (don't manually recurse dependencies, gem method does it already)
|
45
49
|
* 0.2.1 - RubyGems release 0.9.3 had some major refactoring done to the internals, which broke GemInstaller 0.2.0. GemInstaller 0.2.1 is a patch release to fix this. I did limited testing on 0.9.3 and 0.9.0. Please let me know if anything is broken on any version of RubyGems.
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: geminstaller
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.2.4
|
7
|
+
date: 2007-10-21 00:00:00 -07:00
|
8
8
|
summary: GemInstaller provides automated management of RubyGems.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -29,6 +29,7 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Chad Woolley
|
31
31
|
files:
|
32
|
+
- .loadpath
|
32
33
|
- COPYING
|
33
34
|
- History.txt
|
34
35
|
- LICENSE
|
@@ -37,6 +38,7 @@ files:
|
|
37
38
|
- Rakefile
|
38
39
|
- TODO.txt
|
39
40
|
- bin/geminstaller
|
41
|
+
- ci/cruisecontrol
|
40
42
|
- geminstaller.yml
|
41
43
|
- lib/geminstaller.rb
|
42
44
|
- lib/geminstaller/application.rb
|
@@ -57,6 +59,7 @@ files:
|
|
57
59
|
- lib/geminstaller/gem_runner_proxy.rb
|
58
60
|
- lib/geminstaller/gem_source_index_proxy.rb
|
59
61
|
- lib/geminstaller/gem_spec_manager.rb
|
62
|
+
- lib/geminstaller/geminstaller_access_error.rb
|
60
63
|
- lib/geminstaller/geminstaller_error.rb
|
61
64
|
- lib/geminstaller/hoe_extensions.rb
|
62
65
|
- lib/geminstaller/install_processor.rb
|
@@ -82,6 +85,7 @@ files:
|
|
82
85
|
- test/test_all.rb
|
83
86
|
- website/config.yaml
|
84
87
|
- website/metainfo.yaml
|
88
|
+
- website/src/analytics.page
|
85
89
|
- website/src/code/index.page
|
86
90
|
- website/src/community/index.page
|
87
91
|
- website/src/community/links.page
|
@@ -95,10 +99,14 @@ files:
|
|
95
99
|
- website/src/index.page
|
96
100
|
test_files:
|
97
101
|
- test/test_all.rb
|
98
|
-
rdoc_options:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
+
rdoc_options:
|
103
|
+
- --main
|
104
|
+
- README.txt
|
105
|
+
extra_rdoc_files:
|
106
|
+
- History.txt
|
107
|
+
- Manifest.txt
|
108
|
+
- README.txt
|
109
|
+
- TODO.txt
|
102
110
|
executables:
|
103
111
|
- geminstaller
|
104
112
|
extensions: []
|