aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template/sources
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-04-04 12:45:30 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-04-04 15:07:14 -0700
commitdb1830a7ec5765909fadb80a8725e52cc37ade07 (patch)
tree2f561972976919251121962d2d9af0cbd68921f6 /actionview/lib/action_view/template/sources
parentb8e6594181996807ea18d1209f8ee3dbd581554b (diff)
downloadrails-db1830a7ec5765909fadb80a8725e52cc37ade07.tar.gz
rails-db1830a7ec5765909fadb80a8725e52cc37ade07.tar.bz2
rails-db1830a7ec5765909fadb80a8725e52cc37ade07.zip
Add ActionView::Template::Sources::File
Diffstat (limited to 'actionview/lib/action_view/template/sources')
-rw-r--r--actionview/lib/action_view/template/sources/file.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionview/lib/action_view/template/sources/file.rb b/actionview/lib/action_view/template/sources/file.rb
new file mode 100644
index 0000000000..2d3a7dec7f
--- /dev/null
+++ b/actionview/lib/action_view/template/sources/file.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module ActionView
+ class Template
+ module Sources
+ class File
+ def initialize(filename)
+ @filename = filename
+ end
+
+ def to_s
+ ::File.binread @filename
+ end
+ end
+ end
+ end
+end