cli_rage 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/README.md +30 -0
- data/Rakefile +2 -0
- data/bin/cli_rage +53 -0
- data/cli_rage.gemspec +17 -0
- data/lib/cli_rage/cli_rage.sh +55 -0
- data/lib/cli_rage/version.rb +3 -0
- data/lib/cli_rage.rb +5 -0
- metadata +55 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# What is it?
|
2
|
+
|
3
|
+
Have you ever had a bad experience in a CLI? Have you raged during said experience and typed in some choice commands to release that rage? Of course you have, and CLI Rage is for you. It provides an implementation for several rage releasing commands. It will simply provide a response. It's not much, but it's something, and something is better than nothing, right?
|
4
|
+
|
5
|
+
# How do I install it?
|
6
|
+
|
7
|
+
With RubyGems of course.
|
8
|
+
|
9
|
+
gem install cli_rage
|
10
|
+
cli_rage install
|
11
|
+
|
12
|
+
# Does it totally jack up my terminal?
|
13
|
+
|
14
|
+
Probably. It creates a bunch of aliases for common commands I type when raging. If you already have commands of the same name, it'll clobber them. Sorry.
|
15
|
+
|
16
|
+
# Why does it exist?
|
17
|
+
|
18
|
+
Apparently, for me, long travel has a tendency to produce silly libraries (see [fsck](https://github.com/thorncp/fsck)).
|
19
|
+
|
20
|
+
# It doesn't work
|
21
|
+
|
22
|
+
It should work in any bash environment, but I have basically zero bash knowledge, so there's that. It seems to work fine for me on OS X 10.7 in Terminal and iTerm. This is a one-off library that I will probably never touch again.
|
23
|
+
|
24
|
+
# I've had my fun, how do I nuke it?
|
25
|
+
|
26
|
+
cli_rage uninstall
|
27
|
+
|
28
|
+
# License
|
29
|
+
|
30
|
+
Do whatever, I don't care.
|
data/Rakefile
ADDED
data/bin/cli_rage
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
require "fileutils"
|
5
|
+
require 'cli_rage'
|
6
|
+
|
7
|
+
if ARGV.first == "install"
|
8
|
+
if File.exist? "~/.cli_rage"
|
9
|
+
# todo: handle this
|
10
|
+
puts "already installed"
|
11
|
+
else
|
12
|
+
puts "ATTENTION: This will modify your ~/.bash_profile file."
|
13
|
+
puts "A ~/.cli_rage file will be created, and your .bash_profile will be modified/created to reference the .cli_rage file."
|
14
|
+
print "Continue? (y/n) "
|
15
|
+
|
16
|
+
if STDIN.gets.chomp =~ /\Ay\z/i
|
17
|
+
puts "installing"
|
18
|
+
FileUtils.copy("lib/cli_rage/cli_rage.sh", File.expand_path("~/.cli_rage"))
|
19
|
+
|
20
|
+
File.open(File.expand_path("~/.bash_profile"), "a") do |file|
|
21
|
+
file.puts
|
22
|
+
file.puts "source ~/.cli_rage"
|
23
|
+
end
|
24
|
+
|
25
|
+
puts "CLI Rage installation successful."
|
26
|
+
puts "Please close and reopen your prompt (or source ~/.bash_profile)"
|
27
|
+
else
|
28
|
+
puts "aborting"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
elsif ARGV.first == "uninstall"
|
32
|
+
puts "ATTENTION: This will uninstall cli_rage."
|
33
|
+
puts "The ~/.cli_rage file will be deleted, and your ~/.bash_profile will be modified to remove all lines referencing cli_rage."
|
34
|
+
print "Continue? (y/n) "
|
35
|
+
|
36
|
+
if STDIN.gets.chomp =~ /\Ay\z/i
|
37
|
+
lines = File.readlines(File.expand_path("~/.bash_profile"))
|
38
|
+
File.open(File.expand_path("~/.bash_profile"), "w") do |file|
|
39
|
+
lines.each do |line|
|
40
|
+
file.puts line unless line =~ /cli_rage/i
|
41
|
+
end
|
42
|
+
end
|
43
|
+
File.delete(File.expand_path("~/.cli_rage"))
|
44
|
+
|
45
|
+
puts "CLI Rage uninstallation successful."
|
46
|
+
puts "Please close and reopen your prompt (or source ~/.bash_profile)"
|
47
|
+
else
|
48
|
+
puts "aborting"
|
49
|
+
end
|
50
|
+
else
|
51
|
+
puts "ಠ_ಠ"
|
52
|
+
exit 1
|
53
|
+
end
|
data/cli_rage.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/cli_rage/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["thorncp"]
|
6
|
+
gem.email = ["thorncp@gmail.com"]
|
7
|
+
gem.description = %q{Soothes command line induced rage.}
|
8
|
+
gem.summary = %q{Soothes command line induced rage.}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = "cli_rage"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = CliRage::VERSION
|
17
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
anger_aliases=(
|
2
|
+
"balls"
|
3
|
+
"fu"
|
4
|
+
"fuu"
|
5
|
+
"fuuu"
|
6
|
+
"ffu"
|
7
|
+
"ffuu"
|
8
|
+
"ffuuu"
|
9
|
+
"fffu"
|
10
|
+
"fffuu"
|
11
|
+
"fffuuu"
|
12
|
+
"fuck"
|
13
|
+
"shit"
|
14
|
+
"omg"
|
15
|
+
"wtf"
|
16
|
+
"zomg"
|
17
|
+
)
|
18
|
+
|
19
|
+
intrigue_aliases=(
|
20
|
+
"huh"
|
21
|
+
"wow"
|
22
|
+
"neat"
|
23
|
+
"holy"
|
24
|
+
)
|
25
|
+
|
26
|
+
cli_rage_anger() {
|
27
|
+
responses=(
|
28
|
+
"bro, calm down"
|
29
|
+
"fffffffuuuuuuuuuuuu"
|
30
|
+
"punch a bitch"
|
31
|
+
"imposibru!"
|
32
|
+
)
|
33
|
+
|
34
|
+
echo ${responses[$((RANDOM%${#responses[@]}))]}
|
35
|
+
}
|
36
|
+
|
37
|
+
cli_rage_intrigue() {
|
38
|
+
responses=(
|
39
|
+
"how about that"
|
40
|
+
"indeed"
|
41
|
+
"i'll be damned"
|
42
|
+
)
|
43
|
+
|
44
|
+
echo ${responses[$((RANDOM%${#responses[@]}))]}
|
45
|
+
}
|
46
|
+
|
47
|
+
for a in "${anger_aliases[@]}"
|
48
|
+
do
|
49
|
+
alias $a=cli_rage_anger
|
50
|
+
done
|
51
|
+
|
52
|
+
for a in "${intrigue_aliases[@]}"
|
53
|
+
do
|
54
|
+
alias $a=cli_rage_intrigue
|
55
|
+
done
|
data/lib/cli_rage.rb
ADDED
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cli_rage
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- thorncp
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-03 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Soothes command line induced rage.
|
15
|
+
email:
|
16
|
+
- thorncp@gmail.com
|
17
|
+
executables:
|
18
|
+
- cli_rage
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- bin/cli_rage
|
27
|
+
- cli_rage.gemspec
|
28
|
+
- lib/cli_rage.rb
|
29
|
+
- lib/cli_rage/cli_rage.sh
|
30
|
+
- lib/cli_rage/version.rb
|
31
|
+
homepage: ''
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.8.10
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: Soothes command line induced rage.
|
55
|
+
test_files: []
|