From cbcc0ca57b0ea713d7d32364b599d88f2bef6d92 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 24 Apr 2009 10:41:45 -0700 Subject: Use Symbol#to_proc in rails plugin internals --- railties/lib/rails/plugin.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'railties') diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index dd840ef058..63864058ee 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/kernel/reporting' +require 'active_support/core_ext/symbol' require 'active_support/dependencies' module Rails -- cgit v1.2.3 From cd9bb88eefdbd8a43f0bb15934ae32985fd19b6e Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion)" Date: Sun, 26 Apr 2009 11:22:03 -0500 Subject: Remove reference to Rack::RewindableInput, which has been removed a while ago. Signed-off-by: Joshua Peek --- railties/lib/initializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index a03be59a2b..b3b409dc4d 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -568,7 +568,7 @@ Run `rake gems:install` to install the missing gems. Rails::Rack::Metal.metal_paths += plugin_loader.engine_metal_paths configuration.middleware.insert_before( - :"ActionDispatch::RewindableInput", + :"ActionDispatch::ParamsParser", Rails::Rack::Metal, :if => Rails::Rack::Metal.metals.any?) end -- cgit v1.2.3 From cecafc52ee0a4a53c903ddbaba95683261f88e5f Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Thu, 23 Apr 2009 15:58:38 -0700 Subject: Refactor ActionView::Template ActionView::Template is now completely independent from template storage, which allows different back ends such as the database. ActionView::Template's only responsibility is to take in the template source (passed in from ActionView::Path), compile it, and render it. --- railties/test/plugin_loader_test.rb | 4 ++-- railties/test/plugin_test_helper.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/test/plugin_loader_test.rb b/railties/test/plugin_loader_test.rb index b270748dd6..c647d7b478 100644 --- a/railties/test/plugin_loader_test.rb +++ b/railties/test/plugin_loader_test.rb @@ -132,8 +132,8 @@ class TestPluginLoader < Test::Unit::TestCase @loader.send :add_engine_view_paths - assert_equal [ File.join(plugin_fixture_path('engines/engine'), 'app', 'views') ], ActionController::Base.view_paths - assert_equal [ File.join(plugin_fixture_path('engines/engine'), 'app', 'views') ], ActionMailer::Base.view_paths + assert_equal [ File.join(plugin_fixture_path('engines/engine'), 'app', 'views') ], ActionController::Base.view_paths.map { |p| p.to_s } + assert_equal [ File.join(plugin_fixture_path('engines/engine'), 'app', 'views') ], ActionMailer::Base.view_paths.map { |p| p.to_s } end def test_should_add_plugin_load_paths_to_Dependencies_load_once_paths diff --git a/railties/test/plugin_test_helper.rb b/railties/test/plugin_test_helper.rb index 93d50dc07f..55d1a1fa96 100644 --- a/railties/test/plugin_test_helper.rb +++ b/railties/test/plugin_test_helper.rb @@ -12,7 +12,7 @@ RAILS_ROOT = '.' unless defined?(RAILS_ROOT) class Test::Unit::TestCase private def plugin_fixture_root_path - File.join(File.dirname(__FILE__), 'fixtures', 'plugins') + File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'plugins')) end def only_load_the_following_plugins!(plugins) -- cgit v1.2.3 From b825bef74cdde2a29ee050a5ddf4034633abcfe0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 28 Apr 2009 17:58:51 -0700 Subject: Fix missing core extension dependencies --- railties/lib/commands/server.rb | 1 - railties/lib/console_app.rb | 2 ++ railties/lib/rails/plugin.rb | 1 + railties/lib/tasks/misc.rake | 6 +++++- railties/test/abstract_unit.rb | 1 + railties/test/plugin_test_helper.rb | 1 + 6 files changed, 10 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index ebe34a42cd..91ac7752ef 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -1,4 +1,3 @@ -require 'active_support' require 'action_controller' require 'fileutils' diff --git a/railties/lib/console_app.rb b/railties/lib/console_app.rb index d7d01d703f..5c8302634a 100644 --- a/railties/lib/console_app.rb +++ b/railties/lib/console_app.rb @@ -1,3 +1,5 @@ +require 'active_support' +require 'active_support/core/all' require 'active_support/test_case' require 'action_controller' diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 63864058ee..bc28bec57e 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -1,3 +1,4 @@ +require 'active_support' require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/symbol' require 'active_support/dependencies' diff --git a/railties/lib/tasks/misc.rake b/railties/lib/tasks/misc.rake index 9e6f96db5b..a2c338aa5b 100644 --- a/railties/lib/tasks/misc.rake +++ b/railties/lib/tasks/misc.rake @@ -12,10 +12,10 @@ end desc 'Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions.' task :secret do + require 'active_support/secure_random' puts ActiveSupport::SecureRandom.hex(64) end -require 'active_support' namespace :time do namespace :zones do desc 'Displays names of all time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6' @@ -30,6 +30,8 @@ namespace :time do desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time' task :local do + require 'active_support' + require 'active_support/core/time' jan_offset = Time.now.beginning_of_year.utc_offset jul_offset = Time.now.beginning_of_year.change(:month => 7).utc_offset offset = jan_offset < jul_offset ? jan_offset : jul_offset @@ -38,6 +40,8 @@ namespace :time do # to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600 def build_time_zone_list(method, offset = ENV['OFFSET']) + require 'active_support' + require 'active_support/core/time' if offset offset = if offset.to_s.match(/(\+|-)?(\d+):(\d+)/) sign = $1 == '-' ? -1 : 1 diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 0addcb8bf3..ffd60ee662 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -13,6 +13,7 @@ gem 'mocha', '>= 0.9.5' require 'mocha' require 'active_support' +require 'active_support/core/all' require 'active_support/test_case' if defined?(RAILS_ROOT) diff --git a/railties/test/plugin_test_helper.rb b/railties/test/plugin_test_helper.rb index 55d1a1fa96..adb62de665 100644 --- a/railties/test/plugin_test_helper.rb +++ b/railties/test/plugin_test_helper.rb @@ -3,6 +3,7 @@ $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" require 'test/unit' require 'active_support' +require 'active_support/core/all' require 'initializer' require File.join(File.dirname(__FILE__), 'abstract_unit') -- cgit v1.2.3 From acd5db300b755d5abae2748f239441fb865c6b62 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 28 Apr 2009 18:21:03 -0700 Subject: Rejig active support dependencies to behave better with the boot process --- railties/lib/initializer.rb | 10 +++++++--- railties/lib/rails/backtrace_cleaner.rb | 3 +++ railties/lib/rails/plugin.rb | 5 ----- railties/test/boot_test.rb | 1 + railties/test/gem_dependency_test.rb | 1 + 5 files changed, 12 insertions(+), 8 deletions(-) (limited to 'railties') diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index b3b409dc4d..1bd7baed62 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -5,12 +5,9 @@ require 'pathname' $LOAD_PATH.unshift File.dirname(__FILE__) require 'railties_path' require 'rails/version' -require 'rails/plugin/locator' -require 'rails/plugin/loader' require 'rails/gem_dependency' require 'rails/rack' - RAILS_ENV = (ENV['RAILS_ENV'] || 'development').dup unless defined?(RAILS_ENV) module Rails @@ -244,6 +241,7 @@ module Rails # Set the paths from which Rails will automatically load source files, and # the load_once paths. def set_autoload_paths + require 'active_support/dependencies' ActiveSupport::Dependencies.load_paths = configuration.load_paths.uniq ActiveSupport::Dependencies.load_once_paths = configuration.load_once_paths.uniq @@ -263,6 +261,8 @@ module Rails # list. By default, all frameworks (Active Record, Active Support, # Action Pack, Action Mailer, and Active Resource) are loaded. def require_frameworks + require 'active_support' + require 'active_support/core/all' configuration.frameworks.each { |framework| require(framework.to_s) } rescue LoadError => e # Re-raise as RuntimeError because Mongrel would swallow LoadError. @@ -289,10 +289,12 @@ module Rails # Adds all load paths from plugins to the global set of load paths, so that # code from plugins can be required (explicitly or automatically via ActiveSupport::Dependencies). def add_plugin_load_paths + require 'active_support/dependencies' plugin_loader.add_plugin_load_paths end def add_gem_load_paths + require 'rails/gem_dependency' Rails::GemDependency.add_frozen_gem_path unless @configuration.gems.empty? require "rubygems" @@ -1037,12 +1039,14 @@ Run `rake gems:install` to install the missing gems. end def default_plugin_locators + require 'rails/plugin/locator' locators = [] locators << Plugin::GemLocator if defined? Gem locators << Plugin::FileSystemLocator end def default_plugin_loader + require 'rails/plugin/loader' Plugin::Loader end diff --git a/railties/lib/rails/backtrace_cleaner.rb b/railties/lib/rails/backtrace_cleaner.rb index 923ed8b31d..1605429e8b 100644 --- a/railties/lib/rails/backtrace_cleaner.rb +++ b/railties/lib/rails/backtrace_cleaner.rb @@ -1,3 +1,6 @@ +require 'active_support/backtrace_cleaner' +require 'rails/gem_dependency' + module Rails class BacktraceCleaner < ActiveSupport::BacktraceCleaner ERB_METHOD_SIG = /:in `_run_erb_.*/ diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index bc28bec57e..0f924724cd 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -1,8 +1,3 @@ -require 'active_support' -require 'active_support/core_ext/kernel/reporting' -require 'active_support/core_ext/symbol' -require 'active_support/dependencies' - module Rails # The Plugin class should be an object which provides the following methods: # diff --git a/railties/test/boot_test.rb b/railties/test/boot_test.rb index 08fcc82e6f..2dd68857c3 100644 --- a/railties/test/boot_test.rb +++ b/railties/test/boot_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' require 'initializer' require "#{File.dirname(__FILE__)}/../environments/boot" +require 'rails/gem_dependency' class BootTest < Test::Unit::TestCase def test_boot_returns_if_booted diff --git a/railties/test/gem_dependency_test.rb b/railties/test/gem_dependency_test.rb index d9cd5148a3..da7bda9bee 100644 --- a/railties/test/gem_dependency_test.rb +++ b/railties/test/gem_dependency_test.rb @@ -1,4 +1,5 @@ require 'plugin_test_helper' +require 'rails/gem_dependency' class Rails::GemDependency public :install_command, :unpack_command -- cgit v1.2.3 From 599f2cfb4a0e0ec4135265bf5c56b83f1450beea Mon Sep 17 00:00:00 2001 From: David Dollar Date: Wed, 29 Apr 2009 01:22:54 -0400 Subject: Attempt to deal with more cases of gems with native components. This commit adds a rudimentary check for 'unbuilt' gems, so that we can abort the application load if there are any gems that have native components that have not yet been built. The rake task gems:build has now only builds 'unbuilt' gems as a result. The rake task gems:build:force has been added to deal with cases of incomplete builds, or any case where you need to force the build of all of your gems. Changes the gems:build task to get its gem list by parsing directory entries in vendor/gems, which sidesteps the chicken/egg issues involved with having a gem unpacked into vendor/gems without before its native bits are compiled. [#2266 state:committed] Signed-off-by: Jeremy Kemper --- railties/lib/initializer.rb | 21 +++++++++++ railties/lib/rails/gem_dependency.rb | 21 ++++++++--- railties/lib/tasks/gems.rake | 18 ++++++++-- railties/test/gem_dependency_test.rb | 21 +++++++++++ .../vendor/gems/dummy-gem-i-1.0.0/.specification | 41 ++++++++++++++++++++++ .../dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile | 0 .../gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb | 1 + .../vendor/gems/dummy-gem-j-1.0.0/.specification | 41 ++++++++++++++++++++++ .../gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb | 1 + 9 files changed, 159 insertions(+), 6 deletions(-) create mode 100644 railties/test/vendor/gems/dummy-gem-i-1.0.0/.specification create mode 100644 railties/test/vendor/gems/dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile create mode 100644 railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb create mode 100644 railties/test/vendor/gems/dummy-gem-j-1.0.0/.specification create mode 100644 railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb (limited to 'railties') diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 1bd7baed62..71366a4480 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -156,6 +156,8 @@ module Rails add_support_load_paths + check_for_unbuilt_gems + load_gems load_plugins @@ -308,6 +310,25 @@ module Rails end end + def check_for_unbuilt_gems + unbuilt_gems = @configuration.gems.select(&:frozen?).reject(&:built?) + if unbuilt_gems.size > 0 + # don't print if the gems:build rake tasks are being run + unless $gems_build_rake_task + abort <<-end_error +The following gems have native components that need to be built + #{unbuilt_gems.map { |gem| "#{gem.name} #{gem.requirement}" } * "\n "} + +You're running: + ruby #{Gem.ruby_version} at #{Gem.ruby} + rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '} + +Run `rake gems:build` to build the unbuilt gems. + end_error + end + end + end + def check_gem_dependencies unloaded_gems = @configuration.gems.reject { |g| g.loaded? } if unloaded_gems.size > 0 diff --git a/railties/lib/rails/gem_dependency.rb b/railties/lib/rails/gem_dependency.rb index 3062a77104..ee3d0d81ba 100644 --- a/railties/lib/rails/gem_dependency.rb +++ b/railties/lib/rails/gem_dependency.rb @@ -29,6 +29,15 @@ module Rails end end + def self.from_directory_name(directory_name) + directory_name_parts = File.basename(directory_name).split('-') + name = directory_name_parts[0..-2].join('-') + version = directory_name_parts.last + self.new(name, :version => version) + rescue ArgumentError => e + raise "Unable to determine gem name and version from '#{directory_name}'" + end + def initialize(name, options = {}) require 'rubygems' unless Object.const_defined?(:Gem) @@ -101,8 +110,12 @@ module Rails end def built? - # TODO: If Rubygems ever gives us a way to detect this, we should use it - false + return false unless frozen? + specification.extensions.each do |ext| + makefile = File.join(unpacked_gem_directory, File.dirname(ext), 'Makefile') + return false unless File.exists?(makefile) + end + true end def framework_gem? @@ -155,9 +168,9 @@ module Rails specification && File.exists?(unpacked_gem_directory) end - def build + def build(options={}) require 'rails/gem_builder' - unless built? + if options[:force] || !built? return unless File.exists?(unpacked_specification_filename) spec = YAML::load_file(unpacked_specification_filename) Rails::GemBuilder.new(spec, unpacked_gem_directory).build_extensions diff --git a/railties/lib/tasks/gems.rake b/railties/lib/tasks/gems.rake index ed07bf2016..efadb1da3b 100644 --- a/railties/lib/tasks/gems.rake +++ b/railties/lib/tasks/gems.rake @@ -20,8 +20,16 @@ namespace :gems do desc "Build any native extensions for unpacked gems" task :build do $gems_build_rake_task = true - Rake::Task['gems:unpack'].invoke - current_gems.each &:build + frozen_gems.each &:build + end + + namespace :build do + desc "Force the build of all gems" + task :force do + $gems_build_rake_task = true + Rake::Task['gems:unpack'].invoke + current_gems.each { |gem| gem.build(:force => true) } + end end desc "Installs all required gems." @@ -53,6 +61,12 @@ def current_gems gems end +def frozen_gems + Dir[File.join(RAILS_ROOT, 'vendor', 'gems', '*-*')].map do |gem_dir| + Rails::GemDependency.from_directory_name(gem_dir) + end +end + def print_gem_status(gem, indent=1) code = case when gem.framework_gem? then 'R' diff --git a/railties/test/gem_dependency_test.rb b/railties/test/gem_dependency_test.rb index da7bda9bee..4ff4fe8d43 100644 --- a/railties/test/gem_dependency_test.rb +++ b/railties/test/gem_dependency_test.rb @@ -145,4 +145,25 @@ class GemDependencyTest < Test::Unit::TestCase end end + def test_gem_from_directory_name + dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem-1.1') + assert_equal 'dummy-gem', dummy_gem.name + assert_equal '= 1.1', dummy_gem.version_requirements.to_s + end + + def test_gem_from_invalid_directory_name + assert_raises RuntimeError do + dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem') + end + assert_raises RuntimeError do + dummy_gem = Rails::GemDependency.from_directory_name('dummy') + end + end + + def test_gem_determines_build_status + assert_equal true, Rails::GemDependency.new("dummy-gem-a").built? + assert_equal true, Rails::GemDependency.new("dummy-gem-i").built? + assert_equal false, Rails::GemDependency.new("dummy-gem-j").built? + end + end diff --git a/railties/test/vendor/gems/dummy-gem-i-1.0.0/.specification b/railties/test/vendor/gems/dummy-gem-i-1.0.0/.specification new file mode 100644 index 0000000000..50b4969da5 --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-i-1.0.0/.specification @@ -0,0 +1,41 @@ +--- !ruby/object:Gem::Specification +name: dummy-gem-i +version: !ruby/object:Gem::Version + version: 1.3.0 +platform: ruby +authors: +- "Nobody" +date: 2008-10-03 00:00:00 -04:00 +dependencies: +- !ruby/object:Gem::Dependency + name: dummy-gem-i + type: :runtime + version_requirement: + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: 1.0.0 + version: +extensions: +- ext/dummy-gem-i/extconf.rb +files: +- lib +- lib/dummy-gem-i.rb +require_paths: +- lib +required_ruby_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +required_rubygems_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +requirements: [] +specification_version: 2 +summary: Dummy Gem G diff --git a/railties/test/vendor/gems/dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile b/railties/test/vendor/gems/dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb b/railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb new file mode 100644 index 0000000000..2f9a376c2c --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb @@ -0,0 +1 @@ +DUMMY_GEM_I_VERSION="1.0.0" diff --git a/railties/test/vendor/gems/dummy-gem-j-1.0.0/.specification b/railties/test/vendor/gems/dummy-gem-j-1.0.0/.specification new file mode 100644 index 0000000000..2c456546fc --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-j-1.0.0/.specification @@ -0,0 +1,41 @@ +--- !ruby/object:Gem::Specification +name: dummy-gem-j +version: !ruby/object:Gem::Version + version: 1.3.0 +platform: ruby +authors: +- "Nobody" +date: 2008-10-03 00:00:00 -04:00 +dependencies: +- !ruby/object:Gem::Dependency + name: dummy-gem-j + type: :runtime + version_requirement: + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: 1.0.0 + version: +extensions: +- ext/dummy-gem-j/extconf.rb +files: +- lib +- lib/dummy-gem-j.rb +require_paths: +- lib +required_ruby_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +required_rubygems_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +requirements: [] +specification_version: 2 +summary: Dummy Gem G diff --git a/railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb b/railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb new file mode 100644 index 0000000000..8ecd363ff8 --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb @@ -0,0 +1 @@ +DUMMY_GEM_J_VERSION="1.0.0" -- cgit v1.2.3 From 7149ddd2a109345f8c48c787b5541b9b31a8a6fa Mon Sep 17 00:00:00 2001 From: David Dollar Date: Wed, 29 Apr 2009 10:04:17 -0400 Subject: Additional tests for the gem subsystem * test_gem_ignores_development_dependencies * test_gem_guards_against_duplicate_unpacks * test_gem_does_not_unpack_framework_gems [#2236 state:committed] Signed-off-by: Jeremy Kemper --- railties/test/gem_dependency_test.rb | 21 ++++++++++ .../vendor/gems/dummy-gem-h-1.0.0/.specification | 29 +++++++++++++ .../gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb | 1 + .../vendor/gems/dummy-gem-k-1.0.0/.specification | 49 ++++++++++++++++++++++ .../gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb | 1 + 5 files changed, 101 insertions(+) create mode 100644 railties/test/vendor/gems/dummy-gem-h-1.0.0/.specification create mode 100644 railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb create mode 100644 railties/test/vendor/gems/dummy-gem-k-1.0.0/.specification create mode 100644 railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb (limited to 'railties') diff --git a/railties/test/gem_dependency_test.rb b/railties/test/gem_dependency_test.rb index 4ff4fe8d43..ff27af5572 100644 --- a/railties/test/gem_dependency_test.rb +++ b/railties/test/gem_dependency_test.rb @@ -145,6 +145,27 @@ class GemDependencyTest < Test::Unit::TestCase end end + def test_gem_ignores_development_dependencies + dummy_gem = Rails::GemDependency.new "dummy-gem-k" + dummy_gem.add_load_paths + dummy_gem.load + assert_equal 1, dummy_gem.dependencies.size + end + + def test_gem_guards_against_duplicate_unpacks + dummy_gem = Rails::GemDependency.new "dummy-gem-a" + dummy_gem.stubs(:frozen?).returns(true) + dummy_gem.expects(:unpack_base).never + dummy_gem.unpack + end + + def test_gem_does_not_unpack_framework_gems + dummy_gem = Rails::GemDependency.new "dummy-gem-a" + dummy_gem.stubs(:framework_gem?).returns(true) + dummy_gem.expects(:unpack_base).never + dummy_gem.unpack + end + def test_gem_from_directory_name dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem-1.1') assert_equal 'dummy-gem', dummy_gem.name diff --git a/railties/test/vendor/gems/dummy-gem-h-1.0.0/.specification b/railties/test/vendor/gems/dummy-gem-h-1.0.0/.specification new file mode 100644 index 0000000000..b3f7930948 --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-h-1.0.0/.specification @@ -0,0 +1,29 @@ +--- !ruby/object:Gem::Specification +name: dummy-gem-h +version: !ruby/object:Gem::Version + version: 1.3.0 +platform: ruby +authors: +- "Nobody" +date: 2008-10-03 00:00:00 -04:00 +dependencies: +files: +- lib +- lib/dummy-gem-h.rb +require_paths: +- lib +required_ruby_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +required_rubygems_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +requirements: [] +specification_version: 2 +summary: Dummy Gem H diff --git a/railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb b/railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb new file mode 100644 index 0000000000..0f91234936 --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb @@ -0,0 +1 @@ +DUMMY_GEM_H_VERSION="1.0.0" diff --git a/railties/test/vendor/gems/dummy-gem-k-1.0.0/.specification b/railties/test/vendor/gems/dummy-gem-k-1.0.0/.specification new file mode 100644 index 0000000000..20edd0f856 --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-k-1.0.0/.specification @@ -0,0 +1,49 @@ +--- !ruby/object:Gem::Specification +name: dummy-gem-k +version: !ruby/object:Gem::Version + version: 1.3.0 +platform: ruby +authors: +- "Nobody" +date: 2008-10-03 00:00:00 -04:00 +dependencies: +- !ruby/object:Gem::Dependency + name: dummy-gem-k + type: :runtime + version_requirement: + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: 1.0.0 + version: +- !ruby/object:Gem::Dependency + name: dummy-gem-h + type: :development + version_requirement: + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: 1.0.0 + version: +files: +- lib +- lib/dummy-gem-k.rb +require_paths: +- lib +required_ruby_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +required_rubygems_version: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: "0" + version: +requirements: [] +specification_version: 2 +summary: Dummy Gem I diff --git a/railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb b/railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb new file mode 100644 index 0000000000..97fb1d69ce --- /dev/null +++ b/railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb @@ -0,0 +1 @@ +DUMMY_GEM_K_VERSION="1.0.0" -- cgit v1.2.3