Module: MigrationBundler::Actions
- Included in:
- CLI, Targets::Base
- Defined in:
- lib/migration_bundler/actions.rb
Instance Method Summary collapse
- #bundle ⇒ Object
-
#git(commands = {}) ⇒ Object
Run a command in git.
- #git_add(*paths) ⇒ Object
- #truncate_database ⇒ Object
- #unique_tag_for_version(version) ⇒ Object
Instance Method Details
#bundle ⇒ Object
29 30 31 |
# File 'lib/migration_bundler/actions.rb', line 29 def bundle inside(destination_root) { run "bundle" } end |
#git(commands = {}) ⇒ Object
Run a command in git.
git :init
git add: "this.file that.rb"
git add: "onefile.rb", rm: "badfile.cxx"
8 9 10 11 12 13 14 15 16 |
# File 'lib/migration_bundler/actions.rb', line 8 def git(commands={}) if commands.is_a?(Symbol) run "git #{commands}" else commands.each do |cmd, | run "git #{cmd} #{}" end end end |
#git_add(*paths) ⇒ Object
18 19 20 21 22 |
# File 'lib/migration_bundler/actions.rb', line 18 def git_add(*paths) inside(destination_root) do git add: paths.flatten.join(' ') end end |
#truncate_database ⇒ Object
24 25 26 27 |
# File 'lib/migration_bundler/actions.rb', line 24 def truncate_database say_status :truncate, database.to_s, :yellow database.drop end |
#unique_tag_for_version(version) ⇒ Object
33 34 35 36 |
# File 'lib/migration_bundler/actions.rb', line 33 def unique_tag_for_version(version) return version if ['pretend'] MigrationBundler::Util.unique_tag_for_version(version) end |