Class: InstrumentalComponents::Installer
- Inherits:
-
Object
- Object
- InstrumentalComponents::Installer
- Defined in:
- lib/instrumental-components.rb
Instance Method Summary collapse
-
#initialize(license_key, email) ⇒ Installer
constructor
A new instance of Installer.
- #install ⇒ Object
Constructor Details
#initialize(license_key, email) ⇒ Installer
Returns a new instance of Installer.
9 10 11 12 |
# File 'lib/instrumental-components.rb', line 9 def initialize(license_key, email) @license_key = license_key @email = email end |
Instance Method Details
#install ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/instrumental-components.rb', line 14 def install if updating? puts "š„ Updating to the latest version of Instrumental Components..." else puts "š„ Downloading the latest version of Instrumental Components..." end begin # Load .env file if it exists (for local development only) if File.exist?('.env') Dotenv.load end # Download the latest version of the gem download_gem puts "š¦ Installing the gem on your system..." install_gem puts "š Updating Gemfile..." update_gemfile puts "" puts "Running 'bundle install'..." run_bundle_install if updating? puts "" puts "š Updating Instrumental Components..." system("bundle update instrumental-components-library") else puts "" puts "š Running the Instrumental Components installer..." run_installer end puts "" rescue => e # Display the error message sent by the logic in instrumental.dev's API puts "\nā #{e.message}" exit(1) end end |