Sha256: 8618594d16b2a2630842112de1879c1e8b0f92946da139833bb5d625d8f800cb

Contents?: true

Size: 342 Bytes

Versions: 9

Compression:

Stored size: 342 Bytes

Contents

# Detects the current version of Rails that is being used
#
# You can pass it in as an ENV variable or it will use
# the current Gemfile.lock to find it
def detect_rails_version
  return nil unless (File.exists?("Gemfile.lock") || File.symlink?("Gemfile.lock"))

  File.read("Gemfile.lock").match(/^\W*rails \(([a-z\d.]*)\)/)
  return $1
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
andrewroth_activeadmin-0.3.4.3 spec/support/detect_rails_version.rb
andrewroth_activeadmin-0.3.4.2 spec/support/detect_rails_version.rb
andrewroth_activeadmin-0.3.4.1 spec/support/detect_rails_version.rb
andrewroth_activeadmin-0.3.4 spec/support/detect_rails_version.rb
activeadmin-0.3.4 spec/support/detect_rails_version.rb
activeadmin-0.3.3 spec/support/detect_rails_version.rb
activeadmin-0.3.2 spec/support/detect_rails_version.rb
activeadmin-0.3.1 spec/support/detect_rails_version.rb
activeadmin-0.3.0 spec/support/detect_rails_version.rb