geminstaller 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,13 @@
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
+
1
11
  == 0.5.2 / 2009-07-24
2
12
  * Support for Rubygems 1.3.5
3
13
 
data/README.txt CHANGED
@@ -21,7 +21,7 @@ GemInstaller provides automated installation, loading and activation of RubyGems
21
21
  * 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.
22
22
  * Allow for dynamic selection of gems, versions, and platforms to be used based on environment vars or any other logic.
23
23
  * Avoid the "works on demo, breaks on production" syndrome
24
- * Solve world hunger, prevent the global energy crisis, and wash your socks.
24
+ * Find lost socks.
25
25
 
26
26
  == SYNOPSYS:
27
27
 
data/Rakefile CHANGED
@@ -48,7 +48,7 @@ task :coverage do
48
48
  rm_rf "coverage"
49
49
  rm_rf "website/out/code/coverage"
50
50
  sh "mkdir -p website/out/code"
51
- sh "rcov -o website/out/code/coverage test/test_all.rb"
51
+ sh "rcov -o website/out/code/coverage test_suites/test_all.rb"
52
52
  end
53
53
 
54
54
  task :coverage_no_fail do
@@ -70,6 +70,7 @@ task :diff_manifest => :clean do
70
70
  next if path =~ /dummyrepo/
71
71
  next if path =~ /\.iml|\.ipr|\.iws|\.kpf|\.tmproj|\.project/
72
72
  next if path =~ /\.idea/
73
+ next if path =~ /tmtags/
73
74
  next if path =~ /\.\/nbproject/
74
75
  next if path =~ /\.\/spec/
75
76
  next if path =~ /\.\/test_suites/
@@ -131,7 +132,7 @@ end
131
132
 
132
133
  desc 'Run All Smoketests'
133
134
  task :all_smoketest => [:git_submodule_update, :clean] do
134
- run_smoketest 'test/test_all_smoketests.rb'
135
+ run_smoketest 'test_suites/test_all_smoketests.rb'
135
136
  end
136
137
 
137
138
  desc 'Run Install Smoketest'
@@ -173,6 +174,7 @@ task :git_submodule_update do
173
174
  end
174
175
  end
175
176
 
177
+ # TODO: make these use submodule foreach option
176
178
  desc 'Git submodules init, update, and pull'
177
179
  task :git_submodule_pull => [:git_submodule_update] do
178
180
  if File.exist?(File.dirname(__FILE__) + "/.git")
@@ -181,6 +183,7 @@ task :git_submodule_pull => [:git_submodule_update] do
181
183
  end
182
184
  end
183
185
 
186
+ # TODO: make these use submodule foreach option
184
187
  desc 'Git submodules init, update, pull, commit, and push - warning - does a commit and push to remote repo'
185
188
  task :git_submodule_commit_and_push => [:git_submodule_pull] do
186
189
  if File.exist?(File.dirname(__FILE__) + "/.git") && git_repo_writeable?
@@ -34,7 +34,7 @@ module GemInstaller
34
34
  end
35
35
 
36
36
  def self.version
37
- "0.5.2"
37
+ "0.5.3"
38
38
  end
39
39
 
40
40
  def self.create_application(args = [], registry = nil)
@@ -3,6 +3,8 @@ module GemInstaller
3
3
  attr_writer :gem_command_manager, :gem_source_index_proxy
4
4
  def autogem(gems)
5
5
  @gem_source_index_proxy.refresh!
6
+ # REALLY refresh - refreshing the source_index directly isn't enough.
7
+ Gem.refresh
6
8
  @completed_names = []
7
9
  @completed_gems = []
8
10
  gems.each do |gem|
@@ -6,7 +6,7 @@ module GemInstaller
6
6
  attr_reader :config_file_paths_array
7
7
  attr_writer :file_reader, :yaml_loader, :config_file_paths, :output_filter
8
8
 
9
- def initialize(default_config_file_paths_array = ['geminstaller.yml','config/geminstaller.yml'])
9
+ def initialize(default_config_file_paths_array = ['geminstaller.yml','config/geminstaller.yml','ci/geminstaller.yml'])
10
10
  @default_config_file_paths_array = default_config_file_paths_array
11
11
  end
12
12
 
@@ -5,7 +5,7 @@ module GemInstaller
5
5
  # This overrides the default RubyGems ListCommand behavior of doing a wildcard match. This caused problems
