Module: ReactManifest
- Defined in:
- lib/react_manifest.rb,
lib/react_manifest/railtie.rb,
lib/react_manifest/scanner.rb,
lib/react_manifest/version.rb,
lib/react_manifest/watcher.rb,
lib/react_manifest/reporter.rb,
lib/react_manifest/generator.rb,
lib/react_manifest/view_helpers.rb,
lib/react_manifest/configuration.rb,
lib/react_manifest/dependency_map.rb,
lib/react_manifest/tree_classifier.rb,
lib/react_manifest/application_analyzer.rb,
lib/react_manifest/application_migrator.rb
Defined Under Namespace
Modules: ViewHelpers, Watcher
Classes: ApplicationAnalyzer, ApplicationMigrator, Configuration, DependencyMap, Generator, Railtie, Reporter, Scanner, TreeClassifier
Constant Summary
collapse
- VERSION =
"0.2.2".freeze
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
17
18
19
|
# File 'lib/react_manifest.rb', line 17
def configuration
@configuration ||= Configuration.new
end
|
21
22
23
|
# File 'lib/react_manifest.rb', line 21
def configure
yield configuration
end
|
.reset! ⇒ Object
25
26
27
|
# File 'lib/react_manifest.rb', line 25
def reset!
@configuration = nil
end
|
.resolve_bundles(ctrl_name) ⇒ Object
Returns the ordered list of bundle logical names for a given controller. Used by the react_bundle_tag view helper.
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/react_manifest.rb', line 31
def resolve_bundles(ctrl_name)
config = configuration
output = config.abs_output_dir
bundles = []
bundles << config.shared_bundle if bundle_exists?(output, config.shared_bundle)
config.always_include.each do |b|
bundles << b if bundle_exists?(output, b) && !bundles.include?(b)
end
controller_candidates(ctrl_name).each do |candidate|
if bundle_exists?(output, candidate) && !bundles.include?(candidate)
bundles << candidate
break
end
end
bundles
end
|