diff --git a/README.md b/README.md index d5d7849..67513e3 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,6 @@ gem "rbexy" _From 1.0 onward, we only support Rails 6. If you're using Rails 5, use the 0.x releases._ -In `config/application.rb`: - -```ruby -require "rbexy/rails/engine" -``` - _Not using Rails? See "Usage outside of Rails" below._ Create your first component at `app/components/hello_world_component.rb`: diff --git a/lib/rbexy.rb b/lib/rbexy.rb index 2889527..80ccb60 100644 --- a/lib/rbexy.rb +++ b/lib/rbexy.rb @@ -2,10 +2,9 @@ require "active_support/inflector" require "active_support/concern" require "active_support/core_ext/enumerable" -require "action_view/helpers/output_safety_helper" -require "action_view/helpers/capture_helper" -require "action_view/helpers/tag_helper" -require "action_view/context" +require "action_view" + +require "rbexy/rails/engine" if defined?(::Rails) module Rbexy autoload :Lexer, "rbexy/lexer" diff --git a/lib/rbexy/component.rb b/lib/rbexy/component.rb index cffefb3..c22ccd5 100644 --- a/lib/rbexy/component.rb +++ b/lib/rbexy/component.rb @@ -1,4 +1,3 @@ -require "action_view" require "active_support/core_ext/class/attribute" module Rbexy diff --git a/spec/rbexy_spec.rb b/spec/rbexy_spec.rb index 4983dff..38bd6d9 100644 --- a/spec/rbexy_spec.rb +++ b/spec/rbexy_spec.rb @@ -1,8 +1,6 @@ require "active_support/core_ext/string/strip" require "active_support/all" -require "action_view/helpers" -require "action_view/context" -require "action_view/buffers" +require "action_view" RSpec.describe Rbexy do it "has a version number" do