Class: ChromeExtensionScaffold::Generators::Scaffold
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- ChromeExtensionScaffold::Generators::Scaffold
- Includes:
- Thor::Actions
- Defined in:
- lib/chrome_extension_scaffold.rb
Instance Method Summary collapse
- #create_root ⇒ Object
- #install_background_html ⇒ Object
- #install_background_js ⇒ Object
- #install_content_js ⇒ Object
- #install_jquery ⇒ Object
- #install_manifest ⇒ Object
- #install_watcher ⇒ Object
Instance Method Details
#create_root ⇒ Object
17 18 19 20 |
# File 'lib/chrome_extension_scaffold.rb', line 17 def create_root empty_directory name self.destination_root = name end |
#install_background_html ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/chrome_extension_scaffold.rb', line 30 def install_background_html if haml? template "background.html.haml" else template "background.html" end end |
#install_background_js ⇒ Object
38 39 40 |
# File 'lib/chrome_extension_scaffold.rb', line 38 def install_background_js template "background.js#{".coffee" if coffee?}" end |
#install_content_js ⇒ Object
42 43 44 |
# File 'lib/chrome_extension_scaffold.rb', line 42 def install_content_js template "content.js#{".coffee" if coffee?}" end |
#install_jquery ⇒ Object
26 27 28 |
# File 'lib/chrome_extension_scaffold.rb', line 26 def install_jquery copy_file "jquery.js" if jquery? end |
#install_manifest ⇒ Object
22 23 24 |
# File 'lib/chrome_extension_scaffold.rb', line 22 def install_manifest template "manifest.json" end |
#install_watcher ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/chrome_extension_scaffold.rb', line 46 def install_watcher if watcher? template "Gemfile" inside do if defined? Bundler Bundler.with_clean_env do run "bundle install" end else run "bundle install" end end template "watcher" chmod "watcher", 0755 end end |