jwhitmire-geminstaller 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/COPYING +1 -0
  2. data/History.txt +82 -0
  3. data/LICENSE +21 -0
  4. data/Manifest.txt +78 -0
  5. data/README.txt +77 -0
  6. data/Rakefile +210 -0
  7. data/TODO.txt +138 -0
  8. data/authors +2 -0
  9. data/bin/geminstaller +30 -0
  10. data/cruise_config.rb +23 -0
  11. data/focused_spec.sh +2 -0
  12. data/focused_spec_debug.sh +2 -0
  13. data/geminstaller.yml +47 -0
  14. data/lib/geminstaller/application.rb +112 -0
  15. data/lib/geminstaller/arg_parser.rb +177 -0
  16. data/lib/geminstaller/autogem.rb +48 -0
  17. data/lib/geminstaller/backward_compatibility.rb +17 -0
  18. data/lib/geminstaller/bundler_exporter.rb +19 -0
  19. data/lib/geminstaller/config.rb +68 -0
  20. data/lib/geminstaller/config_builder.rb +65 -0
  21. data/lib/geminstaller/enhanced_stream_ui.rb +71 -0
  22. data/lib/geminstaller/exact_match_list_command.rb +16 -0
  23. data/lib/geminstaller/file_reader.rb +31 -0
  24. data/lib/geminstaller/gem_arg_processor.rb +44 -0
  25. data/lib/geminstaller/gem_command_manager.rb +71 -0
  26. data/lib/geminstaller/gem_interaction_handler.rb +41 -0
  27. data/lib/geminstaller/gem_list_checker.rb +55 -0
  28. data/lib/geminstaller/gem_runner_proxy.rb +65 -0
  29. data/lib/geminstaller/gem_source_index_proxy.rb +21 -0
  30. data/lib/geminstaller/gem_spec_manager.rb +53 -0
  31. data/lib/geminstaller/geminstaller_access_error.rb +4 -0
  32. data/lib/geminstaller/geminstaller_error.rb +13 -0
  33. data/lib/geminstaller/hoe_extensions.rb +9 -0
  34. data/lib/geminstaller/install_processor.rb +71 -0
  35. data/lib/geminstaller/missing_dependency_finder.rb +46 -0
  36. data/lib/geminstaller/missing_file_error.rb +4 -0
  37. data/lib/geminstaller/noninteractive_chooser.rb +114 -0
  38. data/lib/geminstaller/outdated_gem_finder.rb +46 -0
  39. data/lib/geminstaller/output_filter.rb +49 -0
  40. data/lib/geminstaller/output_listener.rb +33 -0
  41. data/lib/geminstaller/output_observer.rb +36 -0
  42. data/lib/geminstaller/output_proxy.rb +36 -0
  43. data/lib/geminstaller/registry.rb +137 -0
  44. data/lib/geminstaller/requires.rb +83 -0
  45. data/lib/geminstaller/rogue_gem_finder.rb +195 -0
  46. data/lib/geminstaller/ruby_gem.rb +58 -0
  47. data/lib/geminstaller/rubygems_exit.rb +5 -0
  48. data/lib/geminstaller/rubygems_extensions.rb +9 -0
  49. data/lib/geminstaller/rubygems_version_checker.rb +21 -0
  50. data/lib/geminstaller/rubygems_version_warnings.rb +38 -0
  51. data/lib/geminstaller/source_index_search_adapter.rb +41 -0
  52. data/lib/geminstaller/unauthorized_dependency_prompt_error.rb +4 -0
  53. data/lib/geminstaller/unexpected_prompt_error.rb +4 -0
  54. data/lib/geminstaller/valid_platform_selector.rb +49 -0
  55. data/lib/geminstaller/version_specifier.rb +24 -0
  56. data/lib/geminstaller/yaml_loader.rb +22 -0
  57. data/lib/geminstaller.rb +103 -0
  58. data/lib/geminstaller_rails_preinitializer.rb +54 -0
  59. data/start_local_gem_server.sh +1 -0
  60. data/website/config.yaml +11 -0
  61. data/website/src/analytics.page +6 -0
  62. data/website/src/code/ci.virtual +5 -0
  63. data/website/src/code/coverage/index.virtual +5 -0
  64. data/website/src/code/index.page +92 -0
  65. data/website/src/code/rdoc/index.virtual +6 -0
  66. data/website/src/community/index.page +14 -0
  67. data/website/src/community/links.page +11 -0
  68. data/website/src/community/rubyforge.virtual +4 -0
  69. data/website/src/default.css +175 -0
  70. data/website/src/default.template +42 -0
  71. data/website/src/documentation/documentation.page +477 -0
  72. data/website/src/documentation/index.page +53 -0
  73. data/website/src/documentation/tutorials.page +337 -0
  74. data/website/src/download.page +12 -0
  75. data/website/src/faq.page +36 -0
  76. data/website/src/index.page +103 -0
  77. data/website/src/metainfo +54 -0
  78. data/website/src/webgen.css +112 -0
  79. metadata +139 -0
