Git Product home page Git Product logo

open_terms's Introduction

OpenTerm

This gem makes it easy to open many terminal tabs for OSX and Linux, the main idea is that working on Rails, Python, Node or other types of projects, the developer allways needs to open the same terminal windows. So why not automate this?

In a projects I worked on, there was a term.rb file, this was the first "gem" for this project. I need to write some tests, and need help testing it on linux.

This version is just a extraction from that code, this is not official yet, I'm putting it on Github only to ask some friends to help testing on Linux, since I do not have any linux box right now.

If you want to use this gem on linux, do not forget to install "xdotool" first, using your distribution package tool.

To use it on OSX you will need the "rb-appscript" gem installed.

To use on a Rails project, add these two lines on your Gemfile:

gem 'open_terms'
gem 'rb-appscript' if RUBY_PLATFORM =~ /darwin/

Now you can run:

rake terms:open

If you want to run it without Rake:

require 'open_terms'
require 'rb-appscript' if RUBY_PLATFORM =~ /darwin/
OpenTerms.rails_defaults

If you are not in a Rails project:

require 'open_terms'
require 'appscript' if RUBY_PLATFORM =~ /darwin/
project_dir = File.expand_path(File.dirname(__FILE__))
@commands = [
  [:application, %Q{cd "#{project_dir}" && start_your_app_command}],
  [:console, %Q{cd "#{project_dir}" && open_your_console_command}],
  [:logs, %Q{cd "#{project_dir}" && tail -f log/development.log}]
]
OpenTerms.run_commands @commands

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.