dotrun 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -11
  3. data/lib/dotrun.rb +3 -2
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d30a89973859aef0fcbddae7d70afa665fdf4d0
4
- data.tar.gz: d3c63f1014c587e9ddd182e6880daf1e25cb7d73
3
+ metadata.gz: 38240c5d9c6c1486462fe3a94761e23511c7caf9
4
+ data.tar.gz: 8cf0aa76e68b548d310ea75c2c325c08c135c55c
5
5
  SHA512:
6
- metadata.gz: 376b7ad9fa17b681cee2c7e76ff3be0177a76ec2340889364c1572d2f71338297c192bced49cf43dbcb58282b9f05c8fec9b486b6b0a39da5057b973d4b40fe3
7
- data.tar.gz: f4ddfe997fb2e639a6f60642e311cee4f561e68caa57f5b8d3a67062bffdcfa45bddb8292b58e1d125561f19c85d50c4a6930c3a3490abdd9d5836c435f2eefd
6
+ metadata.gz: c26938aff7ca1b2da8016db012062099badc44bddd852e0f5b1fe81b23986c08b89aa21fefd9225b79f18701348924caa28d660f304c34b0919f33ffbc64ffd5
7
+ data.tar.gz: 1efb5c4f66ab70cfd2a46ef98ff54912d9bb75f7547c38a06850463c6b47a6e7720f84d8b6bd723f67f062362e535307248ded4070a6b83f2d134d42e427a08a
data/README.md CHANGED
@@ -1,40 +1,51 @@
1
1
  # dotrun
2
2
  A super simple app runner script
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/dotrun.svg)](https://badge.fury.io/rb/dotrun)
5
+
4
6
  ## The Problem
5
7
  Every app I work on seems to have a different way of running it, and I couldn't keep track. I wanted to be able to navigate to any app directory in the terminal and run a simple command to launch the app in focus.
6
8
 
7
9
  ## The Solution
8
- This simple ruby script expects a file called `.run` in the current directory with an instruction to execute. Put the script somewhere on your machine, make it executable with `chmod +x` and symlink it to somewhere in your path (e.g., `ln -s /usr/local/dotrun /path/to/dotrun.rb`) and you can run it from anywhere that you've defined a `.run` file.
9
-
10
- Simply navigate to the directory of your app, and run
10
+ This simple ruby script expects a file called `.run` in the current directory with an instruction to execute. Define a new `.run` file for each of the apps on your system. Then simply navigate to the directory of your app, and run
11
11
  ```
12
- dotrun
12
+ $ dotrun
13
13
  ```
14
14
  and it will run the command you've specified. It will also clear your terminal and tell you some useful information like the current git branch, and hitting `Ctrl+C` will terminate the process (gracefully, hopefully).
15
15
 
16
+ ## Installation
17
+ ```
18
+ gem install dotrun
19
+ ```
20
+ Or add `'dotrun'` to your Gemfile.
21
+
22
+ ## Additional Features
23
+
24
+ ### Store multiple directives
25
+
16
26
  For even more usefulness, you can provide multiple commands in the file to specify different things to launch. For example:
17
27
 
18
28
  ```yaml
19
29
  server: unicorn_rails --host 127.0.0.1
20
30
  console: rails c
21
31
  sidekiq: bundle exec sidekiq
32
+ tunnel: "ssh -L 33061:mysqlserver.my.net:3306 user@ssh.my.net"
22
33
  log: tail -f log/development.log
23
34
  ```
24
35
 
25
- You can then run
36
+ You can then run, for example,
26
37
  ```
27
- dotrun server
38
+ $ dotrun sidekiq
28
39
  ```
29
- to run the unicorn script above.
40
+ to run the sidekiq script above.
30
41
 
31
- ### List directives
32
- To get a list of possible directives for the current directory:
42
+ ### View a list of available directives
43
+ To see a list of the directives you've defined for the current directory:
33
44
  ```
34
- dotrun -?
45
+ $ dotrun -?
35
46
  ```
36
47
 
37
- ### Run multiple commands at once
48
+ ### Run multiple directives at once
38
49
  **This feature requires that [ttab](https://www.npmjs.com/package/ttab) is installed.** Run multiple commands in different tabs of your terminal window by specifying an array of commands in your `.run` directives file. For example:
39
50
 
40
51
  ```yaml
data/lib/dotrun.rb CHANGED
@@ -65,15 +65,16 @@ class Dotrun
65
65
  end
66
66
 
67
67
  # Execute multiple commands in multiple tabs using `ttab`
68
- def exec_multiple_directives(directive, command)
68
+ def exec_multiple_directives(directive, command, auto_close = false)
69
69
  check_for_ttab
70
70
  prep_screen
71
71
  puts "\n\n\n"
72
72
  puts "Running multiple directives in separate tabs:".green
73
+ exit_cmd = "exit;" if auto_close
73
74
  for d in command
74
75
  print " #{d}".ljust(20).magenta
75
76
  sleep 2
76
- system %(ttab -G eval "dotrun #{d}; exit")
77
+ system %(ttab -G eval "dotrun #{d}; #{exit_cmd}")
77
78
  puts " ✔︎".magenta
78
79
  end
79
80
  puts ""
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotrun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2017-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 2.4.8
61
+ rubygems_version: 2.5.1
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Simply run your app