@@ -0,0 +1,337 @@
1
+ h1. Tutorials
2
+
3
+ These are tutorials which show how to use the various features of GemInstaller. They are mostly brief, only showing the commands you need to type.
4
+
5
+ If anything is unclear, or if you'd like to see a tutorial on a topic, please submit a request on the mailing list.
6
+
7
+ * "Installing GemInstaller":#installing_geminstaller
8
+ * "Bootstrapping your GemInstaller Config with the <code>--print-rogue-gems</code> option":#bootstrapping_your_geminstaller_config
9
+ * "Using the <code>autogem</code> Option to Automatically Require Gems":#using_the_autogem_option_to_automatically_require_gems
10
+ * "Integrating GemInstaller into Ruby on Rails":#integrating_geminstaller_into_ruby_on_rails
11
+ * "Using Common or Shared Config Files or Snippets":#using_common_or_shared_config_files
12
+ * "Running GemInstaller from Capistrano":#running_geminstaller_from_capistrano
13
+ * "Running GemInstaller from Vlad the Deployer":#running_geminstaller_from_vlad_the_deployer
14
+
15
+ h2(#installing_geminstaller). Installing GemInstaller
16
+
17
+ <pre><code>$ gem install geminstaller
18
+ - OR, if you get a permission error -
19
+ $ sudo gem install geminstaller
20
+ </code></pre>
21
+
22
+ See also: Docs on "installation":documentation.html#installation.
23
+
24
+ h2(#bootstrapping_your_geminstaller_config). Bootstrapping your GemInstaller Config with the <code>--print-rogue-gems</code> option
25
+
26
+ You may have no idea what gems your app uses, or you might just want to create a GemInstaller config file with all the gems currently on your system, in order to install the same gems on a different system. This tutorial will show you how to use the <code>--print-rogue-gems</code> option to automatically create a GemInstaller config file.
27
+
28
+ <pre><code>
29
+ $ geminstaller --print-rogue-gems > geminstaller.yml
30
+ </code></pre>
31
+
32
+ That was easy, wasn't it? This config file should specify the exact versions for all of the gems which are currently installed on your system.
33
+
34
+ Gotchas/Notes:
35
+
36
+ # If you generated the file on a unix/mac system with compiled gems and then try to run it on a different platform (like windows) which does not have a compiler, you may get errors. The "<code>prefer_binary_platform</code> config property":documentation.html#prefer_binary_platform_config_property (deprecated) will try to guess at the correct platform, but if a binary version of the gem does not exist for your platform, or if <code>prefer_binary_platform</code> fails to guess the right platform, you may still fail.
37
+ # The <code>--print-rogue-gems</code> option generates *exact* version specifications. This means that you won't ever get any gem upgrades by running GemInstaller with the standard generated file. This may be good (an upgrade can never break your app unexpectedly). However, you may wish to modify some of the version specifications to allow for upgrades. If you do this, remember to set the "<code>check_for_upgrade</code> config property":documentation.html#check_for_upgrade_config_property to true, but be aware that this will cause GemInstaller to check the remote gem server for upgrades each time it runs, and cause it to run slow or fail if the server is unavailable.
38
+
39
+ See also: Docs on "<code>--print-rogue-gems</code> option":documentation.html#print_rogue_gems_option, "<code>check_for_upgrade</code> config property":documentation.html#check_for_upgrade_config_property, and "<code>prefer_binary_platform</code> config property":documentation.html#prefer_binary_platform_config_property (deprecated).
40
+
41
+ h2(#using_the_autogem_option_to_automatically_require_gems). Using the <code>autogem</code> Option to Automatically Require Gems option
42
+
43
+ GemInstaller can automatically run the RubyGems 'gem' or 'require_gem' method to automatically add all of the gems in your GemInstaller config file(s) to the load path. Here's an example.
44
+
45
+ First, create a simple *<code>geminstaller.yml</code>* file:
46
+ <pre><code>---
47
+ gems:
48
+ - name: ruby-doom
49
+ version: '= 0.8'
50
+ </code></pre>
51
+
52
+ Now, we'll use <code>irb</code> to test autogem, and verify that it can add the ruby-doom gem to the load path:
53
+ <pre><code>
54
+ $ irb
55
+ irb(main):001:0> require 'rubygems'
56
+ => true
57
+ irb(main):002:0> require 'geminstaller'
58
+ => true
59
+ irb(main):003:0> GemInstaller.autogem('--config=geminstaller.yml')
60
+ => autogem returns the gem object(s) as it's return value...
61
+ irb(main):004:0> $: # Now verify the gem was added to the load path
62
+ => ["/usr/local/lib/ruby/gems/1.8/gems/ruby-doom-0.8/lib", ...]
63
+ </code></pre>
64
+
65
+ Note that <code>autogem</code> takes arguments in the same format as the GemInstaller command line and <code>run</code> method, but it ignores arguments which are not applicable (such as -r or -s). You could also specify no argument at all if you wanted to simply use the default <code>geminstaller.yml</code> file in the current directory. If you don't want a certain gem to be loaded, you can set the <code>no-autogem</code> property to true for that gem in your config file.
66
+
67
+ You can also put a call to <code>autogem</code> during your application startup to automatically load all the correct gem versions which are specified by your config file. See "Integrating GemInstaller into Ruby on Rails":#integrating_geminstaller_into_ruby_on_rails for an example.
68
+
69
+ See also: Docs on "Automatically Requiring Gems with the <code>autogem</code> Method":documentation.html#automatically_requiring_gems_with_the_autogem_method
70
+
71
+
72
+
73
+
74
+ h2(#integrating_geminstaller_into_ruby_on_rails). Integrating GemInstaller into Ruby on Rails
75
+
76
+ <strong>RAILS 2.0 UPDATE:</strong>
77
+
78
+ I've created a "Sample Rails App":http://geminstaller.rubyforge.org/svn/trunk/spec/fixture/sample_rails_app/ in the source, which shows how to use the Rails 2.0 config/preinitializer.rb hook. I need to spend some time updating the docs to reflect this, but for now just "check out the source":http://geminstaller.rubyforge.org/svn/trunk/spec/fixture/sample_rails_app/
79
+
80
+ <strong>OLD RAILS 1.0 INSTRUCTIONS:</strong>
81
+
82
+ GemInstaller can be configured to automatically install all gems in the config file, and add them to the load path when Rails boots. This means that you can check out and run your application anywhere, without having to worry about manually ensuring that the required dependency gems are installed. This works with Webrick and Mongrel.
83
+
84
+ First, you need a Rails app. I'll let you handle this step on your own. See the "Rails documentation":http://www.rubyonrails.org/docs for details.
85
+
86
+ Next, you need a *<code>geminstaller.yml</code>* config file. Create this under the Rails <code>config</code> directory. For details, see the documentation on the "config file":documentation.html#config_file and the tutorial on "bootstrapping your GemInstaller config with the <code>--print-rogue-gems</code> option":#bootstrapping_your_geminstaller_config. Here's an example config which contains only entries for Mongrel and Rails, and ruby-doom:
87
+
88
+ *RAILS_ROOT/config/geminstaller.yml*:
89
+ <pre><code> ---
90
+ defaults:
91
+ install_options: --include-dependencies
92
+ gems:
93
+ - name: ruby-doom
94
+ version: '= 0.8'
95
+ - name: rails
96
+ version: '= 1.1.6'
97
+ - name: mongrel
98
+ version: '= 1.0.1'
99
+ platform: <%= RUBY_PLATFORM =~ /mswin/ ? 'mswin32' : 'ruby'%>
100
+ </code></pre>
101
+
102
+ Once you have your *<code>geminstaller.yml</code>* created, the last step is to add calls to <code>GemInstaller.install</code> and <code>GemInstaller.autogem</code> in your boot.rb. They should be placed right after the block which defines the RAILS_ROOT constant, as shown below ("..." indicates omitted lines):
103
+
104
+
105
+ *RAILS_ROOT/config/boot.rb*:
106
+ <pre><code> ...
107
+ unless defined?(RAILS_ROOT)
108
+ ...
109
+ end
110
+
111
+ ############# Begin GemInstaller config - see http://geminstaller.rubyforge.org
112
+ require "rubygems"
113
+ require "geminstaller"
114
+
115
+ # Path(s) to your GemInstaller config file(s)
116
+ config_paths = "#{File.expand_path(RAILS_ROOT)}/config/geminstaller.yml"
117
+
118
+ # Arguments which will be passed to GemInstaller (you can add any extra ones)
119
+ args = "--config #{config_paths}"
120
+
121
+ # The 'exceptions' flag determines whether errors encountered while running GemInstaller
122
+ # should raise exceptions (and abort Rails), or just return a nonzero return code
123
+ args += " --exceptions"
124
+
125
+ # This will use sudo by default on all non-windows platforms, but requires an entry in your
126
+ # sudoers file to avoid having to type a password. It can be omitted if you don't want to use sudo.
127
+ # See http://geminstaller.rubyforge.org/documentation/documentation.html#dealing_with_sudo
128
+ args += " --sudo" unless RUBY_PLATFORM =~ /mswin/
129
+
130
+ # The 'install' method will auto-install gems as specified by the args and config
131
+ GemInstaller.install(args)
132
+
133
+ # The 'autogem' method will automatically add all gems in the GemInstaller config to your load path, using the 'gem'
134
+ # or 'require_gem' command. Note that only the *first* version of any given gem will be loaded.
135
+ GemInstaller.autogem(args)
136
+ ############# End GemInstaller config
137
+
138
+ unless defined?(Rails::Initializer)
139
+ ...
140
+ </code></pre>
141
+
142
+ This example also has configurable variables which illustrate the common option arguments you can control. The <code>--exceptions</code> argument will cause GemInstaller to raise an exception if errors occur, and thus abort Rails startup. The <code>--sudo</code> argument causes GemInstaller to be run via sudo.
143
+
144
+ Now, all you need to do is start Rails. You can use Webrick with <code>ruby script/server</code>, or Mongrel with <code>mongrel_rails start</code>. You should see the message from Geminstaller that the gems are being installed:
145
+
146
+ <pre>
147
+ $ ruby script/server
148
+ GemInstaller is verifying gem installation: mongrel = 1.0.1, rails = 1.1.6, ruby-doom = 0.8
149
+ GemInstaller is automatically requiring gems: mongrel = 1.0.1, rails = 1.1.6, ruby-doom = 0.8
150
+ ./script/../config/boot.rb:55:Warning: require_gem is obsolete. Use gem instead.
151
+ => Booting WEBrick...
152
+ GemInstaller is verifying gem installation: mongrel = 1.0.1, rails = 1.1.6, ruby-doom = 0.8
153
+ GemInstaller is automatically requiring gems: mongrel = 1.0.1, rails = 1.1.6, ruby-doom = 0.8
154
+ => Rails application started on http://0.0.0.0:3000
155
+ => Ctrl-C to shutdown server; call with --help for options
156
+ [2007-05-13 22:41:37] INFO WEBrick 1.3.1
157
+ [2007-05-13 22:41:37] INFO ruby 1.8.5 (2006-08-25) [i686-darwin8.7.1]
158
+ [2007-05-13 22:41:37] INFO WEBrick::HTTPServer#start: pid=2519 port=3000
159
+ </code></pre>
160
+
161
+ If that worked, good! If not, carefully read the error message. If it was a RubyGems failure (as opposed to a bug in GemInstaller), the "<code>gem</code>" command that GemInstaller tried to execute should be echoed as part of the error message. Cut and paste this command onto the command line, and see if you get the same error. If you do, then resolve it and the problem should go away under GemInstaller as well.
162
+
163
+ For extra credit, we can write a simple Rails controller to verify that the correct gems are getting added to the load path by the <code>autogem</code> command. First, create the Rails app and a controller:
164
+
165
+ <pre><code>
166
+ $ rails geminstaller_example
167
+ $ ruby script/generate controller GemInstallerExample
168
+ </code></pre>
169
+
170
+ Next, create the Rails app. You need...
171
+
172
+ ...an action:
173
+ *RAILS_ROOT/app/controllers/gem_installer_example_controller.rb*
174
+ <pre><code>
175
+ class GemInstallerExampleController < ApplicationController
176
+ def index
177
+ end
178
+ end
179
+ </code></pre>
180
+
181
+ ...a sample rhtml page which will show your config and load path:
182
+ *RAILS_ROOT/app/views/gem_installer/index.rhtml*
183
+ <pre>
184
+ <% config = File.open("#{RAILS_ROOT}/config/geminstaller.yml")
185
+ config_lines = config.read.gsub!("\n","<br/>") %>
186
+ <hr/>
187
+ <h2>geminstaller.yml</h2>
188
+ <h2><%= config_lines %></h2>
189
+ <hr/>
190
+ <h2>Load Path: </h2>
191
+ <h2><%= $:.join("\n") %></h2>
192
+ <hr/>
193
+ </code></pre>
194
+
195
+ ...a default route to your page:
196
+ *RAILS_ROOT/config/routes.rb*
197
+ <pre>
198
+ ...
199
+ # Put the following line as the first route in the routes.rb file:
200
+ map.connect '', :controller => "gem_installer_example"
201
+ ...
202
+ </code></pre>
203
+
204
+ ...a GemInstaller config file:
205
+ *RAILS_ROOT/config/geminstaller.yml*:
206
+ <pre><code>---
207
+ defaults:
208
+ install_options: --include-dependencies
209
+ gems:
210
+ - name: ruby-doom
211
+ version: '= 0.8'
212
+ </code></pre>
213
+
214
+ ...the modifications to boot.rb (comments and local variables omitted here for brevity):
215
+ </code></pre>
216
+ ...
217
+ unless defined?(RAILS_ROOT)
218
+ ...
219
+ end
220
+
221
+ ############# Begin GemInstaller config - see http://geminstaller.rubyforge.org
222
+ require "rubygems"
223
+ require "geminstaller"
224
+ config_paths = "#{File.expand_path(RAILS_ROOT)}/config/geminstaller.yml"
225
+ args = "--config #{config_paths}"
226
+ args += " --exceptions"
227
+ args += " --sudo" unless RUBY_PLATFORM =~ /mswin/
228
+ GemInstaller.install(args)
229
+ GemInstaller.autogem(args)
230
+ ############# End GemInstaller config
231
+
232
+ unless defined?(Rails::Initializer)
233
+ ...
234
+ </code></pre>
235
+
236
+ ...and delete the public/index.html file:
237
+ <pre>
238
+ $ rm public/index.html
239
+ </code></pre>
240
+
241
+ Now, you should be able to start the example Rails app and navigate to <code>http://localhost:3000</code> to view your config file and load path with the gems auto-required:
242
+
243
+ <pre>
244
+ $ ... cd to root of your rails app ...
245
+ $ mongrel_rails start
246
+ </code></pre>
247
+
248
+ ...open http://localhost:3000, and you should see something like this:
249
+ <pre>
250
+ _____________________________
251
+ geminstaller.yml
252
+ /---
253
+ defaults:
254
+ install_options: --include-dependencies
255
+ gems:
256
+ - name: ruby-doom
257
+ version: '= 0.8'
258
+ _____________________________
259
+ Load Path:
260
+ ...
261
+ (lots of load path stuff omitted)
262
+ ...
263
+ (here's our gem!)
264
+ /usr/local/lib/ruby/gems/1.8/gems/ruby-doom-0.8/lib /usr/local/lib/ruby/gems/1.8/gems/sources-0.0.1/bin</pre>
265
+ ...
266
+ (more stuff omitted)
267
+ ...
268
+ </code></pre>
269
+
270
+ That's about it!
271
+
272
+ See also: Docs on "Using GemInstaller with Ruby on Rails or Other Ruby Apps":documentation.html#using_geminstaller_with_ruby_on_rails_or_other_ruby_apps.
273
+
274
+
275
+ h2(#using_common_or_shared_config_files). Using Common or Shared Config Files or Snippets
276
+
277
+ GemInstaller supports multiple config files, with the last config files in the list overriding the previous ones. It also supports the "<code>include_config</code>":documentation.html#include_config property in the <code>geminstaller.yml</code> file, which allows you to share a YAML snippet across multiple config files. This means you could do any of the following:
278
+
279
+ * With multiple config files:
280
+ ** Have a common config file across all your projects, which is shared via an svn:external, and a custom config file to override or add gems which are not in the common config.
281
+ ** Have a common config file across all development machines, shared on a windows share or NFS mounted drive, with machine- or platform-specific gems listed in local config files.
282
+ ** Have config files that are specific to certain environments such as development and test, which will not be included when GemInstaller is run in a demo or production environment.
283
+ * With the "<code>include_config</code>":documentation.html#include_config property:
284
+ ** Shared YAML snippets across multiple geminstaller.yml files via an svn:external.
285
+ ** Extract geminstaller.yml entries that are duplicated across multiple files to a single shared include snippet file.
286
+ ** Use a common include to simultaneously upgrade to the same version of a gem dependency across multiple projects.
287
+ ** Extract complicated or shared ERB logic in geminstaller.yml (such as automatically determining the correct version of a gem based on an environment variable) into a separate file.
288
+
289
+ TODO: Finish writing examples of this, for now see docs on the "<code>--config</code>":documentation.html#config_option option.
290
+
291
+ See also: Docs on the "<code>--config</code>":documentation.html#config_option option, Docs on the "<code>include_config</code>":documentation.html#include_config property.
292
+
293
+
294
+ h2(#running_geminstaller_from_capistrano). Running GemInstaller from Capistrano
295
+
296
+ GemInstaller can be hooked in as a capistrano task. This is a way to avoid having gems installed via the preinitializer.rb run in demo or production, and possibly cause problems with app startup in these environments (note you still want to Activate them in preinitializer.rb via GemInstaller.autorun). It also is a way to avoid the current bug with Rails and Mongrel gems not being loaded correctly if they are upgraded during the app startup process. Here's an example recipe:
297
+
298
+ <pre><code>
299
+ namespace :deploy do
300
+ desc "gem installer"
301
+ task :geminstaller, :roles => :app do
302
+ sudo "geminstaller -c #{current_release}/config/geminstaller.yml"
303
+ end
304
+ end
305
+ </code></pre>
306
+
307
+ See also: Docs on "Using GemInstaller from Other Ruby Apps":documentation.html#using_geminstaller_from_other_ruby_apps.
308
+
309
+ h2(#running_geminstaller_from_vlad_the_deployer). Running GemInstaller from Vlad the Deployer
310
+
311
+ You can also run GemInstaller from "Vlad the Deployer":http://rubyhitsquad.com/Vlad_the_Deployer.html. Check out "this gist":http://gist.github.com/72143 and "blog post":http://geminstallthat.wordpress.com/2009/02/28/using-geminstaller-with-vlad-the-deployer from "John Dewey":http://geminstallthat.wordpress.com . Here's the contents of that gist:
312
+
313
+ <pre><code>
314
+ ### lib/tasks/app.rake
315
+
316
+ begin
317
+ require 'vlad'
318
+ Vlad.load :scm => :git, :web => :apache
319
+ rescue LoadError
320
+ puts $!
321
+ end
322
+
323
+ ### Extending 'vlad:update' with 'gems:geminstaller'
324
+ namespace :vlad do
325
+ desc "Install gems via geminstaller."
326
+ remote_task :update, :roles => :app do
327
+ Rake::Task['gems:geminstaller'].invoke
328
+ end
329
+ end
330
+
331
+ namespace :gems do
332
+ desc "Run geminstaller."
333
+ remote_task :geminstaller, :roles => :app do
334
+ run "geminstaller --sudo -c #{current_path}/config/geminstaller.yml"
335
+ end
336
+ end
337
+ </code></pre>
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: Download
3
+ ---
4
+ h1. Installation / Download
5
+
6
+ GemInstaller is a standard RubyGem, and can be installed as usual (prefix with <code>sudo</code> if necessary):
7
+
8
+ <pre><code>
9
+ gem install geminstaller
10
+ </code></pre>
11
+
12
+ Alternately, you can download and install the gem file from the GemInstaller RubyForge download page: "http://rubyforge.org/frs/?group_id=1902":http://rubyforge.org/frs/?group_id=1902
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: FAQ
3
+ ---
4
+ h1. Frequently Asked Questions
5
+
6
+ <span id="source_index_cannot_be_created_from_disk"/>
7
+ Q: I got an error "source index cannot be created from disk"<br/>
8
+ A: This is an incompatibility introduced in recent versions of RubyGems. Upgrade to the latest version of GemInstaller.
9
+
10
+ <span id="geminstaller_is_slow"/>
11
+ Q: GemInstaller is taking FOREVER to run!<br/>
12
+ A: First, run with the '-gall -rall' options to see all verbose output. It is probably the underlying RubyGems command that is slow. If you are on a version of RubyGems which is earlier than 1.2.0, there are know cache performance problems, and you should upgrade. "This little script may help":http://gist.github.com/13223
13
+
14
+ <span id="rails_config_gems"/>
15
+ Q: Why not just use Rails' config.gems and rake tasks instead of GemInstaller?<br/>
16
+ A: A few reasons: 1) There are known issues with config.gems, since it attempts to load dependencies while the Rails environment is initializing, resulting in the possibility of "circular dependencies":http://groups.google.com/group/rubyonrails-core/browse_thread/thread/cffe26aaf784acf9/2480c6d27da36bd2. GemInstaller does not have these issues when run from config/preinitializer.rb. 2) Rails itself cannot manage the Rails gems - but GemInstaller can via preinitializer.rb. 3) GemInstaller has more features that config.gems. 4) GemInstaller runs for any app or environment that needs to manage RubyGems, not just Rails. See more discussion on "this rails core list thread":http://groups.google.com/group/rubyonrails-core/browse_thread/thread/cffe26aaf784acf9/2480c6d27da36bd2 or "this rails ticket":http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/59
17
+
18
+ <span id="environment_vars_and_sudo"/>
19
+ Q: Why can't I use environment variables via ERB in geminstaller.yml when using sudo?<br/>
20
+ A: For security, the sudo command does NOT pass most environment variables. That means if you are trying to use an environment variable to control logic in your geminstaller.yml (for example to dynamically specify a gem version), then it won't work! The workaround would be to not use sudo (http://thewoolleyweb.lighthouseapp.com/projects/11580/tickets/1-automatically-create-use-and-manage-writeable-gem-home-if-system-gem-home-is-not-writeable)
21
+
22
+ Q: Why do some gems (like BlueCloth) always get reinstalled, even though they are already installed?<br/>
23
+ A: Dunno, this is either a bug in the gem or in RubyGems. It isn't a problem with GemInstaller AFAIK, it happens even if you install manually via 'gem install'. Haven't had time to debug, let me know if you figure it out.
24
+
25
+ Q: What about gems like RMagick that have platform-specific binary dependencies?<br/>
26
+ A: You are on your own, this is outside of the scope of GemInstaller. The geminstaller.yml file is parsed with ERB, so you can put whatever hooks you want to perform necessary system setup and/or prereq validation. You can also google or check the RMagick home page: "http://rmagick.rubyforge.org/":http://rmagick.rubyforge.org/. For Debian systems, check out the "AptInstaller":http://github.com/ngauthier/aptinstaller tool.
27
+
28
+ Q: Why don't the tests/specs run on Windows?<br/>
29
+ A: This has been improved with GemInstaller 0.3.0. Using RubyGems 1.0.1 on Windows, install_smoketest.rb, autogem_smoketest.rb, and ruby test_suites/test_all.rb all work. See references to 'windows' on the "Code Page":code/index.html for more details.
30
+
31
+ Q: Why else should I support GemInstaller?<br/>
32
+ A: GemInstaller has an extensive, multifaceted and multiplatform suite of specs and tests which is actively maintained against the latest trunk version of RubyGems and run via Continuous Integration. It is valuable for alerting about regressions in RubyGems itself. For example, leading up to the the RubyGems 1.2.0 release, the GemInstaller spec suite identified several regression bugs in RubyGems which were promptly reported and proactively fixed by awesome Eric Hodel and others before the release.
33
+
34
+
35
+ <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>This space intentionally left blank.<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
36
+
@@ -0,0 +1,103 @@
1
+ ---
2
+ title: Overview
3
+ ---
4
+ h1. Overview
5
+
6
+ h2. What is GemInstaller?
7
+
8
+ GemInstaller provides automated installation, loading and activation of RubyGems. It uses a simple YAML config file to:
9
+
10
+ * Automatically install the correct versions of all required gems wherever your app runs.
11
+ * Automatically ensure installed gems and versions are consistent across multiple applications, machines, platforms, and environments
12
+ * Automatically activate correct versions of gems on the ruby load path when your app runs ('require_gem'/'gem')
13
+ * Automatically reinstall missing dependency gems (built in to RubyGems > 1.0)
14
+ * Automatically detect correct platform to install for multi-platform gems (built in to RubyGems > 1.0)
15
+ * Print YAML for "rogue gems" which are not specified in the current config, to easily bootstrap your config file, or find gems that were manually installed without GemInstaller.
16
+ * Allow for common configs to be reused across projects or environments by supporting multiple config files, including common config file snippets, and defaults with overrides.
17
+ * Allow for dynamic selection of gems, versions, and platforms to be used based on environment vars or any other logic.
18
+ * Avoid the "works on demo, breaks on production" syndrome.
19
+ * Find lost socks.
20
+
21
+ GemInstaller can be used from the command line, or embedded to run automatically on startup for a Rails app or any other Ruby program.
22
+
23
+ It has been tested on all major platforms (mac, linux, windows), and has an "extensive suite of tests":code/coverage/index.html which are "automatically run by Continuous Integration":http://ci.thewoolleyweb.com against recent versions of RubyGems (selected older releases and trunk)..
24
+
25
+ h2. How do I get it?
26
+
27
+ GemInstaller can be installed with 'gem install geminstaller' or "downloaded":http://rubyforge.org/frs/?group_id=1902 from RubyForge.
28
+
29
+ h2. How do I use it?
30
+
31
+ See the "Quick Start Guide":documentation/index.html, "Tutorials":documentation/tutorials.html, or the "Detailed Documentation":documentation/documentation.html.
32
+
33
+ h2. Who is responsible for GemInstaller?
34
+
35
+ GemInstaller was created by "Chad Woolley":http://www.thewoolleyweb.com.
36
+
37
+ h2. Why not just use Rails' config.gems?
38
+
39
+ GemInstaller "has advantages":faq.html#rails_config_gems over Rails' config.gems.
40
+
41
+ h2(#known_issues). Known Issues
42
+
43
+ I have a "list of high priority bugs and features":http://thewoolleyweb.lighthouseapp.com/projects/11580-geminstaller/tickets?q=tagged%3Ahigh_priority that need to be addressed before a 1.0 release.
44
+
45
+ Please "report any others that you find":http://thewoolleyweb.lighthouseapp.com/projects/11580-geminstaller/overview !
46
+
47
+ h2(#history). History
48
+
49
+ * 0.5.3
50
+ ** Many long overdue bugfixes and patches, see http://tinyurl.com/geminstaller-0-5-3-release for details.
51
+ ** Thanks to Greg Fitzgerald, Britt Crawford, John Trupiano, Gabriel Gironda, and Eric Hodel for patches and assistance.
52
+ ** Issues with case statement under Ruby 1.9
53
+ ** GemInstaller cannot distinguish between gems that have the ame name but capitalized differently.
54
+ ** add ./ci as default location for config file
55
+ ** Disable GemInstaller install in default rails preinitializer.rb, but fork if it is used
56
+ ** autogem() fails when run for newly-installed gem
57
+ ** Sometimes installing fails due to RubyGems cache not being cleared between multiple API calls
58
+ * 0.5.2
59
+ ** Support for Rubygems 1.3.5.
60
+ * 0.5.1
61
+ ** Print a very verbose and helpful error message if gem cannot be found on remote server. Attempts to help "http://thewoolleyweb.lighthouseapp.com/projects/11580/tickets/5-sometimes-installing-fails":http://thewoolleyweb.lighthouseapp.com/projects/11580/tickets/5-sometimes-installing-fails
62
+ ** Fix bug with stderr being swallowed silently when '--sudo' option is used.
63
+ * 0.5.0
64
+ ** change default processing order of gems from alpha-version-platform to be order found in file (last config file wins)
65
+ * 0.4.5
66
+ ** Re-release without Hoe as a dependency, since it snuck itself in as a dependency in 0.4.4
67
+ * 0.4.4
68
+ ** Compatibility with RubyGems 1.3.0
69
+ * 0.4.3
70
+ ** Repackage gem with released version of RubyGems 1.2.0.
71
+ * 0.4.2
72
+ ** Compatibility with RubyGems 1.2.0.
73
+ * 0.4.1
74
+ ** Fix bug with warnings for outdated/incompatible rubygems versions.
75
+ * 0.4.0
76
+ ** Fix multiplatform bug on windows where ruby platform requiring compile was selected over native mswin platform.
77
+ ** deprecate support of rubygems 0.9.5, 1.0.0, and 1.1.0.
78
+ ** Change handling of platforms on rubygems on Rubygems > 0.9.5, let RubyGems handle default.
79
+ ** Rename GemInstaller.run method to GemInstaller.install, keep 'run' as an alias for 'install'
80
+ ** Include instructions ‍to‍ run‍ geminstaller‍ to‍ install‍ the‍ missing‍ version when‍ gem‍ version‍ error‍ is‍ detected.
81
+ ** Rubygems‍ 1.x ‍compatibility.
82
+ ** Better internal support for uninstall options.
83
+ ** Use‍ new,‍ correct‍ x86-mswin32‍ format‍ for‍ mswin32‍ platform‍ gems.
84
+ ** Update‍ warning‍ message‍ for‍ older‍ rubygems‍ versions.
85
+ ** Made tests run on Mac OS X Leopard w/RubyGems 1.0.1.
86
+ * 0.3.0
87
+ ** Changes to work with RubyGems >= 0.9.5 and take advantage of new platform and auto-install features. See "notes on RubyGems version compatibility":code/index.html#rubygems_compatibility
88
+ ** On Linux/Mac, you can now specify a RUBYGEMS_VERSION environment var to test against a specific version of RubyGems.
89
+ ** Improved smoketest.rb and autogem_test.rb
90
+ ** Tests now run on windows (only against latest rubygems, with it installed, and only via test_suites/test_all.rb, not rake)
91
+ ** deprecated/disabled prefer_binary_platform
92
+ ** many other small cleanups
93
+ * 0.2.5
94
+ ** Add 'include_config' directive to yaml config file, allowing other files to be included via ERB.
95
+ ** Fix broken links in docs - patch from Maciej Kozak (macio)
96
+ * 0.2.4
97
+ ** Look for config file at config/geminstaller.yml as well as geminstaller.yml
98
+ ** make startup message ('Installing Gems...') debug level instead of info
99
+ ** Add custom descriptive error if user gets access permission error when installing a gem
100
+ * 0.2.3 - Fix debug statement left in, upgrade rspec, improvements to test suite
101
+ * 0.2.2 - Fix performance problems with autogem command (don't manually recurse dependencies, gem method does it already)
102
+ * 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.
103
+ * 0.2.0 - Initial release. Yay!
@@ -0,0 +1,54 @@
1
+ index.page:
2
+ in_menu: true
3
+ sort_info: 10
4
+
5
+ documentation:
6
+ title: Documentation
7
+ sort_info: 20
8
+
9
+ download.page:
10
+ in_menu: true
11
+ sort_info: 30
12
+
13
+ faq.page:
14
+ in_menu: true
15
+ sort_info: 40
16
+
17
+ community:
18
+ title: Community
19
+ sort_info: 50
20
+
21
+ code:
22
+ title: Code
23
+ sort_info: 60
24
+
25
+ documentation/index.page:
26
+ in_menu: true
27
+ sort_info: 10
28
+
29
+ documentation/tutorials.page:
30
+ title: Tutorials
31
+ in_menu: true
32
+ sort_info: 20
33
+
34
+ documentation/documentation.page:
35
+ title: Documentation
36
+ in_menu: true
37
+ sort_info: 30
38
+
39
+ community/index.page:
40
+ in_menu: true
41
+ sort_info: 10
42
+
43
+ community/links.page:
44
+ title: Links
45
+ in_menu: true
46
+ sort_info: 30
47
+
48
+ code/index.page:
49
+ title: Design
50
+ in_menu: true
51
+ sort_info: 10
52
+
53
+
54
+
@@ -0,0 +1,112 @@
1
+ /* START webgen download tag */
2
+ .webgen-file-icon, .webgen-download-icon { vertical-align: middle; }
3
+ /* STOP webgen download tag */
4
+ .CodeRay {
5
+ background-color: #f8f8f8;
6
+ border: 1px solid silver;
7
+ font-family: 'Courier New', 'Terminal', monospace;
8
+ color: #100;
9
+ }
10
+ .CodeRay pre { margin: 0px }
11
+
12
+ div.CodeRay { }
13
+
14
+ span.CodeRay { white-space: pre; border: 0px; padding: 2px }
15
+
16
+ table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px }
17
+ table.CodeRay td { padding: 2px 4px; vertical-align: top }
18
+
19
+ .CodeRay .line_numbers, .CodeRay .no {
20
+ background-color: #def;
21
+ color: gray;
22
+ text-align: right;
23
+ }
24
+ .CodeRay .line_numbers tt { font-weight: bold }
25
+ .CodeRay .no { padding: 0px 4px }
26
+ .CodeRay .code { width: 100% }
27
+
28
+ ol.CodeRay { font-size: 10pt }
29
+ ol.CodeRay li { white-space: pre }
30
+
31
+ .CodeRay .code pre { overflow: auto }
32
+
33
+ .CodeRay .af { color:#00C }
34
+ .CodeRay .an { color:#007 }
35
+ .CodeRay .av { color:#700 }
36
+ .CodeRay .aw { color:#C00 }
37
+ .CodeRay .bi { color:#509; font-weight:bold }
38
+ .CodeRay .c { color:#888 }
39
+
40
+ .CodeRay .ch { color:#04D }
41
+ .CodeRay .ch .k { color:#04D }
42
+ .CodeRay .ch .dl { color:#039 }
43
+
44
+ .CodeRay .cl { color:#B06; font-weight:bold }
45
+ .CodeRay .co { color:#036; font-weight:bold }
46
+ .CodeRay .cr { color:#0A0 }
47
+ .CodeRay .cv { color:#369 }
48
+ .CodeRay .df { color:#099; font-weight:bold }
49
+ .CodeRay .di { color:#088; font-weight:bold }
50
+ .CodeRay .dl { color:black }
51
+ .CodeRay .do { color:#970 }
52
+ .CodeRay .ds { color:#D42; font-weight:bold }
53
+ .CodeRay .e { color:#666; font-weight:bold }
54
+ .CodeRay .en { color:#800; font-weight:bold }
55
+ .CodeRay .er { color:#F00; background-color:#FAA }
56
+ .CodeRay .ex { color:#F00; font-weight:bold }
57
+ .CodeRay .fl { color:#60E; font-weight:bold }
58
+ .CodeRay .fu { color:#06B; font-weight:bold }
59
+ .CodeRay .gv { color:#d70; font-weight:bold }
60
+ .CodeRay .hx { color:#058; font-weight:bold }
61
+ .CodeRay .i { color:#00D; font-weight:bold }
62
+ .CodeRay .ic { color:#B44; font-weight:bold }
63
+
64
+ .CodeRay .il { background: #eee }
65
+ .CodeRay .il .il { background: #ddd }
66
+ .CodeRay .il .il .il { background: #ccc }
67
+ .CodeRay .il .idl { font-weight: bold; color: #888 }
68
+
69
+ .CodeRay .in { color:#B2B; font-weight:bold }
70
+ .CodeRay .iv { color:#33B }
71
+ .CodeRay .la { color:#970; font-weight:bold }
72
+ .CodeRay .lv { color:#963 }
73
+ .CodeRay .oc { color:#40E; font-weight:bold }
74
+ .CodeRay .on { color:#000; font-weight:bold }
75
+ .CodeRay .op { }
76
+ .CodeRay .pc { color:#038; font-weight:bold }
77
+ .CodeRay .pd { color:#369; font-weight:bold }
78
+ .CodeRay .pp { color:#579 }
79
+ .CodeRay .pt { color:#339; font-weight:bold }
80
+ .CodeRay .r { color:#080; font-weight:bold }
81
+
82
+ .CodeRay .rx { background-color:#fff0ff }
83
+ .CodeRay .rx .k { color:#808 }
84
+ .CodeRay .rx .dl { color:#404 }
85
+ .CodeRay .rx .mod { color:#C2C }
86
+ .CodeRay .rx .fu { color:#404; font-weight: bold }
87
+
88
+ .CodeRay .s { background-color:#fff0f0 }
89
+ .CodeRay .s .s { background-color:#ffe0e0 }
90
+ .CodeRay .s .s .s { background-color:#ffd0d0 }
91
+ .CodeRay .s .k { color:#D20 }
92
+ .CodeRay .s .dl { color:#710 }
93
+
94
+ .CodeRay .sh { background-color:#f0fff0 }
95
+ .CodeRay .sh .k { color:#2B2 }
96
+ .CodeRay .sh .dl { color:#161 }
97
+
98
+ .CodeRay .sy { color:#A60 }
99
+ .CodeRay .sy .k { color:#A60 }
100
+ .CodeRay .sy .dl { color:#630 }
101
+
102
+ .CodeRay .ta { color:#070 }
103
+ .CodeRay .tf { color:#070; font-weight:bold }
104
+ .CodeRay .ts { color:#D70; font-weight:bold }
105
+ .CodeRay .ty { color:#339; font-weight:bold }
106
+ .CodeRay .v { color:#036 }
107
+ .CodeRay .xt { color:#444 }
108
+
109
+ /* START webgen horizontal menu style */
110
+ .webgen-menu-horiz ul { display: block; }
111
+ .webgen-menu-horiz li { display: inline; }
112
+ /* STOP webgen horizontal menu style */