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



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

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

#build(pattern) ⇒ Object



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

def build(pattern)
  ["gem", "build"] + pattern
end

#bump(version = nil) ⇒ Object



20
21
22
23
24
# File 'lib/autowow/commands/gem.rb', line 20

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

#bundle_installObject



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

def bundle_install
  ["bundle", "install"]
end

#cleanObject



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

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

#rakeObject



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

def rake
  be + ["rake"]
end

#rake_db_migrateObject



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

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

#rake_db_schemaObject



51
52
53
# File 'lib/autowow/commands/gem.rb', line 51

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

#rake_db_structureObject



55
56
57
# File 'lib/autowow/commands/gem.rb', line 55

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



26
27
28
29
30
31
32
33
# File 'lib/autowow/commands/gem.rb', line 26

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

#rubocop_parallelObject



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

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