Class: SourceFile

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/select2-rails/source_file.rb

Instance Method Summary collapse

Instance Method Details

#cleanupObject



28
29
30
31
# File 'lib/select2-rails/source_file.rb', line 28

def cleanup
  self.destination_root = "vendor/assets"
  remove_file "stylesheets/select2.css"
end

#convertObject



17
18
19
20
21
22
23
24
25
# File 'lib/select2-rails/source_file.rb', line 17

def convert
  self.destination_root = "vendor/assets"
  inside destination_root do
    run("sass-convert -F css -T sass stylesheets/select2.css stylesheets/select2.css.sass")
    gsub_file 'stylesheets/select2.css.sass', '(spinner.gif)', "('spinner.gif')"      
    gsub_file 'stylesheets/select2.css.sass', '(select2.png)', "('select2.png')"
    gsub_file 'stylesheets/select2.css.sass', ' url', ' image-url'
  end
end

#fetchObject



7
8
9
10
11
12
13
14
# File 'lib/select2-rails/source_file.rb', line 7

def fetch
  self.destination_root = "vendor/assets"
  remote = "https://github.com/ivaynberg/select2"
  get "#{remote}/raw/master/select2.png", "images/select2.png"
  get "#{remote}/raw/master/spinner.gif", "images/spinner.gif"
  get "#{remote}/raw/master/select2.css", "stylesheets/select2.css"    
  get "#{remote}/raw/master/select2.js", "javascripts/select2.js"
end