Module: Polyfillrb
- Defined in:
- lib/polyfillrb.rb,
lib/polyfillrb/version.rb,
lib/polyfillrb/rails/railtie.rb,
lib/polyfillrb/rails/view_helper.rb
Defined Under Namespace
Modules: Rails
Constant Summary collapse
- PROJECT_DIRECTORY =
File.(File.dirname(__FILE__))
- VERSION =
'1.1.1'
Class Method Summary collapse
-
.get_polyfills(ua, minify = false) ⇒ Object
Method to get the polyfills.
-
.has_built_sources? ⇒ Boolean
Detects if the service has installed it’s dependencies.
-
.has_installed_service? ⇒ Boolean
Detects if the service has been downloaded from git yet.
Class Method Details
.get_polyfills(ua, minify = false) ⇒ Object
Method to get the polyfills
Params
ua -> User Agent String
minify -> Boolean if code should be minified or not
returns String
15 16 17 |
# File 'lib/polyfillrb.rb', line 15 def self.get_polyfills(ua, minify=false) return %x( node #{PROJECT_DIRECTORY}/polyfill.js -p "#{ua}" #{minify}) end |
.has_built_sources? ⇒ Boolean
Detects if the service has installed it’s dependencies
26 27 28 |
# File 'lib/polyfillrb.rb', line 26 def self.has_built_sources? Dir.exist?(PROJECT_DIRECTORY+'/polyfill-service/node_modules/') end |
.has_installed_service? ⇒ Boolean
Detects if the service has been downloaded from git yet
21 22 23 |
# File 'lib/polyfillrb.rb', line 21 def self.has_installed_service? Dir.exist?(PROJECT_DIRECTORY+'/polyfill-service/') end |