Sha256: eaa171b10f2d555876fa562d5f8e161598c7cf2be94badcac532b6ea9d174fb2

Contents?: true

Size: 559 Bytes

Versions: 5

Compression:

Stored size: 559 Bytes

Contents

module Rda
  module Rails
    def self.app_name
      @app_name ||= begin
                      IO.foreach(File.join(Dir.pwd, 'config.ru')) do |l|
                        if l =~ /run\s+(.*)::Application/
                          return $1.underscore.dasherize
                        end
                      end
                    rescue
                    end

      unless @app_name
        $stderr.puts "ERROR: You should run rda under rails applications"
        exit
      end
    end

    def self.root
      Dir.pwd if app_name
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rda-0.4.1 lib/rda/rails.rb
rda-0.4.0 lib/rda/rails.rb
rda-0.4.0.pre lib/rda/rails.rb
rda-0.3.3 lib/rda/rails.rb
rda-0.3.2 lib/rda/rails.rb