Module: NextRails

Defined in:
lib/next_rails.rb,
lib/next_rails/init.rb,
lib/next_rails/tint.rb,
lib/next_rails/version.rb,
lib/next_rails/gem_info.rb,
lib/next_rails/bundle_report.rb

Defined Under Namespace

Modules: BundleReport Classes: GemInfo, Init, Tint

Constant Summary collapse

VERSION =
"1.7.0"
@@next_bundle_gemfile =
nil

Class Method Summary collapse

Class Method Details

.current?Boolean

This method is the inverse of NextRails.next?. It returns true when your application is running with the current set of dependencies.

Returns:

  • (Boolean)


30
31
32
# File 'lib/next_rails.rb', line 30

def self.current?
  !next?
end

.next?Boolean

This method will check your environment (e.g. ENV['BUNDLE_GEMFILE]) to determine whether your application is running with the next set of dependencies or the current set of dependencies.

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/next_rails.rb', line 20

def self.next?
  return @@next_bundle_gemfile unless @@next_bundle_gemfile.nil?

  @@next_bundle_gemfile = File.exist?(ENV["BUNDLE_GEMFILE"]) && File.basename(ENV["BUNDLE_GEMFILE"]) == "Gemfile.next"
end

.reset_next_bundle_gemfileObject

This method will reset the @@next_bundle_gemfile variable. Then next time you call NextRails.next? it will check the environment once again.



36
37
38
# File 'lib/next_rails.rb', line 36

def self.reset_next_bundle_gemfile
  @@next_bundle_gemfile = nil
end

.Tint(string) ⇒ Object



45
46
47
# File 'lib/next_rails/tint.rb', line 45

def self.Tint(string)
  Tint.new(string)
end