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.3.0"
@@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)


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

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.



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

def self.reset_next_bundle_gemfile
  @@next_bundle_gemfile = nil
end