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
data/COPYING ADDED
@@ -0,0 +1 @@
1
+ Placeholder...
data/History.txt ADDED
@@ -0,0 +1,82 @@
1
+ == 0.5.3 / 2009-08-25
2
+ * Many long overdue bugfixes and patches, see http://tinyurl.com/geminstaller-0-5-3-release for details.
3
+ * Thanks to Greg Fitzgerald, Britt Crawford, John Trupiano, Gabriel Gironda, and Eric Hodel for patches and assistance.
4
+ * Issues with case statement under Ruby 1.9
5
+ * GemInstaller cannot distinguish between gems that have the ame name but capitalized differently.
6
+ * add ./ci as default location for config file
7
+ * Disable GemInstaller install in default rails preinitializer.rb, but fork if it is used
8
+ * autogem() fails when run for newly-installed gem
9
+ * Sometimes installing fails due to RubyGems cache not being cleared between multiple API calls
10
+
11
+ == 0.5.2 / 2009-07-24
12
+ * Support for Rubygems 1.3.5
13
+
14
+ == 0.5.1 / 2009-02-23
15
+ * 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
16
+ * Fix bug with stderr being swallowed silently when '--sudo' option is used.
17
+
18
+ == 0.5.0 / 2009-02-03
19
+ * change default processing order of gems from alpha-version-platform to be order found in file (last config file wins). Fixes http://thewoolleyweb.lighthouseapp.com/projects/11580/tickets/15-provide-a-way-to-specify-gem-processing-order . Thanks to Brian Jenkins for helping!
20
+
21
+ == 0.4.5 / 2008-09-26
22
+ * Re-release without Hoe as a dependency, since it snuck itself in as a dependency in 0.4.4
23
+
24
+ == 0.4.4 / 2008-09-20
25
+ * Compatibility with RubyGems 1.3.0
26
+
27
+ == 0.4.3 / 2008-06-23
28
+ * Repackage gem with released version of RubyGems 1.2.0, to avoid problems for older versions of RubyGems.
29
+
30
+ == 0.4.2 / 2008-06-19
31
+ * Compatibility with RubyGems 1.2.0
32
+
33
+ == 0.4.1 / 2008-04-12
34
+ * Fix bug with warnings for outdated/incompatible rubygems versions.
35
+
36
+ == 0.4.0 / 2008-04-10
37
+ * Fix multiplatform bug on windows where ruby platform requiring compile was selected over native mswin platform.
38
+ * deprecate support of rubygems 0.9.5, 1.0.0, and 1.1.0.
39
+ * Change handling of platforms on rubygems on Rubygems > 0.9.5, let RubyGems handle default.
40
+ * rename GemInstaller.run method to GemInstaller.install, keep run as an alias for install
41
+ * add‍warning‍if‍a‍gem‍version‍error‍is‍detected,‍with instructions‍to‍run‍geminstaller‍to‍install‍the‍missing‍version
42
+ * Rubygems‍1.x‍compatibility
43
+ * better internal support for uninstall options
44
+ * use‍new,‍correct‍x86-mswin32‍format‍for‍mswin32‍platform‍gems
45
+ * update‍warning‍message‍for‍older‍rubygems‍versions
46
+ * made tests run on Mac OS X Leopard w/RubyGems 1.0.1
47
+
48
+ == 0.3.0 / 2008-01-01
49
+ * Changes to work with RubyGems >= 0.9.5 and take advantage of new platform and auto-install features. See notes at http://geminstaller.rubyforge.org/code/index.html#rubygems_compatibility
50
+ * On Linux/Mac, you can now specify a RUBYGEMS_VERSION environment var to test against a specific version of RubyGems.
51
+ * Improved smoketest.rb and autogem_test.rb
52
+ * Tests now run on windows (only against latest rubygems, with it installed, and only via test/test_all.rb, not rake)
53
+ * deprecated/disabled prefer_binary_platform
54
+ * many other small cleanups
55
+
56
+ == 0.2.5 / 2007-10-24
57
+ * Add 'include_config' directive to yaml config file, allowing other files to be included via ERB.
58
+ * Fix broken links in docs - patch from Maciej Kozak (macio)
59
+
60
+ == 0.2.4 / 2007-10-21
61
+ * Look for config file at config/geminstaller.yml as well as geminstaller.yml
62
+ * Make startup message ('Installing Gems...') debug level instead of info
63
+ * Add custom descriptive error if user gets access permission error when installing a gem
64
+
65
+ == 0.2.3 / 2007-08-03
66
+ * remove Autogem#process_gem debug statement
67
+ * Don't reset test_gem_home in test_gem_home_spec, shaves about 18 seconds off suite
68
+ * Suppress output of rubygems installation during tests with --quiet flag
69
+
70
+ == 0.2.2 / 2007-07-07
71
+ * Fix performance problems with autogem command (don't manually recurse dependencies, gem method does it already)
72
+ * Fix bad links in docs
73
+
74
+ == 0.2.1 / 2007-06-07
75
+ * Fixes to handle internal refactoring of command classes in RubyGems 0.9.3
76
+
77
+ == 0.2.0 / 2007-05-13
78
+ * First public release
79
+
80
+ == 0.0.1 / 2006-07-29
81
+
82
+ * Initial Creation
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2008 Chad Woolley
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/Manifest.txt ADDED
@@ -0,0 +1,78 @@
1
+ COPYING
2
+ History.txt
3
+ LICENSE
4
+ Manifest.txt
5
+ README.txt
6
+ Rakefile
7
+ TODO.txt
8
+ authors
9
+ bin/geminstaller
10
+ cruise_config.rb
11
+ focused_spec.sh
12
+ focused_spec_debug.sh
13
+ geminstaller.yml
14
+ lib/geminstaller.rb
15
+ lib/geminstaller/application.rb
16
+ lib/geminstaller/arg_parser.rb
17
+ lib/geminstaller/autogem.rb
18
+ lib/geminstaller/backward_compatibility.rb
19
+ lib/geminstaller/bundler_exporter.rb
20
+ lib/geminstaller/config.rb
21
+ lib/geminstaller/config_builder.rb
22
+ lib/geminstaller/enhanced_stream_ui.rb
23
+ lib/geminstaller/exact_match_list_command.rb
24
+ lib/geminstaller/file_reader.rb
25
+ lib/geminstaller/gem_arg_processor.rb
26
+ lib/geminstaller/gem_command_manager.rb
27
+ lib/geminstaller/gem_interaction_handler.rb
28
+ lib/geminstaller/gem_list_checker.rb
29
+ lib/geminstaller/gem_runner_proxy.rb
30
+ lib/geminstaller/gem_source_index_proxy.rb
31
+ lib/geminstaller/gem_spec_manager.rb
32
+ lib/geminstaller/geminstaller_access_error.rb
33
+ lib/geminstaller/geminstaller_error.rb
34
+ lib/geminstaller/hoe_extensions.rb
35
+ lib/geminstaller/install_processor.rb
36
+ lib/geminstaller/missing_dependency_finder.rb
37
+ lib/geminstaller/missing_file_error.rb
38
+ lib/geminstaller/noninteractive_chooser.rb
39
+ lib/geminstaller/outdated_gem_finder.rb
40
+ lib/geminstaller/output_filter.rb
41
+ lib/geminstaller/output_listener.rb
42
+ lib/geminstaller/output_observer.rb
43
+ lib/geminstaller/output_proxy.rb
44
+ lib/geminstaller/registry.rb
45
+ lib/geminstaller/requires.rb
46
+ lib/geminstaller/rogue_gem_finder.rb
47
+ lib/geminstaller/ruby_gem.rb
48
+ lib/geminstaller/rubygems_exit.rb
49
+ lib/geminstaller/rubygems_extensions.rb
50
+ lib/geminstaller/rubygems_version_checker.rb
51
+ lib/geminstaller/rubygems_version_warnings.rb
52
+ lib/geminstaller/source_index_search_adapter.rb
53
+ lib/geminstaller/unauthorized_dependency_prompt_error.rb
54
+ lib/geminstaller/unexpected_prompt_error.rb
55
+ lib/geminstaller/valid_platform_selector.rb
56
+ lib/geminstaller/version_specifier.rb
57
+ lib/geminstaller/yaml_loader.rb
58
+ lib/geminstaller_rails_preinitializer.rb
59
+ start_local_gem_server.sh
60
+ website/config.yaml
61
+ website/src/analytics.page
62
+ website/src/code/ci.virtual
63
+ website/src/code/coverage/index.virtual
64
+ website/src/code/index.page
65
+ website/src/code/rdoc/index.virtual
66
+ website/src/community/index.page
67
+ website/src/community/links.page
68
+ website/src/community/rubyforge.virtual
69
+ website/src/default.css
70
+ website/src/default.template
71
+ website/src/documentation/documentation.page
72
+ website/src/documentation/index.page
73
+ website/src/documentation/tutorials.page
74
+ website/src/download.page
75
+ website/src/faq.page
76
+ website/src/index.page
77
+ website/src/metainfo
78
+ website/src/webgen.css
data/README.txt ADDED
@@ -0,0 +1,77 @@
1
+ = GemInstaller
2
+
3
+ * http://geminstaller.rubyforge.org
4
+ * http://thewoolleyweb.lighthouseapp.com/projects/11580-geminstaller
5
+ * mailto:"GemInstaller Development" <geminstaller-development@rubyforge.org>
6
+ * mailto:"Chad Woolley" <thewoolleyman@gmail.com>
7
+
8
+ == DESCRIPTION:
9
+
10
+ Automated Gem installation, activation, and much more!
11
+
12
+ == jwhitmire-fork FEATURES:
13
+
14
+ * Added a -o command line option to print a list of outdated gems. This should help to keep the
15
+ geminstaller.yml file up to date with the latest gems installed on the machine. Eventually
16
+ I would like to expand this to have a auto-update function to automatically bump the versions
17
+ in the geminstaller.yml up to the latest version, but that's because I'm generally lazy.
18
+
19
+
20
+ == FEATURES:
21
+
22
+ GemInstaller provides automated installation, loading and activation of RubyGems. It uses a simple YAML config file to:
23
+ * Automatically install the correct versions of all required gems wherever your app runs.
24
+ * Automatically ensure installed gems and versions are consistent across multiple applications, machines, platforms, and environments
25
+ * Automatically activate correct versions of gems on the ruby load path when your app runs ('require_gem'/'gem')
26
+ * Automatically reinstall missing dependency gems (built in to RubyGems > 1.0)
27
+ * Automatically detect correct platform to install for multi-platform gems (built in to RubyGems > 1.0)
28
+ * 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.
29
+ * 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.
30
+ * Allow for dynamic selection of gems, versions, and platforms to be used based on environment vars or any other logic.
31
+ * Avoid the "works on demo, breaks on production" syndrome
32
+ * Find lost socks.
33
+
34
+ == SYNOPSYS:
35
+
36
+ See Quick Start at http://geminstaller.rubyforge.org/documentation/index.html
37
+
38
+ === Bugs/Patches
39
+
40
+ http://thewoolleyweb.lighthouseapp.com/projects/11580-geminstaller
41
+
42
+ === Quick Start:
43
+
44
+ See http://geminstaller.rubyforge.org/documentation/index.html
45
+
46
+ == REQUIREMENTS:
47
+
48
+ * RubyGems
49
+
50
+ == INSTALL:
51
+
52
+ * [sudo] gem install geminstaller
53
+
54
+ == LICENSE:
55
+
56
+ (The MIT License)
57
+
58
+ Copyright (c) 2008 Chad Woolley
59
+
60
+ Permission is hereby granted, free of charge, to any person obtaining
61
+ a copy of this software and associated documentation files (the
62
+ 'Software'), to deal in the Software without restriction, including
63
+ without limitation the rights to use, copy, modify, merge, publish,
64
+ distribute, sublicense, and/or sell copies of the Software, and to
65
+ permit persons to whom the Software is furnished to do so, subject to
66
+ the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be
69
+ included in all copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
72
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
74
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
75
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
76
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
77
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,210 @@
1
+ # -*- ruby -*-
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/spec/helper/test_gem_home")
4
+ GemInstaller::TestGemHome.install_rubygems
5
+
6
+ begin
7
+ require 'hoe'
8
+ rescue LoadError => e
9
+ puts e
10
+ abort "ERROR: GemInstaller has build- and test-time dependencies
11
+ on Hoe and other libraries. Run the 'geminstaller'
12
+ executable from the root of the geminstaller source
13
+ tree, and GemInstaller will automatically install
14
+ these dependencies."
15
+ end
16
+
17
+ puts "Gem::RubyGemsVersion = #{Gem::RubyGemsVersion}"
18
+ require './lib/geminstaller.rb'
19
+ require './lib/geminstaller/hoe_extensions.rb'
20
+
21
+ IndependentHoe.plugin :seattlerb
22
+
23
+ IndependentHoe.spec 'jwhitmire-geminstaller' do |p|
24
+ developer 'Chad Woolley', 'thewoolleyman@gmail.com'
25
+ developer 'Jeff Whitmire', 'jeff@jwhitmire.com'
26
+ p.version = GemInstaller.version
27
+ p.summary = "See http://github.com/jwhitmire/geminstaller"
28
+ clean_globs << 'coverage'
29
+ clean_globs << 'website/out'
30
+ clean_globs << 'website/output'
31
+ clean_globs << '**/webgen.cache'
32
+ p.extra_deps = []
33
+ end
34
+
35
+ def run_smoketest(path_to_smoketest)
36
+ cmd = "#{Hoe::RUBY_FLAGS} #{path_to_smoketest} #{Hoe::FILTER}"
37
+ result = send :ruby, cmd
38
+ raise "#{path_to_smoketest} Smoketest failed" unless result == 0 || result == true
39
+ end
40
+
41
+ desc "Run all metrics"
42
+ task :metrics do
43
+ Rake::Task[:coverage].invoke
44
+ Rake::Task[:audit].invoke
45
+ end
46
+
47
+ task :coverage do
48
+ rm_rf "coverage"
49
+ rm_rf "website/out/code/coverage"
50
+ sh "mkdir -p website/out/code"
51
+ sh "rcov -o website/out/code/coverage test_suites/test_all.rb"
52
+ end
53
+
54
+ task :coverage_no_fail do
55
+ begin
56
+ Rake::Task[:coverage].invoke
57
+ rescue
58
+ end
59
+ end
60
+
61
+ desc "Diff the manifest"
62
+ task :diff_manifest => :clean do
63
+ f = "Manifest.tmp"
64
+ require 'find'
65
+ files = []
66
+ Find.find '.' do |path|
67
+ next unless File.file? path
68
+ next if path =~ /\.svn|tmp$|CVS/
69
+ next if path =~ /\.git|\.gitmodules/
70
+ next if path =~ /dummyrepo/
71
+ next if path =~ /\.iml|\.ipr|\.iws|\.kpf|\.tmproj|\.project/
72
+ next if path =~ /\.idea/
73
+ next if path =~ /tmtags/
74
+ next if path =~ /\.\/nbproject/
75
+ next if path =~ /\.\/spec/
76
+ next if path =~ /\.\/test_suites/
77
+ next if path =~ /\.\/pkg/
78
+ next if path =~ /\.\/out/
79
+ next if path =~ /\.\/website\/out/
80
+ files << path[2..-1]
81
+ end
82
+ files = files.sort.join "\n"
83
+ File.open f, 'w' do |fp| fp.puts files end
84
+ system "diff -du Manifest.txt #{f}"
85
+ rm f
86
+ end
87
+
88
+ desc "Update the manifest"
89
+ task :update_manifest do
90
+ system('rake diff_manifest | patch -p0 Manifest.txt')
91
+ end
92
+
93
+ desc "Run Webgen to generate website"
94
+ task :webgen do
95
+ # rm_rf "website/out"
96
+ rm_rf "website/webgen.cache"
97
+ # Use webgen/RedCloth versions from GemInstaller config
98
+ # require 'geminstaller'
99
+ # GemInstaller.autogem
100
+ # ARGV.clear
101
+ # ARGV.concat(['-d','website'])
102
+ # load 'webgen'
103
+ sh 'webgen -d website'
104
+ end
105
+
106
+ desc "Move ri docs to website"
107
+ task :website_rdocs => :docs do
108
+ rm_rf "website/out/code/rdoc"
109
+ sh "mkdir -p website/out/code/"
110
+ mv "doc", "website/out/code/rdoc"
111
+ end
112
+
113
+ desc "Generate website, including rdoc and coverage"
114
+ task :website => [:webgen, :website_rdocs, :coverage] do
115
+ end
116
+
117
+ desc 'Publish website to RubyForge'
118
+ task :publish_website => [:clean, :website, :upload_website] do
119
+ end
120
+
121
+ desc 'Publish website to RubyForge even if test coverage run rails'
122
+ task :publish_website_no_fail => [:clean, :webgen, :website_rdocs, :coverage_no_fail, :upload_website] do
123
+ end
124
+
125
+ desc 'Upload website (should already be clean and generated)'
126
+ task :upload_website do
127
+ host = "thewoolleyman@rubyforge.org"
128
+ remote_dir = "/var/www/gforge-projects/geminstaller"
129
+ local_dir = 'website/out'
130
+ sh %{rsync -av --delete --exclude=statsvn #{local_dir}/ #{host}:#{remote_dir}}
131
+ end
132
+
133
+ desc 'Run All Smoketests'
134
+ task :all_smoketest => [:git_submodule_update, :clean] do
135
+ run_smoketest 'test_suites/test_all_smoketests.rb'
136
+ end
137
+
138
+ desc 'Run Install Smoketest'
139
+ task :install_smoketest => [:git_submodule_update, :clean] do
140
+ run_smoketest 'spec/smoketest/install_smoketest.rb'
141
+ end
142
+
143
+ desc 'Run AutoGem Smoketest'
144
+ task :autogem_smoketest => [:git_submodule_update, :clean] do
145
+ run_smoketest 'spec/smoketest/autogem_smoketest.rb'
146
+ end
147
+
148
+ desc 'Run Rails Smoketest'
149
+ task :rails_smoketest => [:git_submodule_update, :clean] do
150
+ run_smoketest 'spec/smoketest/rails_smoketest.rb'
151
+ end
152
+
153
+ desc 'Run Debug Smoketest'
154
+ task :debug_smoketest => [:git_submodule_update, :clean] do
155
+ run_smoketest 'spec/smoketest/debug_smoketest.rb'
156
+ end
157
+
158
+ desc 'CruiseControl.rb default task'
159
+ task :cruise => [:geminstaller, :git_submodule_commit_and_push] do
160
+ Rake::Task[:default].invoke
161
+ end
162
+
163
+ desc 'Run GemInstaller to install development dependencies'
164
+ task :geminstaller do
165
+ system('geminstaller') || raise("'geminstaller' command failed")
166
+ end
167
+
168
+ desc 'Git submodules init and update'
169
+ task :git_submodule_update do
170
+ if File.exist?(File.dirname(__FILE__) + "/.git")
171
+ # NOTE: If you remove a submodule, you must do 'git rm --cached [path to deleted submodule]' or else you will get warnings
172
+ sh "git submodule init"
173
+ sh "git submodule update"
174
+ end
175
+ end
176
+
177
+ # TODO: make these use submodule foreach option
178
+ desc 'Git submodules init, update, and pull'
179
+ task :git_submodule_pull => [:git_submodule_update] do
180
+ if File.exist?(File.dirname(__FILE__) + "/.git")
181
+ sh "cd dummyrepo && git pull origin master && git status; cd .."
182
+ sh "cd spec/fixture/rubygems_dist/rubygems-trunk/ && git pull origin master && git status; cd ../../../../"
183
+ end
184
+ end
185
+
186
+ # TODO: make these use submodule foreach option
187
+ desc 'Git submodules init, update, pull, commit, and push - warning - does a commit and push to remote repo'
188
+ task :git_submodule_commit_and_push => [:git_submodule_pull] do
189
+ if File.exist?(File.dirname(__FILE__) + "/.git") && git_repo_writeable?
190
+ puts "Updating, committing, and pushing git submodule updates..."
191
+ git_commit_submodule_commit('dummyrepo')
192
+ git_commit_submodule_commit('spec/fixture/rubygems_dist/rubygems-trunk')
193
+ sh "git push"
194
+ end
195
+ end
196
+
197
+ def git_commit_submodule_commit(submodule_path)
198
+ sh "git commit #{submodule_path} -m 'update #{submodule_path} submodule'" do |ok, res|
199
+ if !ok and res.exitstatus != 1
200
+ puts "pattern not found (status = #{res.exitstatus})"
201
+ raise "git #{submodule_path} submodule commit failed"
202
+ end
203
+ end
204
+ end
205
+
206
+ def git_repo_writeable?
207
+ `git config --get-regexp remote\..+\.url` =~ /git@/
208
+ end
209
+
210
+ # vim: syntax=Ruby
data/TODO.txt ADDED
@@ -0,0 +1,138 @@
1
+ =============== Unfiled =============
2
+ * Tagline: "It's not just for installing gems!" - "removes the drudgery of installing, activating, and requiring gems"
3
+ * move to Github
4
+ * autoupdate of rails trunk
5
+ * redirection of links to old svn
6
+ * Rename autogem to activate
7
+ * add GemInstaller.require
8
+ * Replace Tagline / Summary / Readme with "Install, Activate, and Require"
9
+ * Big Quick Start Link on homepage
10
+ * Update config.gems faq item with link to rails tutorial
11
+ * rename sample app to rails_fixture_app, update important files with comments pointing to fixture app
12
+ * examples dir
13
+ * geminstaller_merb_example_app
14
+ * geminstaller_rails_example_app
15
+ * Update Rails tutorial link with link to example app
16
+ ================ 0.6.0 release ===================
17
+ * fix smoke tests on CI
18
+ * Investigate error when installing and loading gem in same session (like rails preinitializer) - Not reproducible - fixed in >1.1.0???
19
+ ================ 0.7.0 release ===================
20
+ * If permission error, auto-install under writable_gem_home ~/gems/1.8 (configurable), Gem.clear_paths, set ENV['GEM_HOME'] and ENV['GEM_PATH'] to ENV['HOME']pathsepGem::ConfigMap[:ruby_version], and issue warning (saying in order to prevent warning, a) set gem_home and gem_path: in ~/.gemrc, b) invoke via sudo (only if command line), c) make (and keep) current Gem.dir writeable, or d) add geminstaller (and ruby?) to sudoers file (security hole). Properties: "[no_]use_writable_gem_home" and "writable_gem_home".
21
+ * For RubyGems >=1.0.1, look at using Gem::SourceInfoCache instead of SourceIndex or --list command
22
+ * Move classes which are unused against current RubyGems into Legacy module.
23
+ * Speed! What can be done to speed things up?
24
+ * performance improvement: first try cache hit without all option, then with if not found.
25
+ * add command line tool to automatically generate files - default file, rake task (geminstaller:run, geminstaller:install, geminstaller:autogem), and preinit hook. Auto-detect rails vs. non-rails project and generate stuff accordingly. --setup, --setup-rails. Check for new-style boot.rb, fail if missing, check for RAILS_GEM_VERSION in environment.rb, warn if present.
26
+ * Merb support. init.rb. See lightning talk.
27
+ * Change 'run' to automatically automatically calls both 'install' and 'autogem', add 'no-install' and 'no-autogem' option (only applicable when invoked programatically) to suppress if desired
28
+ * auto-install on app startup should not be the default unless use_writable_gem_home is implemented, because of sudo/rake doublerun/speed issues. Update autogem missing gem error message accordingly.
29
+ * also look for config file under RAILS_ROOT/config, if RAILS_ROOT is defined (somehow fails under textmate, if working dir is wrong)
30
+ ================ 0.x.0 release ===================
31
+ * Change option handling to accept hashes in addition to strings when invoked programatically
32
+ * rails_smoketest.rb is not working, always reinstalls existing gems
33
+ * add option to use frozen edge rails before rails gem, understand the implications
34
+ * add auto-install option if gem version error is detected, update error message saying to set option
35
+ * cryptic message if "name:" is left off in yaml
36
+ * Add option to auto-update rubygems to specified version. See rubygems mailing list thread for details
37
+ * set up sample rails project with geminstaller hook and sample test under CI. Have cruise_config uninstall a dummy gem before rails tests, then have rails test ensure it was installed and loaded. (done but not running under CI yet)
38
+ ================ 0.x.x release ===================
39
+ * turn smoketest into rake task, with correct return code handling, and hook up to cruise
40
+ * look into and explain mongrel/webrick installation errors
41
+ * add top-level method for uninstall of gems, and document (requested by Alex Chaffee and others)
42
+ * docs - add example of using environment variable to control gem version without changing code (Rails)
43
+ * docs - document and add sample file for preinitializer boot hook. Explain why it can't be in environment.rb vs boot.rb or prinitializer (bottom line: env is not processed before Initializer, so can't be used to load rails gems)
44
+ * tutorial: using common or shared config files, with different configs for different environments - test (rspec) vs. dev (capistrano) vs. demo/staging/prod, mention include_config option and pros/cons of different approaches
45
+ * docs - rename "Documentation" page to "Manual"
46
+ * rogue gems config generation - add warning and instructions for cleaning up auto-generated file. For example, deleting rails dependencies
47
+ * faq - mention 'cannot load error' from load, and why it happens (rubygems can only load one version)
48
+ * faq - mention tradeoffs of optimistic version requirement (>=) vs pessimistic (=), specifically how mongrel specifies its dependencies
49
+ * put mongrel/rails startup bug in tracker, add link in "known bugs" section on home page.
50
+ * tutorial: running via capistrano
51
+ * crossreference front page, tutorials, and docs
52
+ ================ 0.x.x release ===================
53
+ * Namespace remaining un-namespaced constants
54
+ * Allow array or eval'able string of gems to be passed as --gems arg or instead of args
55
+ * Add @options[:gems], should be parsed from command line* root-owned gems: add -S | --sudo-only-if-allowed option, will only invoke sudo if GEMINSTALLER_ALLOW(S)_SUDO env var is set
56
+ * root-owned gems: add automatic re-invoke with sudo option (with warning message) if permission error is caught
57
+ * root-owned gems: Dynamically detect posix platform and check if gem repo is completely writeable. Ignorable prompt?
58
+ * docs - clean up sudo section. Should be clearer about sudoers entry, and make sure that NOPASSWD is the last entry. Rename from #dealing_with_sudo to #dealing_with_root_owned_gems, rewrite to reflect new best practices (different GEM_PATH or auto-sudo via capistrano)
59
+ * tutorial: update running via capistrano to reference new sudo docs
60
+ ================ 0.x.x release ===================
61
+ * handle installation of gem from file (requested by Alex Chaffee)
62
+ * Investigate gem_plugin. Plugin for mongrel???
63
+ * Investigate making a Rails plugin
64
+ ================ 0.x.x release ===================
65
+ * Why does RubyGems reinstall BlueCloth even though it is already installed?!?!? (remove from FAQ after solved)
66
+ * Figure out how to suppress webrick messages from embedded gem server
67
+ * add option to warn if any rogue gems are found
68
+ ================ 0.x.x release =====================
69
+ ================ 0.x.x finishing website ===================
70
+ * autogem and run args can be passed as string or array
71
+ * better test coverage for --sudo and --exception options
72
+ * use rspec context_setup
73
+ * split out geminstaller_spec into application_spec and geminstaller_spec. Fix reference in docs / design
74
+ * newlines printed between dots when "updating" message is included in error message
75
+ * Error on activerecord for brand-new rubygems installation - couldn't find gem. Did a gem list --remote activerecord, then it went away (got sudo error), then happened again, then worked when I passed -gall -rall options.
76
+ * Fastthread = only shows version 0.6.2 on windows, rubygems 0.9 ???
77
+ * geminstaller_spec autogem spec must have the GemRunner "initialized" or else the stub gem in test_gem_home won't be found by autogem.
78
+ * fix_dependencies=true takes FOREVER on windows
79
+ * echo stdin, lists presented for debug output levels
80
+ * Just ignore sudo option on windows, rather than throwing an error
81
+ * why does windows try to reinstall fxruby 1.6.6 when it is already installed???
82
+ * Figure out how to avoid checking dependency gems multiple times if multiple dependent gems depend on them.
83
+ * write coverage_no_platform_specific rake task (to get 100% coverage on a mac)
84
+ * On rogue gems, allow configuration of gems which are auto-installed and/or should be ignored.
85
+ * add option to print rogue gems with no extra output, for concatenation to existing gem list
86
+ * Research what all existing gem platforms are. See if they can all be covered in valid_platform_selector
87
+ * Can GemInstaller handle multiple gem server sources via multiple config files?
88
+ * Handle default gems that come with ruby/rubygems windows distro.
89
+ * refactor enhanced_stream_ui.ask_yes_no - does it need to catch the exception? Also review context name (no OutputProxy) and use of StringIO, and exception tests.
90
+ * rename enhanced_stream_ui to noninteractive_stream_ug
91
+ * add multilevel dependency smoketests for autogem (old rails version)
92
+ * refactor duplication in autogem/rogue_gem_finder using blocks
93
+ * rubygems stdout - don't print prefix for single dot
94
+ * clean up regexps - no leading or trailing .*
95
+ * Return meaningful message instructing to use the --sudo option if Errno::EACCES is caught on a sudo-able platform - should throw GemInstaller::AccessException, which can be caught
96
+ * Rails integration doesn't work under mongrel when invoked via executable (e.g, actionmailer gem not recognized after install, only after mongrel restart). Does't occur under webrick, or if geminstaller is invoked programatically via class.
97
+ * rails example doesn't print any warning if geminstaller is not installed
98
+ * "Installing gem" messages are duplicated if info message is specified, one from rubygems, one from geminstaller. See todo in install_processor.rb
99
+ * boot.rb parsed twice under webrick?
100
+ * commandecho doesn't print regexps correctly
101
+ * code coverage for logic paths supporting old rubygems versions
102
+ * spec_utils - use extend+include ClassAndInstanceMethods approach
103
+ * clean up registry - third-party first, no dependency next, alphabetized
104
+ * review/clean up ri/rdoc
105
+ * Better errors for invalid yaml (unsupported keys)
106
+ ========= 0.x.0 release ==============
107
+ * patch hoe to install_gem without sudo on windows
108
+ * understand why '> 1' must be quoted to be a valid yaml value - see yaml_loader_spec.rb
109
+ * tests failed when "partially" connected to network? (wireless at office)
110
+ * tests fail with timeouts intermittently on windows
111
+ * add more tests for dependencies to geminstaller_spec
112
+ * reconcile methods for testing error messages - manually vs proc_should_raise_with_message. Probably should patch rspec.
113
+ * remove test_gem_home.reset from geminstaller_spec.rb WITHOUT breaking the test suite.
114
+ * tests fail on windows - seems to be related to test_gem_home running twice. smoketest still passes.
115
+ * can't run binary out of source dir unless running it via ruby
116
+ * running binary via ruby out of bin dir will pick up gem first on load path if it is installed
117
+ * verify that >= version spec works with a specific platform, if that platform is not available for the highest version
118
+ * Check for write access, and exit with warning to use sudo if there is no write access.
119
+ * store rubygems dist as a tar, and untar it on demand
120
+ * Add spec file name to all contexts (or see if rspec can do it automatically)
121
+ * Embedded gem_server process doesn't get killed on windows during tests - need to use ruby services, see comment in embedded_gem_server.rb
122
+ * Embedded gem_server ports aren't handled correctly on linux during tests - port conflict on startup, open ports die off slowly after tests finish
123
+ * Do a port check before starting embedded gem server, give option to kill process or at least exit with a descriptive warning.
124
+ * remove cruft from test output - intercept output streams from gem_server and rubygems setup
125
+ * enhance DependencyInjector - allow items to be substituted prior to initialization - then geminstaller_spec could simply set a mock output_proxy on the registry instead of explicitly setting it every place it is used.
126
+ * ensure --debug install option works as expected
127
+ * fix all Zentest warnings
128
+ * Rename RubyGem class to RubyGemAction (or maybe RubyGemDependency to match 1.x)
129
+ * Automate process for creating a stubgem
130
+ * Give nice error message if gem server is unavailable (check socket)
131
+ * Make tests run under RadRails debugger
132
+ * handle unsupported gem install options - for example, -t gives uninitialized constant Gem::Validator
133
+ * update info in stubgem (not sow defaults)
134
+ * Fix errors when using relative or ~/ dir in --config path
135
+ * make verbose option specify --backtrace on all gem commands
136
+ * Add support, syntax, and options for uninstalling gems - completely, or down to highest specified version.
137
+ * add feature to automatically warn if there is a more recent version of the gem available and check_for_upgrade == false. Use "gem outdated" command
138
+ ================ 0.later.1 Unprioritized ===================
data/authors ADDED
@@ -0,0 +1,2 @@
1
+ thewoolleyman = Chad Woolley <thewoolleyman@gmail.com>
2
+ jwhitmire = Jeff Whitmire <jeff@jwhitmire.com>
data/bin/geminstaller ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ dir = File.dirname(__FILE__)
4
+
5
+ begin
6
+ require ' geminstaller'
7
+ rescue LoadError
8
+ require 'rubygems'
9
+ begin
10
+ # try load path
11
+ require 'geminstaller'
12
+ rescue LoadError
13
+ begin
14
+ # try lib subdir (TODO: is this necessary?)
15
+ require 'lib/geminstaller'
16
+ rescue LoadError
17
+ # try lib dir as peer of current dir
18
+ require "#{dir}/../lib/geminstaller"
19
+ end
20
+ end
21
+ end
22
+
23
+ geminstaller_executable ||= File.join(File.expand_path(dir), 'geminstaller')
24
+
25
+ if ARGV.include?('--geminstaller-exec-path')
26
+ print "geminstaller_exec_path=#{geminstaller_executable}"
27
+ exit 0
28
+ end
29
+
30
+ exit GemInstaller.install(ARGV, geminstaller_executable)