Class: RailsFinder::App

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_finder/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ App

Returns a new instance of App.



9
10
11
# File 'lib/rails_finder/app.rb', line 9

def initialize(root)
  @root = root
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



7
8
9
# File 'lib/rails_finder/app.rb', line 7

def root
  @root
end

Instance Method Details

#basenameObject



13
14
15
# File 'lib/rails_finder/app.rb', line 13

def basename
  File.basename(root)
end

#rails_versionObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rails_finder/app.rb', line 17

def rails_version
  if gemfile.exists?
    gemfile.rails_version
  elsif isofile.exists?
    isofile.rails_version
  elsif envfile.exists?
    envfile.rails_version
  else
    "n/a"
  end
end