Skip to content

Instantly share code, notes, and snippets.

@pecavalheiro
Forked from jerelmiller/custom_plan.rb
Last active February 5, 2021 15:10
Show Gist options
  • Select an option

  • Save pecavalheiro/5b8a007e047d8e907ee7e905b9aa37d4 to your computer and use it in GitHub Desktop.

Select an option

Save pecavalheiro/5b8a007e047d8e907ee7e905b9aa37d4 to your computer and use it in GitHub Desktop.

Revisions

  1. pecavalheiro revised this gist Feb 5, 2021. 2 changed files with 16 additions and 6 deletions.
    12 changes: 9 additions & 3 deletions custom_plan.rb
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,17 @@
    # frozen_string_literal: true

    require 'zeus/rails'

    class CustomPlan < Zeus::Rails
    class Pry::Pager
    def best_available
    NullPager.new(pry_instance.output)
    end
    end

    class CustomPlan < Zeus::Rails
    # def my_custom_command
    # # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
    # end

    def default_bundle_with_test_env
    ::Rails.env = 'test'
    ENV['RAILS_ENV'] = 'test'
    @@ -17,4 +23,4 @@ def test_console
    end
    end

    Zeus.plan = CustomPlan.new
    Zeus.plan = CustomPlan.new
    10 changes: 7 additions & 3 deletions zeus.json
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,17 @@
    {
    "command": "ruby -rubygems -r./custom_plan -eZeus.go",
    "command": "ruby -rrubygems -r./custom_plan -eZeus.go",

    "plan": {
    "boot": {
    "default_bundle": {
    "development_environment": {
    "prerake": {"rake": []},
    "runner": ["r"],
    "console": ["c"],
    "generate": ["g"]
    "server": ["s"],
    "generate": ["g"],
    "destroy": ["d"],
    "dbconsole": []
    },
    "test_environment": {
    "test_helper": {"test": ["rspec"]},
    @@ -16,4 +20,4 @@
    }
    }
    }
    }
    }
  2. @jerelmiller jerelmiller created this gist Sep 5, 2014.
    20 changes: 20 additions & 0 deletions custom_plan.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    require 'zeus/rails'

    class CustomPlan < Zeus::Rails

    # def my_custom_command
    # # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
    # end

    def default_bundle_with_test_env
    ::Rails.env = 'test'
    ENV['RAILS_ENV'] = 'test'
    default_bundle
    end

    def test_console
    console
    end
    end

    Zeus.plan = CustomPlan.new
    19 changes: 19 additions & 0 deletions zeus.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {
    "command": "ruby -rubygems -r./custom_plan -eZeus.go",

    "plan": {
    "boot": {
    "default_bundle": {
    "development_environment": {
    "prerake": {"rake": []},
    "console": ["c"],
    "generate": ["g"]
    },
    "test_environment": {
    "test_helper": {"test": ["rspec"]},
    "test_console": ["tc"]
    }
    }
    }
    }
    }