Sha256: 2e3cb30038f7e79e2edc547c2e2b614ff69caa4551df17dd0939307d86b65a11

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require_relative 'cmd'
module ::Rrjj
  class Cmds
    class << self
      def all
        zeus('zro', 'ro')
        zeus('a', 'rails_navigate access')
        zeus('la', 'rails get_assets')
        zeus('lc', 'rails get_controllers')
        zeus('lmo', 'rails get_models')
        zeus('lm', 'rails get_migrations')
        zeus('lsc', 'rails get_scaffolds')

        zro('schema', 'check schema')
        zro('table', 'check table')

        zrk('routes', 'routes')
        all_shortcuts
      end

      def zeus(shortcut_name, bash)
        all_shortcuts << Cmd.new(shortcut_name, "zeus #{bash}")
      end

      def zro(shortcut_name, bash)
        all_shortcuts << Cmd.new(shortcut_name, "zeus ro #{bash}")
      end

      def zrk(shortcut_name, bash)
        all_shortcuts << Cmd.new(shortcut_name, "zeus rake #{bash}")
      end

      attr_accessor :all_shortcuts

      def all_shortcuts
        @all_shortcuts.flatten! if defined?(@all_shortcuts) and @all_shortcuts.respond_to?(:flatten!)
        @all_shortcuts.uniq! if defined?(@all_shortcuts) and @all_shortcuts.respond_to?(:uniq!)
        @all_shortcuts ||= []
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rrjj-0.0.1 lib/rrjj/cmds.rb