6
6
  # when some gems (ActiveRecord-JDBC) caused exceptions during a remote list, causing a remote list
7
7
  # of other gems (activerecord) to fail as well
8
- options[:name] = /^#{string}$/i
8
+ options[:name] = /^#{string}$/
9
9
  # Do a little metaprogramming magic to avoid calling the problematic execute method on the ListCommand
10
10
  # superclass, and instead directly call the method on the QueryCommand grandparent 'supersuperclass'
11
11
  unbound_execute_method = QUERY_COMMAND_CLASS.instance_method(:execute)
@@ -36,21 +36,18 @@ module GemInstaller
36
36
  run_args = ["dependency", name_regexp, "--version", version]
37
37
  run_args += additional_options
38
38
  output_lines = @gem_runner_proxy.run(run_args)
39
- p output_lines
40
- # dependency output has all lines in the first element
41
- output_array = output_lines[0].split("\n")
42
39
  # drop the first line which just echoes the dependent gem
43
- output_array.shift
40
+ output_lines.shift
44
41
  # drop the line containing 'requires' (rubygems < 0.9.0)
45
- if output_array[0] == ' Requires'
46
- output_array.shift
42
+ if output_lines[0] == ' Requires'
43
+ output_lines.shift
47
44
  end
48
45
  # drop all empty lines
49
- output_array.reject! { |line| line == "" }
46
+ output_lines.reject! { |line| line == "" }
50
47
  # strip leading space
51
- output_array.each { |line| line.strip! }
48
+ output_lines.each { |line| line.strip! }
52
49
  # convert into gems
53
- output_gems = output_array.collect do |line|
50
+ output_gems = output_lines.collect do |line|
54
51
  name = line.split(' ')[0]
55
52
  version_spec = line.split(/[(,)]/)[1]
56
53
  GemInstaller::RubyGem.new(name, :version => version_spec)
@@ -15,6 +15,9 @@ module GemInstaller
15
15
 
16
16
  exit_status = nil
17
17
  begin
18
+ # The call below is to work around RubyGem's behavior of caching (only) the last-used source when
19
+ # multiple gem commands for gems on different sources are issued via the API
20
+ Gem.sources.replace Gem.default_sources
18
21
  gem_runner.run(args)
19
22
  rescue SystemExit => system_exit
20
23
  if GemInstaller::RubyGemsVersionChecker.matches?('>1.0.1')
@@ -30,7 +33,9 @@ module GemInstaller
30
33
  end
31
34
  output_lines = @output_listener.read!
32
35
  output_lines.push(exit_status) if exit_status
33
- return output_lines
36
+ output_lines.collect do |line|
37
+ line.split("\n")
38
+ end.flatten
34
39
  end
35
40
 
36
41
  def create_gem_runner
@@ -26,8 +26,8 @@ module GemInstaller
26
26
 
27
27
  def format_rubygems_message(type, message)
28
28
  prefix = case type
29
- when :stdout : "[RubyGems:stdout] "
30
- when :stderr : "[RubyGems:stderr] "
29
+ when :stdout then "[RubyGems:stdout] "
30
+ when :stderr then "[RubyGems:stderr] "
31
31
  end
32
32
  "#{prefix}#{message}"
33
33
  end
@@ -46,4 +46,4 @@ module GemInstaller
46
46
  return false
47
47
  end
48
48
  end
49
- end
49
+ end
@@ -31,7 +31,15 @@ module GemInstallerRailsPreinitializer
31
31
 
32
32
  # The 'install' method will auto-install gems as specified by the args and config
33
33
  # IMPORTANT NOTE: Under recent RubyGems versions, this will install to ~/.gem
34
- GemInstaller.install(args)
34
+ # The forking is a workaround to 'check_for_upgrade' in the configuration file, which causes
35
+ # script/console crashes on Mac OS X. See http://www.ruby-forum.com/topic/101243 for details
36
+ # It is probably best not to install from preinitializer - it has known problems
37
+ # under Passenger, and you should be installing your gems before you initialize rails anyway,
38
+ # via capistrano, chef, or some other mechanism. So, it is commented for now.
39
+ # pid = fork do
40
+ # GemInstaller.install(args)
41
+ # end
42
+ # Process.wait(pid)
35
43
 
36
44
  # The 'autogem' method will automatically add all gems in the GemInstaller config to your load path,
37
45
  # using the rubygems 'gem' method. Note that only the *first* version of any given gem will be loaded.
@@ -23,7 +23,7 @@ These are some notes on the underlying design of GemInstaller, and the current s
23
23
  * I'm a proponent of high code coverage. I check periodically to ensure I maintain close to 100% code coverage, not counting platform- and version-specific code blocks (and I'll get around to those some day). Also, the sudo recursive invocation stuff still needs some tests, but that's a bit tricky to automate.
24
24
  * The tests are "harder" on Windows (but run fine on mac/linux). The app should work fine, but testing is pretty tricky. I have all tests working against the latest rubygems (1.0.1). Here's what does and doesn't work with tests against latest rubygems on windows:
25
25
  * install_smoketest.rb and autogem_smoketest.rb work
26
- * ruby test/test_all.rb works
26
+ * ruby test_suites/test_all.rb works
27
27
  * rake default test task does not work (this seems to be a problem with hoe on windows)
28
28
  * Sometimes test suite still hangs after a while, this is probably some orphaned EmbeddedGemServer process somewhere. A reboot should fix it - this is windows, after all!
29
29
  * One of my motivations for creating GemInstaller was as an exercise to help me learn Ruby better. If you see me doing anything obviously dumb or inefficient in the code or design, please let me know. Some of them I already know about, but haven't fixed, most I'm probably not aware of :)
@@ -65,7 +65,7 @@ Yeah, it's too manual. Notes for improvement below.
65
65
  ** install_smoketest.rb and autogem_smoketest.rb should pass for all RubyGems versions on mac/linux (if they are in a working state)
66
66
  ** test_all, install_smoketest.rb and autogem_smoketest.rb should pass for latest RubyGems version on windows (if they are in a working state)
67
67
  * Make sure everything is checked in
68
- * Make a tag in git
68
+ * Make a tag in git (git tag x.y.z; git push origin x.y.z)
69
69
  * rake clean package
70
70
  * Upload gem to rubyforge
71
71
  * rake publish_website
@@ -449,7 +449,8 @@ Here's an example of how <code>sudoers</code> might be configured to allow the l
449
449
 
450
450
  <pre><code>
451
451
  $ sudo visudo
452
- add this line:
452
+ # ADD this line (Do NOT delete any existing lines, or you may
453
+ # lose your sudo access and ability to administer your system!!!):
453
454
  <local user> ALL = NOPASSWD: /usr/local/bin/geminstaller, /usr/local/bin/ruby, /usr/local/bin/gem
454
455
  </code></pre>
455
456
 
@@ -26,7 +26,7 @@ Q: What about gems like RMagick that have platform-specific binary dependencies?
26
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
27
 
28
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/test_all.rb all work. See references to 'windows' on the "Code Page":code/index.html for more details.
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
30
 
31
31
  Q: Why else should I support GemInstaller?<br/>
32
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.
@@ -16,7 +16,7 @@ GemInstaller provides automated installation, loading and activation of RubyGems
16
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
17
  * Allow for dynamic selection of gems, versions, and platforms to be used based on environment vars or any other logic.
18
18
  * Avoid the "works on demo, breaks on production" syndrome.
19
- * Solve world hunger, prevent the global energy crisis, and wash your socks.
19
+ * Find lost socks.
20
20
 
21
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
22
 
@@ -46,6 +46,15 @@ Please "report any others that you find":http://thewoolleyweb.lighthouseapp.com/
46
46
 
47
47
  h2(#history). History
48
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
49
58
  * 0.5.2
50
59
  ** Support for Rubygems 1.3.5.
51
60
  * 0.5.1
@@ -78,7 +87,7 @@ h2(#history). History
78
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
79
88
  ** On Linux/Mac, you can now specify a RUBYGEMS_VERSION environment var to test against a specific version of RubyGems.
80
89
  ** Improved smoketest.rb and autogem_test.rb
81
- ** Tests now run on windows (only against latest rubygems, with it installed, and only via test/test_all.rb, not rake)
90
+ ** Tests now run on windows (only against latest rubygems, with it installed, and only via test_suites/test_all.rb, not rake)
82
91
  ** deprecated/disabled prefer_binary_platform
83
92
  ** many other small cleanups
84
93
  * 0.2.5
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.5.2
4
+ version: 0.5.3
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: 2009-07-24 00:00:00 -07:00
12
+ date: 2009-08-25 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15