rhelp 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/rhelp +4 -0
  2. data/lib/rhelp.rb +23 -2
  3. metadata +5 -3
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rhelp'
4
+ puts RHelp.run(ARGV[0] || "no file")
@@ -1,5 +1,26 @@
1
1
  class RHelp
2
- def self.hi
3
- puts "Hello World!"
2
+ def self.run(filename)
3
+ if File.exists?(filename)
4
+ file = File.new(filename,"r")
5
+ lines = IO.readlines(file)
6
+ a = true
7
+ i = 0
8
+ while a
9
+ line = lines[i]
10
+ if line[0] == "#"
11
+ line = line[1..-1]
12
+ while line[0] == " "
13
+ line = line[1..-1]
14
+ end
15
+ puts line
16
+ else
17
+ a = false
18
+ end
19
+ i += 1
20
+ end
21
+ file.close
22
+ else
23
+ puts "File not found."
24
+ end
4
25
  end
5
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhelp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,12 +11,14 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-08-18 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: A script to allow you to create help files for .rb scripts.
14
+ description: A script to allow you to format a help display for in the console.
15
15
  email: bradymkoehler@gmail.com
16
- executables: []
16
+ executables:
17
+ - rhelp
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - bin/rhelp
20
22
  - lib/rhelp.rb
21
23
  homepage: http://rubygems.org/gems/rhelp
22
24
  licenses: