Class: Recipes::Draper
- Inherits:
-
Rails::AppBuilder
- Object
- Rails::AppBuilder
- Recipes::Draper
- Defined in:
- lib/potassium/recipes/draper.rb
Instance Method Summary collapse
Instance Method Details
#add_draper ⇒ Object
20 21 22 23 24 |
# File 'lib/potassium/recipes/draper.rb', line 20 def add_draper gather_gem 'draper', '~> 3.1' add_readme_section :internal_dependencies, :draper create_file 'app/decorators/.keep' end |
#ask ⇒ Object
2 3 4 5 |
# File 'lib/potassium/recipes/draper.rb', line 2 def ask draper = answer(:draper) { Ask.confirm('Do you want to use Draper to decorate models?') } set(:draper, draper) end |
#create ⇒ Object
7 8 9 10 |
# File 'lib/potassium/recipes/draper.rb', line 7 def create return unless selected?(:draper) add_draper end |
#install ⇒ Object
16 17 18 |
# File 'lib/potassium/recipes/draper.rb', line 16 def install add_draper end |
#installed? ⇒ Boolean
12 13 14 |
# File 'lib/potassium/recipes/draper.rb', line 12 def installed? gem_exists?(/draper/) end |