Class: SourceFile
- Inherits:
-
Thor
- Object
- Thor
- SourceFile
- Includes:
- Thor::Actions
- Defined in:
- lib/select2-rails/source_file.rb
Instance Method Summary collapse
Instance Method Details
#cleanup ⇒ Object
35 36 37 38 |
# File 'lib/select2-rails/source_file.rb', line 35 def cleanup self.destination_root = "app/assets" remove_file "stylesheets/select2.css" end |
#convert ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/select2-rails/source_file.rb', line 24 def convert self.destination_root = "app/assets" inside destination_root do run("cp stylesheets/select2.css stylesheets/select2.css.scss") gsub_file 'stylesheets/select2.css.scss', '(select2-spinner.gif)', "('select2-spinner.gif')" gsub_file 'stylesheets/select2.css.scss', '(select2.png)', "('select2.png')" gsub_file 'stylesheets/select2.css.scss', ' url', ' image-url' end end |
#fetch ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/select2-rails/source_file.rb', line 9 def fetch = tag = select("Which tag do you want to fetch?", ) self.destination_root = "app/assets" remote = "https://github.com/ivaynberg/select2" get "#{remote}/raw/#{tag}/select2.png", "images/select2.png" get "#{remote}/raw/#{tag}/select2-spinner.gif", "images/select2-spinner.gif" get "#{remote}/raw/#{tag}/select2.css", "stylesheets/select2.css" get "#{remote}/raw/#{tag}/select2.js", "javascripts/select2.js" languages.each do |lang| get "#{remote}/raw/#{tag}/select2_locale_#{lang}.js", "javascripts/select2_locale_#{lang}.js" end end |