Module: GovukPublishingComponents::Config
- Defined in:
- lib/govuk_publishing_components/config.rb
Constant Summary collapse
- APP_COMPONENT_DIRECTORY =
"components".freeze
Class Method Summary collapse
- .all_stylesheets ⇒ Object
- .component_directory_name ⇒ Object
- .component_guide_stylesheet ⇒ Object
- .gem_directory ⇒ Object
Class Method Details
.all_stylesheets ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/govuk_publishing_components/config.rb', line 42 def self.all_stylesheets stylesheets = Dir.glob("#{gem_directory}/app/assets/stylesheets/govuk_publishing_components/components/*.scss") application_stylesheet_hash = component_guide_stylesheet stylesheets.each_with_object(application_stylesheet_hash) do |path, hsh| hsh[path] = "govuk_publishing_components/components/#{File.basename(path, '.*')}.css" end end |
.component_directory_name ⇒ Object
30 31 32 |
# File 'lib/govuk_publishing_components/config.rb', line 30 def self.component_directory_name APP_COMPONENT_DIRECTORY end |
.component_guide_stylesheet ⇒ Object
38 39 40 |
# File 'lib/govuk_publishing_components/config.rb', line 38 def self.component_guide_stylesheet { "#{gem_directory}/app/assets/stylesheets/component_guide/application.scss" => "component_guide/application.css" } end |
.gem_directory ⇒ Object
34 35 36 |
# File 'lib/govuk_publishing_components/config.rb', line 34 def self.gem_directory Gem::Specification.find_by_name("govuk_publishing_components").gem_dir end |