Sha256: fd0fa6e4269a9a2a6e9bbe4e458277b25209601058d2701161af8714f1f2247d

Contents?: true

Size: 546 Bytes

Versions: 17

Compression:

Stored size: 546 Bytes

Contents

module JsTestCore
  module Representations
    class Dir < Page
      needs :relative_path, :absolute_path
      protected
      def body_content
        ul do
          ::Dir.glob("#{absolute_path}/*").inject("") do |html, file|
            li do
              a(
                ::File.basename(file),
                :href => "#{relative_path}/#{::File.basename(file)}".gsub("//", "/")
              )
            end
          end
        end
      end

      def title_text
        "Contents of #{relative_path}"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
pivotal-screw-unit-0.5.0 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-0.5.1 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-0.5.2 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-0.5.3 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.10 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.11 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.12 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.3 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.4 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.5 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.6 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.7 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.8 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
pivotal-screw-unit-server-0.5.9 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
screw-unit-0.5.1 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
screw-unit-0.5.2 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb
screw-unit-server-0.5.3 vendor/js-test-core/lib/js_test_core/representations/dir.html.rb