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.
- data/History.txt +3 -0
- data/README.txt +5 -1
- data/lib/xbm_ruby.rb +5 -8
- data/lib/xbm_ruby/version.rb +1 -1
- data/website/index.html +98 -11
- data/website/index.txt +20 -15
- metadata +1 -1
data/History.txt
CHANGED
data/README.txt
CHANGED
data/lib/xbm_ruby.rb
CHANGED
@@ -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
|
19
|
-
bits
|
20
|
-
bits
|
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
|
24
|
+
bits << "0x%02x," % get_bit_value(array[j], i));
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
29
|
-
bits
|
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'
|
data/lib/xbm_ruby/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -1,11 +1,98 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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’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
|
+
>> 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’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’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>
|
data/website/index.txt
CHANGED
@@ -1,31 +1,36 @@
|
|
1
1
|
h1. xbm_ruby
|
2
2
|
|
3
|
-
h1. → '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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
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 "
|
43
|
+
Comments are welcome. Send an email to "PJ Hyett":mailto:pjhyett@gmail.com.
|