geminstaller 0.4.5 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,11 +13,10 @@ If anything is unclear, or if you'd like to see a tutorial on a topic, please su
13
13
 
14
14
  h2(#installing_geminstaller). Installing GemInstaller
15
15
 
16
- <pre>
17
- $ gem install geminstaller
16
+ <pre><code>$ gem install geminstaller
18
17
  - OR, if you get a permission error -
19
18
  $ sudo gem install geminstaller
20
- </pre>
19
+ </code></pre>
21
20
 
22
21
  See also: Docs on "installation":documentation.html#installation.
23
22
 
@@ -25,9 +24,9 @@ h2(#bootstrapping_your_geminstaller_config). Bootstrapping your GemInstaller Con
25
24
 
26
25
  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
26
 
28
- <pre>
27
+ <pre><code>
29
28
  $ geminstaller --print-rogue-gems > geminstaller.yml
30
- </pre>
29
+ </code></pre>
31
30
 
32
31
  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
32
 
@@ -43,15 +42,14 @@ h2(#using_the_autogem_option_to_automatically_require_gems). Using the <code>aut
43
42
  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
43
 
45
44
  First, create a simple *<code>geminstaller.yml</code>* file:
46
- <pre>
47
- \---
45
+ <pre><code>---
48
46
  gems:
49
47
  - name: ruby-doom
50
48
  version: '= 0.8'
51
- </pre>
49
+ </code></pre>
52
50
 
53
51
  Now, we'll use <code>irb</code> to test autogem, and verify that it can add the ruby-doom gem to the load path:
54
- <pre>
52
+ <pre><code>
55
53
  $ irb
56
54
  irb(main):001:0> require 'rubygems'
57
55
  => true
@@ -61,7 +59,7 @@ irb(main):003:0> GemInstaller.autogem('--config=geminstaller.yml')
61
59
  => autogem returns the gem object(s) as it's return value...
62
60
  irb(main):004:0> $: # Now verify the gem was added to the load path
63
61
  => ["/usr/local/lib/ruby/gems/1.8/gems/ruby-doom-0.8/lib", ...]
64
- </pre>
62
+ </code></pre>
65
63
 
66
64
  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.
67
65
 
@@ -87,60 +85,58 @@ First, you need a Rails app. I'll let you handle this step on your own. See th
87
85
  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:
88
86
 
89
87
  *RAILS_ROOT/config/geminstaller.yml*:
90
- <pre>
91
- \---
92
- defaults:
93
- install_options: --include-dependencies
94
- gems:
95
- - name: ruby-doom
96
- version: '= 0.8'
97
- - name: rails
98
- version: '= 1.1.6'
99
- - name: mongrel
100
- version: '= 1.0.1'
101
- platform: <%= RUBY_PLATFORM =~ /mswin/ ? 'mswin32' : 'ruby'%>
102
- </pre>
88
+ <pre><code> ---
89
+ defaults:
90
+ install_options: --include-dependencies
91
+ gems:
92
+ - name: ruby-doom
93
+ version: '= 0.8'
94
+ - name: rails
95
+ version: '= 1.1.6'
96
+ - name: mongrel
97
+ version: '= 1.0.1'
98
+ platform: <%= RUBY_PLATFORM =~ /mswin/ ? 'mswin32' : 'ruby'%>
99
+ </code></pre>
103
100
 
104
101
  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):
105
102
 
106
103
 
107
104
  *RAILS_ROOT/config/boot.rb*:
108
- <pre>
109
- ...
110
- unless defined?(RAILS_ROOT)
111
- ...
112
- end
113
-
114
- ############# Begin GemInstaller config - see http://geminstaller.rubyforge.org
115
- require "rubygems"
116
- require "geminstaller"
117
-
118
- # Path(s) to your GemInstaller config file(s)
119
- config_paths = "#{File.expand_path(RAILS_ROOT)}/config/geminstaller.yml"
120
-
121
- # Arguments which will be passed to GemInstaller (you can add any extra ones)
122
- args = "--config #{config_paths}"
123
-
124
- # The 'exceptions' flag determines whether errors encountered while running GemInstaller
125
- # should raise exceptions (and abort Rails), or just return a nonzero return code
126
- args += " --exceptions"
127
-
128
- # This will use sudo by default on all non-windows platforms, but requires an entry in your
129
- # sudoers file to avoid having to type a password. It can be omitted if you don't want to use sudo.
130
- # See http://geminstaller.rubyforge.org/documentation/documentation.html#dealing_with_sudo
131
- args += " --sudo" unless RUBY_PLATFORM =~ /mswin/
132
-
133
- # The 'install' method will auto-install gems as specified by the args and config
134
- GemInstaller.install(args)
135
-
136
- # The 'autogem' method will automatically add all gems in the GemInstaller config to your load path, using the 'gem'
137
- # or 'require_gem' command. Note that only the *first* version of any given gem will be loaded.
138
- GemInstaller.autogem(args)
139
- ############# End GemInstaller config
140
-
141
- unless defined?(Rails::Initializer)
142
- ...
143
- </pre>
105
+ <pre><code> ...
106
+ unless defined?(RAILS_ROOT)
107
+ ...
108
+ end
109
+
110
+ ############# Begin GemInstaller config - see http://geminstaller.rubyforge.org
111
+ require "rubygems"
112
+ require "geminstaller"
113
+
114
+ # Path(s) to your GemInstaller config file(s)
115
+ config_paths = "#{File.expand_path(RAILS_ROOT)}/config/geminstaller.yml"
116
+
117
+ # Arguments which will be passed to GemInstaller (you can add any extra ones)
118
+ args = "--config #{config_paths}"
119
+
120
+ # The 'exceptions' flag determines whether errors encountered while running GemInstaller
121
+ # should raise exceptions (and abort Rails), or just return a nonzero return code
122
+ args += " --exceptions"
123
+
124
+ # This will use sudo by default on all non-windows platforms, but requires an entry in your
125
+ # sudoers file to avoid having to type a password. It can be omitted if you don't want to use sudo.
126
+ # See http://geminstaller.rubyforge.org/documentation/documentation.html#dealing_with_sudo
127
+ args += " --sudo" unless RUBY_PLATFORM =~ /mswin/
128
+
129
+ # The 'install' method will auto-install gems as specified by the args and config
130
+ GemInstaller.install(args)
131
+
132
+ # The 'autogem' method will automatically add all gems in the GemInstaller config to your load path, using the 'gem'
133
+ # or 'require_gem' command. Note that only the *first* version of any given gem will be loaded.
134
+ GemInstaller.autogem(args)
135
+ ############# End GemInstaller config
136
+
137
+ unless defined?(Rails::Initializer)
138
+ ...
139
+ </code></pre>
144
140
 
145
141
  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.
146
142
 
@@ -159,27 +155,27 @@ GemInstaller is automatically requiring gems: mongrel = 1.0.1, rails = 1.1.6, ru
159
155
  [2007-05-13 22:41:37] INFO WEBrick 1.3.1
160
156
  [2007-05-13 22:41:37] INFO ruby 1.8.5 (2006-08-25) [i686-darwin8.7.1]
161
157
  [2007-05-13 22:41:37] INFO WEBrick::HTTPServer#start: pid=2519 port=3000
162
- </pre>
158
+ </code></pre>
163
159
 
164
160
  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.
165
161
 
166
162
  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:
167
163
 
168
- <pre>
164
+ <pre><code>
169
165
  $ rails geminstaller_example
170
166
  $ ruby script/generate controller GemInstallerExample
171
- </pre>
167
+ </code></pre>
172
168
 
173
169
  Next, create the Rails app. You need...
174
170
 
175
171
  ...an action:
176
172
  *RAILS_ROOT/app/controllers/gem_installer_example_controller.rb*
177
- <pre>
173
+ <pre><code>
178
174
  class GemInstallerExampleController < ApplicationController
179
175
  def index
180
176
  end
181
177
  end
182
- </pre>
178
+ </code></pre>
183
179
 
184
180
  ...a sample rhtml page which will show your config and load path:
185
181
  *RAILS_ROOT/app/views/gem_installer/index.rhtml*
@@ -193,7 +189,7 @@ end
193
189
  <h2>Load Path: </h2>
194
190
  <h2><%= $:.join("\n") %></h2>
195
191
  <hr/>
196
- </pre>
192
+ </code></pre>
197
193
 
198
194
  ...a default route to your page:
199
195
  *RAILS_ROOT/config/routes.rb*
@@ -202,21 +198,20 @@ end
202
198
  # Put the following line as the first route in the routes.rb file:
203
199
  map.connect '', :controller => "gem_installer_example"
204
200
  ...
205
- </pre>
201
+ </code></pre>
206
202
 
207
203
  ...a GemInstaller config file:
208
204
  *RAILS_ROOT/config/geminstaller.yml*:
209
- <pre>
210
- \---
205
+ <pre><code>---
211
206
  defaults:
212
207
  install_options: --include-dependencies
213
208
  gems:
214
209
  - name: ruby-doom
215
210
  version: '= 0.8'
216
- </pre>
211
+ </code></pre>
217
212
 
218
213
  ...the modifications to boot.rb (comments and local variables omitted here for brevity):
219
- <pre>
214
+ </code></pre>
220
215
  ...
221
216
  unless defined?(RAILS_ROOT)
222
217
  ...
@@ -235,19 +230,19 @@ GemInstaller.autogem(args)
235
230
 
236
231
  unless defined?(Rails::Initializer)
237
232
  ...
238
- </pre>
233
+ </code></pre>
239
234
 
240
235
  ...and delete the public/index.html file:
241
236
  <pre>
242
237
  $ rm public/index.html
243
- </pre>
238
+ </code></pre>
244
239
 
245
240
  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:
246
241
 
247
242
  <pre>
248
243
  $ ... cd to root of your rails app ...
249
244
  $ mongrel_rails start
250
- </pre>
245
+ </code></pre>
251
246
 
252
247
  ...open http://localhost:3000, and you should see something like this:
253
248
  <pre>
@@ -269,7 +264,7 @@ Load Path:
269
264
  ...
270
265
  (more stuff omitted)
271
266
  ...
272
- </pre>
267
+ </code></pre>
273
268
 
274
269
  That's about it!
275
270
 
@@ -5,8 +5,8 @@ h1. Installation / Download
5
5
 
6
6
  GemInstaller is a standard RubyGem, and can be installed as usual (prefix with <code>sudo</code> if necessary):
7
7
 
8
- <pre>
8
+ <pre><code>
9
9
  gem install geminstaller
10
- </pre>
10
+ </code></pre>
11
11
 
12
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
@@ -46,6 +46,8 @@ Please "report any others that you find":http://thewoolleyweb.lighthouseapp.com/
46
46
 
47
47
  h2(#history). History
48
48
 
49
+ * 0.5.0
50
+ ** change default processing order of gems from alpha-version-platform to be order found in file (last config file wins)
49
51
  * 0.4.5
50
52
  ** Re-release without Hoe as a dependency, since it snuck itself in as a dependency in 0.4.4
51
53
  * 0.4.4
@@ -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 */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminstaller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Woolley
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-28 00:00:00 -07:00
12
+ date: 2009-02-03 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -88,11 +88,14 @@ files:
88
88
  - test/test_all.rb
89
89
  - test/test_all_smoketests.rb
90
90
  - website/config.yaml
91
- - website/metainfo.yaml
92
91
  - website/src/analytics.page
92
+ - website/src/code/ci.virtual
93
+ - website/src/code/coverage/index.virtual
93
94
  - website/src/code/index.page
95
+ - website/src/code/rdoc/index.virtual
94
96
  - website/src/community/index.page
95
97
  - website/src/community/links.page
98
+ - website/src/community/rubyforge.virtual
96
99
  - website/src/default.css
97
100
  - website/src/default.template
98
101
  - website/src/documentation/documentation.page
@@ -101,6 +104,8 @@ files:
101
104
  - website/src/download.page
102
105
  - website/src/faq.page
103
106
  - website/src/index.page
107
+ - website/src/metainfo
108
+ - website/src/webgen.css
104
109
  has_rdoc: true
105
110
  homepage: " by Chad Woolley"
106
111
  post_install_message:
@@ -124,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
129
  requirements: []
125
130
 
126
131
  rubyforge_project: geminstaller
127
- rubygems_version: 1.3.0
132
+ rubygems_version: 1.3.1
128
133
  signing_key:
129
134
  specification_version: 2
130
135
  summary: Automated Gem installation, activation, and much more!
@@ -1,78 +0,0 @@
1
- index.page:
2
- inMenu: true
3
- orderInfo: 10
4
-
5
- documentation:
6
- title: Documentation
7
- orderInfo: 20
8
-
9
- download.page:
10
- inMenu: true
11
- orderInfo: 30
12
-
13
- faq.page:
14
- inMenu: true
15
- orderInfo: 40
16
-
17
- community:
18
- title: Community
19
- orderInfo: 50
20
-
21
- code:
22
- title: Code
23
- orderInfo: 60
24
-
25
- documentation/index.page:
26
- inMenu: true
27
- orderInfo: 10
28
-
29
- documentation/tutorials.page:
30
- title: Tutorials
31
- inMenu: true
32
- orderInfo: 20
33
-
34
- documentation/documentation.page:
35
- title: Documentation
36
- inMenu: true
37
- orderInfo: 30
38
-
39
- community/index.page:
40
- inMenu: true
41
- orderInfo: 10
42
-
43
- community/links.page:
44
- title: Links
45
- inMenu: true
46
- orderInfo: 30
47
-
48
- code/index.page:
49
- title: Design
50
- inMenu: true
51
- orderInfo: 10
52
-
53
- ---
54
- community/rubyforge.html:
55
- url: http://rubyforge.org/projects/geminstaller/
56
- inMenu: true
57
- title: Rubyforge
58
- orderInfo: 40
59
-
60
- code/ci:
61
- url: http://ci.thewoolleyweb.com
62
- inMenu: true
63
- title: CI
64
- orderInfo: 20
65
-
66
- code/rdoc:
67
- url: rdoc/index.html
68
- inMenu: true
69
- title: Rdoc
70
- orderInfo: 30
71
-
72
- code/coverage:
73
- url: coverage/index.html
74
- inMenu: true
75
- title: Coverage
76
- orderInfo: 40
77
-
78
-