motd-creator 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/COPYING +14 -0
  2. data/README.md +30 -0
  3. data/Rakefile +6 -0
  4. data/bin/motd-creator +41 -0
  5. metadata +60 -0
data/COPYING ADDED
@@ -0,0 +1,14 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2011 James Pearson <pearson@changedmy.name>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
14
+
@@ -0,0 +1,30 @@
1
+ Create a nice MOTD, complete with ASCII-art, witty quote, and fancy border.
2
+
3
+ Requires [fortune] and [figlet].
4
+
5
+ # Usage
6
+
7
+ [$]> motd-creator -h
8
+ Usage: motd-creator [options]
9
+ --font VAL
10
+ --fortune-file VAL
11
+ --width VAL
12
+
13
+ # Example
14
+
15
+ [$]> hostname
16
+ geror
17
+ [$]> motd-creator --font cybermedium --fortune-file startrek --width 60
18
+ ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
19
+ * *
20
+ ~ ____ ____ ____ ____ ____ ~
21
+ * | __ |___ |__/ | | |__/ *
22
+ ~ |__] |___ | \ |__| | \ ~
23
+ * *
24
+ ~ Hailing frequencies open, Captain. ~
25
+ * *
26
+ ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
27
+
28
+ [fortune]: http://en.wikipedia.org/wiki/Fortune_(Unix)
29
+ [figlet]: http://www.figlet.org/
30
+
@@ -0,0 +1,6 @@
1
+ require 'mg'
2
+ MG.new 'motd-creator.gemspec'
3
+
4
+ require 'fileutils'
5
+ require 'rake/testtask'
6
+
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ # May you recognize your weaknesses and share your strengths.
5
+ # May you share freely, never taking more than you give.
6
+ # May you find love and love everyone you find.
7
+
8
+ require 'optparse'
9
+
10
+ options = ARGV.getopts('', 'font:', 'fortune-file:', 'width:')
11
+ options['font'] ||= 'basic'
12
+ options['width'] ||= 79
13
+ options['width'] = options['width'].to_i
14
+
15
+ borderChars = ['~', '*']
16
+
17
+ options['width'].times {|i| print borderChars[i%2]}
18
+ print "\n"
19
+ borderChars.reverse!
20
+
21
+ lines = ['']
22
+ lines += `hostname -s | figlet -f #{options['font']} -c -w #{options['width'] - 2}`.split("\n")
23
+ lines += `fortune #{options['fortune-file']}| figlet -f term -c -w \
24
+ #{options['width'] - 2}`.split("\n")
25
+ lines << ''
26
+
27
+ lastBorderChar = '~'
28
+ lines.each_with_index do |line, i|
29
+ print borderChars[i%2]
30
+ print line
31
+ print ' ' * (options['width'] - 2 - line.length)
32
+ print borderChars[i%2]
33
+ print "\n"
34
+
35
+ lastBorderChar = borderChars[i%2]
36
+ end
37
+
38
+ borderChars.reverse! if lastBorderChar == borderChars[0]
39
+ options['width'].times {|i| print borderChars[i%2]}
40
+ print "\n"
41
+
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motd-creator
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 1.0.1
6
+ platform: ruby
7
+ authors:
8
+ - xiongchiamiov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2013-06-22 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: Create a nice MOTD, complete with ASCII-art, witty quote, and fancy border.
18
+ email:
19
+ - xiong.chiamiov@gmail.com
20
+ executables:
21
+ - motd-creator
22
+ extensions: []
23
+
24
+ extra_rdoc_files:
25
+ - README.md
26
+ files:
27
+ - COPYING
28
+ - Rakefile
29
+ - README.md
30
+ - bin/motd-creator
31
+ has_rdoc: true
32
+ homepage: https://github.com/xiongchiamiov/motd-creator/
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ requirements: []
53
+
54
+ rubyforge_project:
55
+ rubygems_version: 1.5.3
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: Create a nice MOTD, complete with ASCII-art, witty quote, and fancy border.
59
+ test_files: []
60
+