manr 0.0.1

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.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in manr.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/manr ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'find'
3
+
4
+ module Manr
5
+ def self.convert_path(path)
6
+ path = path.split("/")
7
+ path = path[path.size-1]
8
+ path = path.match(/([^.]+)/)
9
+ path[0]
10
+ end
11
+
12
+ def self.random_manual
13
+ list = []
14
+ dir = "/usr/share/man"
15
+
16
+ Find.find(dir) do |path|
17
+ unless FileTest.directory?(path)
18
+ list += [convert_path(path)] if path.match(/gz$/) && path.include?("8")
19
+ end
20
+ end
21
+
22
+ man = list[rand(list.size)]
23
+ exec "man #{man}"
24
+ end
25
+ end
26
+
27
+ Manr.random_manual
28
+
@@ -0,0 +1,3 @@
1
+ module Manr
2
+ VERSION = "0.0.1"
3
+ end
data/lib/manr.rb ADDED
@@ -0,0 +1,2 @@
1
+ module Manr
2
+ end
data/manr.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "manr/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "manr"
7
+ s.version = Manr::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Piotr Pawel Debosz"]
10
+ s.email = ["piotr.debosz@gmail.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Manr is random man}
13
+ s.description = %q{Manr will help you get to know your operation system better}
14
+
15
+ s.rubyforge_project = "manr"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: manr
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Piotr Pawel Debosz
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-06-25 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: Manr will help you get to know your operation system better
23
+ email:
24
+ - piotr.debosz@gmail.com
25
+ executables:
26
+ - manr
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - Rakefile
35
+ - bin/manr
36
+ - lib/manr.rb
37
+ - lib/manr/version.rb
38
+ - manr.gemspec
39
+ has_rdoc: true
40
+ homepage: ""
41
+ licenses: []
42
+
43
+ post_install_message:
44
+ rdoc_options: []
45
+
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ hash: 3
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
66
+ requirements: []
67
+
68
+ rubyforge_project: manr
69
+ rubygems_version: 1.6.2
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: Manr is random man
73
+ test_files: []
74
+