Class: SourceFile
- Inherits:
-
Thor
- Object
- Thor
- SourceFile
- Includes:
- Thor::Actions
- Defined in:
- lib/modernizr-rails/source_file.rb
Instance Method Summary collapse
Instance Method Details
#fetch ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/modernizr-rails/source_file.rb', line 7 def fetch self.destination_root = 'vendor/assets' remote = 'http://modernizr.com/downloads/' get "#{remote}/modernizr-latest.js", 'javascripts/modernizr.js' inside destination_root do version = File.read('javascripts/modernizr.js').match(/version\s=\s'([\d|\.]+)'/)[1] gsub_file '../../lib/modernizr-rails/version.rb', /MODERNIZR_VERSION\s=\s'(\d|\.)+'$/ do |match| %Q{MODERNIZR_VERSION = '#{version}'} end end end |