Sha256: 4482dee74dc65a5e77a8f20d9afae64b5521523230bb12ac8d6ce110cc699592

Contents?: true

Size: 751 Bytes

Versions: 6

Compression:

Stored size: 751 Bytes

Contents

module RailsAssist::Directory
  module Root
    module Methods
      def root_directories
        [:app, :config, :db, :public, :lib, :log, :doc, :test, :spec]      
      end

      def root_dirpath options={}
        raise ArgumentError, "options argument to root_dir must be a hash, was: #{options.inspect}" if options && !options.kind_of?(Hash)
        dir = options[:root_path] if options 
        dir ||= RailsAssist::Directory.rails_root || Rails.root
        raise "You must set the Rails app root dir: RailsAssist::App.root_dir = '/my/root/dir'" if !dir
        dir.to_s.path
      end
      
      def root_dir options={}    
        root_dirpath(options).dir
      end      
    end    
    
    include Methods
    extend Methods
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_assist-0.5.2 lib/rails_assist/directory/root.rb
rails_assist-0.5.1 lib/rails_assist/directory/root.rb
rails_assist-0.5.0 lib/rails_assist/directory/root.rb
rails_assist-0.4.4 lib/rails_assist/directory/root.rb
rails_assist-0.4.3 lib/rails_assist/directory/root.rb
rails_assist-0.4.2 lib/rails_assist/directory/root.rb