Module: Autowow::Commands::Gem

Includes:
ReflectionUtils::CreateModuleFunctions
Included in:
Features::Gem
Defined in:
lib/autowow/commands/gem.rb

Instance Method Summary collapse

Instance Method Details

#beObject



31
32
33
# File 'lib/autowow/commands/gem.rb', line 31

def be
  ["bundle", "exec"]
end

#bump(version = nil) ⇒ Object



16
17
18
19
20
# File 'lib/autowow/commands/gem.rb', line 16

def bump(version = nil)
  command = ["gem", "bump", "--no-commit"]
  return command unless version
  command + ["--version", version]
end

#cleanObject



8
9
10
# File 'lib/autowow/commands/gem.rb', line 8

def clean
  ["gem", "clean"]
end

#rakeObject



35
36
37
# File 'lib/autowow/commands/gem.rb', line 35

def rake
  be + ["rake"]
end

#rake_db_migrateObject



39
40
41
# File 'lib/autowow/commands/gem.rb', line 39

def rake_db_migrate
  ["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:migrate"]
end

#rake_db_schemaObject



43
44
45
# File 'lib/autowow/commands/gem.rb', line 43

def rake_db_schema
  ["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:schema:load"]
end

#rake_db_structureObject



47
48
49
# File 'lib/autowow/commands/gem.rb', line 47

def rake_db_structure
  ["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:structure:load"]
end

#releaseObject



4
5
6
# File 'lib/autowow/commands/gem.rb', line 4

def release
  be + ["rake", "release"]
end

#rubocop_autocorrect(files) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/autowow/commands/gem.rb', line 22

def rubocop_autocorrect(files)
  cmd = be + ["rubocop", "--auto-correct"]
  if files.kind_of?(Array)
    cmd + files
  else
    cmd + files.split(" ")
  end
end

#rubocop_parallelObject



12
13
14
# File 'lib/autowow/commands/gem.rb', line 12

def rubocop_parallel
  be + ["rubocop", "--parallel"]
end