debugprint 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +49 -0
  2. data/lib/debugprint.rb +14 -0
  3. data/lib/debugprint.rb~ +11 -0
  4. metadata +40 -0
data/README ADDED
@@ -0,0 +1,49 @@
1
+ = debugprint
2
+
3
+ debugprint is a pair of extra Kernel module functions that provide
4
+ shortcuts to "puts('foo') if $DEBUG" and "puts('bar') if $VERBOSE"
5
+ via the debug() and info() methods respectively.
6
+
7
+
8
+ == Installation
9
+
10
+ === Non-gem installation
11
+
12
+ Decompress archive and enter its top directory, then type:
13
+
14
+ $ ruby install.rb config
15
+ $ ruby install.rb setup
16
+ $ su -c "ruby install.rb install"
17
+
18
+ or
19
+
20
+ $ ruby install.rb config
21
+ $ ruby install.rb setup
22
+ $ sudo ruby install.rb install
23
+
24
+ You can also install files into your favorite directory
25
+ by supplying install.rb some options. Try "ruby install.rb --help".
26
+
27
+ === Gem installation
28
+
29
+ $ sudo gem install --remote debugprint
30
+
31
+ == Usage
32
+
33
+ require 'debugprint'
34
+
35
+ def doSomethingComplex
36
+ debug("Starting to do something complex")
37
+ ...
38
+ info("#{count} entries processed")
39
+ ...
40
+ debug("Done complex task")
41
+ end
42
+
43
+ == License
44
+
45
+ debugprint is now in the public domain
46
+
47
+ == Who do I blame?
48
+
49
+ Author:: Ben Giddings <bg-ruby@infofiend.com>
@@ -0,0 +1,14 @@
1
+ module Kernel
2
+
3
+ # Print out the args if $VERBOSE is true
4
+ def info(*args)
5
+ $stdout.puts(*args) if $VERBOSE
6
+ end
7
+
8
+ # Print out the args to stderr if $DEBUG is true
9
+ def debug(*args)
10
+ $stderr.puts(*args) if $DEBUG
11
+ end
12
+
13
+ module_function :info, :debug
14
+ end
@@ -0,0 +1,11 @@
1
+ module Kernel
2
+ def info(*args)
3
+ $stdout.puts(*args) if $VERBOSE
4
+ end
5
+
6
+ def debug(*args)
7
+ $stderr.puts(*args) if $DEBUG
8
+ end
9
+
10
+ module_function :info, :debug
11
+ end
metadata ADDED
@@ -0,0 +1,40 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.10
3
+ specification_version: 1
4
+ name: debugprint
5
+ version: !ruby/object:Gem::Version
6
+ version: 1.0.0
7
+ date: 2005-08-03
8
+ summary: Easy debug() and info() methods for Kernel that use $VERBOSE and $INFO
9
+ require_paths:
10
+ - lib
11
+ email: bg-ruby@infofiend.com
12
+ homepage: http://infofiend.com/debugprint/
13
+ rubyforge_project:
14
+ description:
15
+ autorequire: debugprint
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ -
22
+ - ">"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.0
25
+ version:
26
+ platform: ruby
27
+ authors:
28
+ - Ben Giddings
29
+ files:
30
+ - lib/debugprint.rb
31
+ - lib/debugprint.rb~
32
+ - README
33
+ test_files: []
34
+ rdoc_options: []
35
+ extra_rdoc_files:
36
+ - README
37
+ executables: []
38
+ extensions: []
39
+ requirements: []
40
+ dependencies: []