Class: Serum::Rails::App
- Inherits:
-
Object
- Object
- Serum::Rails::App
- Defined in:
- lib/serum/rails/app.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #count_gems ⇒ Object
- #count_routes ⇒ Object
-
#initialize(root) ⇒ App
constructor
A new instance of App.
-
#lines_of_code ⇒ Object
def gems cd bundle list | wc -l end.
Constructor Details
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
5 6 7 |
# File 'lib/serum/rails/app.rb', line 5 def root @root end |
Instance Method Details
#count_gems ⇒ Object
30 31 32 33 34 |
# File 'lib/serum/rails/app.rb', line 30 def count_gems Dir.chdir(@root) do run_command('bundle list').split(/\n/).size - 1 end end |
#count_routes ⇒ Object
24 25 26 27 28 |
# File 'lib/serum/rails/app.rb', line 24 def count_routes Dir.chdir(@root) do run_command('bundle exec rake routes').split(/\n/).size - 1 end end |
#lines_of_code ⇒ Object
def gems
cd
bundle list | wc -l
end
18 19 20 |
# File 'lib/serum/rails/app.rb', line 18 def lines_of_code count_lines # matches anything in all folders end |