xbm_ruby 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,3 +3,6 @@
3
3
  * 1 major enhancement:
4
4
  * Initial release
5
5
  * Used just with 0-9 numerals for now
6
+
7
+ * 1 tiny fix:
8
+ * Remove StringIO dependancy
data/README.txt CHANGED
@@ -12,4 +12,8 @@ class Counter
12
12
  end
13
13
 
14
14
  >> puts Counter.new.process(10)
15
- =>
15
+ #define counter_width 16
16
+ #define counter_height 8
17
+ static char number_bits[] = {
18
+ 0x08,0x1c,0x0c,0x22,0x0a,0x20,0x08,0x10,
19
+ 0x08,0x08,0x08,0x04,0x08,0x02,0x3e,0x3e, };
@@ -15,19 +15,17 @@ module XbmRuby
15
15
  def build_bitmap(number)
16
16
  array = number.to_s.split(//).map { |n| n.to_i }.reverse
17
17
 
18
- bits = StringIO.new
19
- bits.write "#define counter_width #{8 * array.size}\n"
20
- bits.write "#define counter_height 8\n"
21
- bits.write "static char number_bits[] = {\n"
18
+ bits = "#define counter_width #{8 * array.size}\n"
19
+ bits << "#define counter_height 8\n"
20
+ bits << "static char number_bits[] = {\n"
22
21
 
23
22
  0.upto(7) do |i|
24
23
  (array.size - 1).downto(0) do |j|
25
- bits.write sprintf("0x%02x,", get_bit_value(array[j], i));
24
+ bits << "0x%02x," % get_bit_value(array[j], i));
26
25
  end
27
26
  end
28
27
 
29
- bits.write " };"
30
- bits.string
28
+ bits << " };"
31
29
  end
32
30
 
33
31
  def get_bit_value(num, el)
@@ -36,4 +34,3 @@ module XbmRuby
36
34
  end
37
35
 
38
36
  require 'xbm_ruby/version'
39
- require 'stringio'
@@ -2,7 +2,7 @@ module XbmRuby #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,11 +1,98 @@
1
- <html>
2
- <head>
3
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
- <title>xbm_ruby</title>
5
-
6
- </head>
7
- <body id="body">
8
- <p>This page has not yet been created for RubyGem <code>xbm_ruby</code></p>
9
- <p>To the developer: To generate it, update website/index.txt and run the rake task <code>website</code> to generate this <code>index.html</code> file.</p>
10
- </body>
11
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ xbm_ruby
9
+ </title>
10
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
+ <style>
12
+
13
+ </style>
14
+ <script type="text/javascript">
15
+ window.onload = function() {
16
+ settings = {
17
+ tl: { radius: 10 },
18
+ tr: { radius: 10 },
19
+ bl: { radius: 10 },
20
+ br: { radius: 10 },
21
+ antiAlias: true,
22
+ autoPad: true,
23
+ validTags: ["div"]
24
+ }
25
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
26
+ versionBox.applyCornersToAll();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="main">
32
+
33
+ <h1>xbm_ruby</h1>
34
+ <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/xbm_ruby"; return false'>
35
+ Get Version
36
+ <a href="http://rubyforge.org/projects/xbm_ruby" class="numbers">1.0.0</a>
37
+ </div>
38
+ <h2>What</h2>
39
+
40
+
41
+ <p><span class="caps">XBM</span> is a black and white bitmap protocol created in the 80&#8217;s. This library was created to make
42
+ really simple hit counters.</p>
43
+
44
+
45
+ <h2>Installing</h2>
46
+
47
+
48
+ <pre syntax="ruby">sudo gem install xbm_ruby</pre>
49
+
50
+ <h2>Demonstration of usage</h2>
51
+
52
+
53
+ <pre syntax="ruby">
54
+ class Counter
55
+ include XbmRuby
56
+
57
+ def process(number)
58
+ build_bitmap(number)
59
+ end
60
+ end
61
+
62
+ &gt;&gt; puts Counter.new.process(10)
63
+ #define counter_width 16
64
+ #define counter_height 8
65
+ static char number_bits[] = {
66
+ 0x08,0x1c,0x0c,0x22,0x0a,0x20,0x08,0x10,
67
+ 0x08,0x08,0x08,0x04,0x08,0x02,0x3e,0x3e, };
68
+ </pre>
69
+
70
+ <h2>How to submit patches</h2>
71
+
72
+
73
+ <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use Err the Blog&#8217;s <a href="http://err.lighthouseapp.com/projects/466-plugins/overview">Lighthouse App</a></p>
74
+
75
+
76
+ <p>The trunk repository is <code>svn://rubyforge.org/var/svn/xbm_ruby/trunk</code> for anonymous access.</p>
77
+
78
+
79
+ <h2>License</h2>
80
+
81
+
82
+ <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
83
+
84
+
85
+ <h2>Contact</h2>
86
+
87
+
88
+ <p>Comments are welcome. Send an email to <a href="mailto:pjhyett@gmail.com">PJ Hyett</a>.</p>
89
+ <p class="coda">
90
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 5th June 2007<br>
91
+ Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
92
+ </p>
93
+ </div>
94
+
95
+ <!-- insert site tracking codes here, like Google Urchin -->
96
+
97
+ </body>
98
+ </html>
@@ -1,31 +1,36 @@
1
1
  h1. xbm_ruby
2
2
 
3
- h1. &#x2192; 'xbm_ruby'
4
-
5
-
6
3
  h2. What
7
4
 
5
+ XBM is a black and white bitmap protocol created in the 80's. This library was created to make
6
+ really simple hit counters.
8
7
 
9
8
  h2. Installing
10
9
 
11
10
  <pre syntax="ruby">sudo gem install xbm_ruby</pre>
12
11
 
13
- h2. The basics
14
-
15
-
16
12
  h2. Demonstration of usage
17
13
 
18
-
19
-
20
- h2. Forum
21
-
22
- "http://groups.google.com/group/xbm_ruby":http://groups.google.com/group/xbm_ruby
23
-
24
- TODO - create Google Group - xbm_ruby
14
+ <pre syntax="ruby">
15
+ class Counter
16
+ include XbmRuby
17
+
18
+ def process(number)
19
+ build_bitmap(number)
20
+ end
21
+ end
22
+
23
+ >> puts Counter.new.process(10)
24
+ #define counter_width 16
25
+ #define counter_height 8
26
+ static char number_bits[] = {
27
+ 0x08,0x1c,0x0c,0x22,0x0a,0x20,0x08,0x10,
28
+ 0x08,0x08,0x08,0x04,0x08,0x02,0x3e,0x3e, };
29
+ </pre>
25
30
 
26
31
  h2. How to submit patches
27
32
 
28
- Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
33
+ Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use Err the Blog's "Lighthouse App":http://err.lighthouseapp.com/projects/466-plugins/overview
29
34
 
30
35
  The trunk repository is <code>svn://rubyforge.org/var/svn/xbm_ruby/trunk</code> for anonymous access.
31
36
 
@@ -35,4 +40,4 @@ This code is free to use under the terms of the MIT license.
35
40
 
36
41
  h2. Contact
37
42
 
38
- Comments are welcome. Send an email to "FIXME full name":mailto:FIXME email.
43
+ Comments are welcome. Send an email to "PJ Hyett":mailto:pjhyett@gmail.com.
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: xbm_ruby
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
6
+ version: 1.0.1
7
7
  date: 2007-06-05 00:00:00 -07:00
8
8
  summary: description of gem
9
9
  require_paths: