Mailinglist Archive: yast-commit (1535 mails)

< Previous Next >
[yast-commit] <web-client> master : do not require rubygems
  • From: Ladislav Slezak <lslezak@xxxxxxxxxx>
  • Date: Mon, 26 Oct 2009 09:38:44 +0100
  • Message-id: <E1N2LD6-0005uy-40@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit f707cd72237f3911da666e72ecc2f9f2e3b63ee3
Author: Ladislav Slezak <lslezak@xxxxxxxxxx>
Date: Mon Oct 26 09:32:57 2009 +0100

do not require rubygems

see http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices
section "Don’t depend on rubygems"
---
.../functional/administrator_controller_test.rb | 1 -
plugins/administrator/test/test_helper.rb | 1 -
plugins/eulas/test/test_helper.rb | 1 -
.../test/functional/language_controller_test.rb | 1 -
plugins/language/test/test_helper.rb | 1 -
plugins/mail_settings/test/test_helper.rb | 1 -
plugins/network/test/test_helper.rb | 1 -
plugins/patch_updates/test/test_helper.rb | 1 -
.../test/functional/permission_controller_test.rb | 1 -
plugins/permissions/test/test_helper.rb | 1 -
.../functional/registration_controller_test.rb | 1 -
plugins/registration/test/test_helper.rb | 1 -
plugins/samba_server/test/test_helper.rb | 1 -
plugins/security/test/test_helper.rb | 1 -
plugins/services/test/test_helper.rb | 1 -
plugins/status/test/test_helper.rb | 1 -
.../test/functional/system_controller_test.rb | 1 -
plugins/system/test/test_helper.rb | 1 -
.../test/functional/systemtime_controller_test.rb | 1 -
plugins/systemtime/test/test_helper.rb | 1 -
plugins/users/test/test_helper.rb | 1 -
webclient/lib/selenium/test_case.rb | 3 ---
webclient/lib/tasks/selenium.rake | 17 ++++++++++++-----
webclient/test/dummy-host/host.rb | 1 -
24 files changed, 12 insertions(+), 30 deletions(-)

diff --git
a/plugins/administrator/test/functional/administrator_controller_test.rb
b/plugins/administrator/test/functional/administrator_controller_test.rb
index b55e288..4557a34 100644
--- a/plugins/administrator/test/functional/administrator_controller_test.rb
+++ b/plugins/administrator/test/functional/administrator_controller_test.rb
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"),
RailsParent.parent )
-require 'rubygems'

class AdministratorControllerTest < ActionController::TestCase

diff --git a/plugins/administrator/test/test_helper.rb
b/plugins/administrator/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/administrator/test/test_helper.rb
+++ b/plugins/administrator/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git a/plugins/eulas/test/test_helper.rb
b/plugins/eulas/test/test_helper.rb
index a9445b7..8b2575f 100644
--- a/plugins/eulas/test/test_helper.rb
+++ b/plugins/eulas/test/test_helper.rb
@@ -13,6 +13,5 @@ end
ENV["RAILS_ENV"] = "test"
require File.expand_path(rails_parent + "/config/environment")

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
diff --git a/plugins/language/test/functional/language_controller_test.rb
b/plugins/language/test/functional/language_controller_test.rb
index 5637244..e4d4447 100644
--- a/plugins/language/test/functional/language_controller_test.rb
+++ b/plugins/language/test/functional/language_controller_test.rb
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"),
RailsParent.parent )
-require 'rubygems'
require 'mocha'


diff --git a/plugins/language/test/test_helper.rb
b/plugins/language/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/language/test/test_helper.rb
+++ b/plugins/language/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git a/plugins/mail_settings/test/test_helper.rb
b/plugins/mail_settings/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/mail_settings/test/test_helper.rb
+++ b/plugins/mail_settings/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git a/plugins/network/test/test_helper.rb
b/plugins/network/test/test_helper.rb
index a9445b7..8b2575f 100644
--- a/plugins/network/test/test_helper.rb
+++ b/plugins/network/test/test_helper.rb
@@ -13,6 +13,5 @@ end
ENV["RAILS_ENV"] = "test"
require File.expand_path(rails_parent + "/config/environment")

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
diff --git a/plugins/patch_updates/test/test_helper.rb
b/plugins/patch_updates/test/test_helper.rb
index cf148b8..61e0acc 100644
--- a/plugins/patch_updates/test/test_helper.rb
+++ b/plugins/patch_updates/test/test_helper.rb
@@ -1,3 +1,2 @@
-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
\ No newline at end of file
diff --git a/plugins/permissions/test/functional/permission_controller_test.rb
b/plugins/permissions/test/functional/permission_controller_test.rb
index 7454726..652338b 100644
--- a/plugins/permissions/test/functional/permission_controller_test.rb
+++ b/plugins/permissions/test/functional/permission_controller_test.rb
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"),
RailsParent.parent )
-require 'rubygems'
require 'mocha'


diff --git a/plugins/permissions/test/test_helper.rb
b/plugins/permissions/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/permissions/test/test_helper.rb
+++ b/plugins/permissions/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git
a/plugins/registration/test/functional/registration_controller_test.rb
b/plugins/registration/test/functional/registration_controller_test.rb
index 837760f..53cdd7a 100644
--- a/plugins/registration/test/functional/registration_controller_test.rb
+++ b/plugins/registration/test/functional/registration_controller_test.rb
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"),
RailsParent.parent )
-require 'rubygems'
require 'mocha'


diff --git a/plugins/registration/test/test_helper.rb
b/plugins/registration/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/registration/test/test_helper.rb
+++ b/plugins/registration/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git a/plugins/samba_server/test/test_helper.rb
b/plugins/samba_server/test/test_helper.rb
index cf148b8..61e0acc 100644
--- a/plugins/samba_server/test/test_helper.rb
+++ b/plugins/samba_server/test/test_helper.rb
@@ -1,3 +1,2 @@
-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
\ No newline at end of file
diff --git a/plugins/security/test/test_helper.rb
b/plugins/security/test/test_helper.rb
index cf148b8..61e0acc 100644
--- a/plugins/security/test/test_helper.rb
+++ b/plugins/security/test/test_helper.rb
@@ -1,3 +1,2 @@
-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
\ No newline at end of file
diff --git a/plugins/services/test/test_helper.rb
b/plugins/services/test/test_helper.rb
index a9445b7..8b2575f 100644
--- a/plugins/services/test/test_helper.rb
+++ b/plugins/services/test/test_helper.rb
@@ -13,6 +13,5 @@ end
ENV["RAILS_ENV"] = "test"
require File.expand_path(rails_parent + "/config/environment")

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
diff --git a/plugins/status/test/test_helper.rb
b/plugins/status/test/test_helper.rb
index cf148b8..61e0acc 100644
--- a/plugins/status/test/test_helper.rb
+++ b/plugins/status/test/test_helper.rb
@@ -1,3 +1,2 @@
-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
\ No newline at end of file
diff --git a/plugins/system/test/functional/system_controller_test.rb
b/plugins/system/test/functional/system_controller_test.rb
index 62299d4..6a1cfac 100644
--- a/plugins/system/test/functional/system_controller_test.rb
+++ b/plugins/system/test/functional/system_controller_test.rb
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"),
RailsParent.parent )
-require 'rubygems'

class SystemControllerTest < ActionController::TestCase

diff --git a/plugins/system/test/test_helper.rb
b/plugins/system/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/system/test/test_helper.rb
+++ b/plugins/system/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git a/plugins/systemtime/test/functional/systemtime_controller_test.rb
b/plugins/systemtime/test/functional/systemtime_controller_test.rb
index 2bcd022..c4c93f9 100644
--- a/plugins/systemtime/test/functional/systemtime_controller_test.rb
+++ b/plugins/systemtime/test/functional/systemtime_controller_test.rb
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"),
RailsParent.parent )
-require 'rubygems'
require 'mocha'

class SystemtimeControllerTest < ActionController::TestCase
diff --git a/plugins/systemtime/test/test_helper.rb
b/plugins/systemtime/test/test_helper.rb
index d8863e1..dd80852 100644
--- a/plugins/systemtime/test/test_helper.rb
+++ b/plugins/systemtime/test/test_helper.rb
@@ -5,7 +5,6 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path( File.join("config","environment"),
RailsParent.parent )
require 'test_help'

-require 'rubygems'
require 'active_support'
require 'active_support/test_case'

diff --git a/plugins/users/test/test_helper.rb
b/plugins/users/test/test_helper.rb
index cf148b8..61e0acc 100644
--- a/plugins/users/test/test_helper.rb
+++ b/plugins/users/test/test_helper.rb
@@ -1,3 +1,2 @@
-require 'rubygems'
require 'active_support'
require 'active_support/test_case'
\ No newline at end of file
diff --git a/webclient/lib/selenium/test_case.rb
b/webclient/lib/selenium/test_case.rb
index 192a88e..c8dd41c 100644
--- a/webclient/lib/selenium/test_case.rb
+++ b/webclient/lib/selenium/test_case.rb
@@ -1,12 +1,9 @@
-require 'rubygems'
-gem 'selenium-client', '>=1.2.16'
require 'selenium'

# test-unit gem is needed, it provides startup and shutdown
# methods which are not available in Test::Unit included in standard Ruby.
# see http://test-unit.rubyforge.org/test-unit/
# and http://test-unit.rubyforge.org/test-unit/classes/Test/Unit/TestCase.html
-gem 'test-unit', '>=2.0.2'
require 'test/unit'

module Selenium
diff --git a/webclient/lib/tasks/selenium.rake
b/webclient/lib/tasks/selenium.rake
index 69d977a..56df872 100644
--- a/webclient/lib/tasks/selenium.rake
+++ b/webclient/lib/tasks/selenium.rake
@@ -1,7 +1,6 @@
$selenium_available = false

begin
- require 'rubygems'
# try loading all selenium task definitions
require 'selenium/rake/tasks'
$selenium_available = true
@@ -77,6 +76,14 @@ namespace :test do

Rake::Task['test:ui:check'].comment = "Note: Selenium Server must be
running"

+ begin
+ require 'test/unit/version'
+ # require test-unit version 2.x
+ test_unit_present = (Test::Unit::VERSION =~ (/^2\./)).zero?
+ rescue LoadError
+ test_unit_present = false
+ end
+
# define test:ui task - start/shut down Selenium server component
automatically
desc 'Run UI tests using Selenium testing framework'
if not $selenium_available
@@ -84,13 +91,13 @@ namespace :test do
$stderr.puts "ERROR: 'selenium-client' gem is missing, UI testing
task (test:ui)"
$stderr.puts " cannot be started. Install 'selenium-client'
Ruby gem first."
exit 1
- end
- elsif !Gem.available? 'test-unit', '>=2.0.2'
- task :ui do
+ end
+ elsif !test_unit_present
+ task :ui do
$stderr.puts "ERROR: 'test-unit' gem is missing, UI testing task
(test:ui)"
$stderr.puts " cannot be started. Install 'test-unit' Ruby
gem first."
exit 1
- end
+ end
else
task :ui => [:"webric:start",:"sinatra:start", :"selenium:rc:start",
:"test:ui:check", :"selenium:rc:stop", :"sinatra:stop", :"webric:stop"]
end
diff --git a/webclient/test/dummy-host/host.rb
b/webclient/test/dummy-host/host.rb
index f1c07b2..ab4d545 100644
--- a/webclient/test/dummy-host/host.rb
+++ b/webclient/test/dummy-host/host.rb
@@ -1,5 +1,4 @@
# host.rb
- require 'rubygems'
require 'active_support'
require 'sinatra'

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages