Module: Orly

Defined in:
lib/orly.rb,
lib/orly/tester.rb,
lib/orly/version.rb,
lib/orly/owl_printer.rb,
lib/orly/installation.rb

Defined Under Namespace

Modules: Installation, OwlPrinter Classes: NoRepo, Tester

Constant Summary collapse

VERSION =
"0.0.15"

Class Method Summary collapse

Class Method Details

.runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/orly.rb', line 10

def self.run
  tester  = Orly::Tester.new()
  notify = []
  mix_commands = []

  notify << "run 'bundle install'".red if tester.need_bundle_install?
  notify << "run 'rake db:migrate'".red if tester.need_migrate?
  notify << "run 'dotenv-sync merge'".red if tester.need_dotenv?
  notify << "run 'pod install'".blue if tester.need_pod?
  notify << "run 'bower install'".green if tester.need_bower?
  notify << "run 'npm install'".green if tester.need_npm?
  notify << "run 'yarn install'".green if tester.need_yarn?
  
  mix_commands << 'deps.get' if tester.need_mix?
  mix_commands << 'ecto.migrate' if tester.need_ecto_migrate?
  mix_commands << 'ecto.seed' if tester.need_ecto_seed?

  if mix_commands.length == 1
    notify << "run 'mix #{mix_commands.join}'".magenta
  elsif mix_commands.length > 1
    notify << "run 'mix do #{mix_commands.join(',')}'".magenta
  end

  Orly::OwlPrinter.print(notify) unless notify.empty?
rescue Orly::NoRepo
  puts "O RLY: this is not a git repo".red
end