Sha256: dff63f3f248a3bb363529aacbffe17c80751e51c44a7adef29c7c8820c720002

Contents?: true

Size: 883 Bytes

Versions: 14

Compression:

Stored size: 883 Bytes

Contents

module AliadaWebappRails
  class Assets
    def self.webapp_js_file
      @js_filename ||= parse_js_asset_route
    end

    def self.webapp_css_file
      @css_filename ||= parse_css_asset_route
    end

    class << self
      private

      def parse_js_asset_route
        js_file = gem_files.select { |file| webapp_js_file?(file) }.first
        js_file.gsub(/^public/, "")
      end

      def parse_css_asset_route
        css_file = gem_files.select { |file| webapp_css_file?(file) }.first
        css_file.gsub(/^public/, "")
      end

      def gem_files
        Gem::Specification.find_by_name("aliada_webapp_rails").files
      end

      def webapp_js_file?(file)
        file[/public\/aliada_webapp_rails\/assets\/app\..*\.js$/]
      end

      def webapp_css_file?(file)
        file[/public\/aliada_webapp_rails\/assets\/app\..*\.css$/]
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
aliada_webapp_rails-1.0.0 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.16 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.15 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.14 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.13 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.12 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.11 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.10 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.8 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.7 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.6 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.5 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.4 config/initializers/aliada_webapp_rails.rb
aliada_webapp_rails-0.0.3 config/initializers/aliada_webapp_rails.rb