Class: React::Rails::AssetVariant
- Inherits:
-
Object
- Object
- React::Rails::AssetVariant
- Defined in:
- lib/react/rails/asset_variant.rb
Constant Summary collapse
- GEM_ROOT =
Pathname.new('../../../../').(__FILE__)
Instance Attribute Summary collapse
-
#jsx_directory ⇒ Object
readonly
Returns the value of attribute jsx_directory.
-
#react_build ⇒ Object
readonly
Returns the value of attribute react_build.
-
#react_directory ⇒ Object
readonly
Returns the value of attribute react_directory.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AssetVariant
constructor
A new instance of AssetVariant.
Constructor Details
#initialize(options = {}) ⇒ AssetVariant
Returns a new instance of AssetVariant.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/react/rails/asset_variant.rb', line 7 def initialize(={}) # We want to include different files in dev/prod. The development builds # contain console logging for invariants and logging to help catch # common mistakes. These are all stripped out in the production build. @react_build = [:variant] == :production ? 'production' : 'development' [:addons] && @react_build += '-with-addons' @react_directory = GEM_ROOT.join('lib/assets/react-source/').join(@react_build).to_s @jsx_directory = GEM_ROOT.join('lib/assets/javascripts/').to_s end |
Instance Attribute Details
#jsx_directory ⇒ Object (readonly)
Returns the value of attribute jsx_directory.
5 6 7 |
# File 'lib/react/rails/asset_variant.rb', line 5 def jsx_directory @jsx_directory end |
#react_build ⇒ Object (readonly)
Returns the value of attribute react_build.
5 6 7 |
# File 'lib/react/rails/asset_variant.rb', line 5 def react_build @react_build end |
#react_directory ⇒ Object (readonly)
Returns the value of attribute react_directory.
5 6 7 |
# File 'lib/react/rails/asset_variant.rb', line 5 def react_directory @react_directory end |