atom script package で bundle exec 付きで rspec 実行


メモ用に。
なんか直接 script package のソースコードいじってるの気持ち悪いけどまぁ気にしない。

  1. ⌘, で設定一覧開く
  2. Open Config Folder.atom を開く
  3. .atom/packages/script/lib/grammers/ruby.coffee を開く
  4. 以下のように書き換え (以下の例では File Based のもののみ bundle exec つけてる)

before

module.exports =

  RSpec:
    'Selection Based':
      command: 'ruby'
      args: (context) -> ['-e', context.getCode()]

    'File Based':
      command: 'rspec'
      args: ({filepath}) -> ['--tty', '--color', filepath]

    'Line Number Based':
      command: 'rspec'
      args: (context) -> ['--tty', '--color', context.fileColonLine()]

  Ruby:
    'Selection Based':
      command: 'ruby'
      args: (context) -> ['-e', context.getCode()]

    'File Based':
      command: 'ruby'
      args: ({filepath}) -> [filepath]

  'Ruby on Rails':

    'Selection Based':
      command: 'rails'
      args: (context) -> ['runner', context.getCode()]

    'File Based':
      command: 'rails'
      args: ({filepath}) -> ['runner', filepath]

after

module.exports =

  RSpec:
    'Selection Based':
      command: 'ruby'
      args: (context) -> ['-e', context.getCode()]

    'File Based':
      command: 'bundle'
      args: ({filepath}) -> ['exec', 'rspec', '--tty', '--color', filepath]

    'Line Number Based':
      command: 'rspec'
      args: (context) -> ['--tty', '--color', context.fileColonLine()]

  Ruby:
    'Selection Based':
      command: 'ruby'
      args: (context) -> ['-e', context.getCode()]

    'File Based':
      command: 'ruby'
      args: ({filepath}) -> [filepath]

  'Ruby on Rails':

    'Selection Based':
      command: 'rails'
      args: (context) -> ['runner', context.getCode()]

    'File Based':
      command: 'rails'
      args: ({filepath}) -> ['runner', filepath]