Module: NextRails

Defined in:
lib/next_rails.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

Constant Summary collapse

VERSION =
"1.4.2"
@@next_bundle_gemfile =
nil

Class Method Summary collapse

Class Method Details

.next?Boolean

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

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/next_rails.rb', line 17

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.



25
26
27
# File 'lib/next_rails.rb', line 25

def self.reset_next_bundle_gemfile
  @@next_bundle_gemfile = nil
end