perquackey 0.7.2 → 0.7.3

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/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.7.3 -- 2010-04-29
2
+ * Document C extension.
3
+
1
4
  == 0.7.2 -- 2010-04-21
2
5
  * Clean up command-line options.
3
6
  * Write a perquackey(1) man page.
data/TODO.rdoc CHANGED
@@ -1,4 +1,3 @@
1
- * Include the C extension in the rdoc.
2
1
  * Use the web interface for in-game support:
3
2
  * Capture words
4
3
  * Calculate score
@@ -9,7 +9,7 @@
9
9
  static VALUE mPerquackey;
10
10
  static VALUE mAnagrams;
11
11
 
12
- void chop(char *string) {
12
+ static void chop(char *string) {
13
13
  int length = strlen(string);
14
14
 
15
15
  if (length > 0 && string[length-1] == '\n') {
@@ -17,7 +17,7 @@ void chop(char *string) {
17
17
  }
18
18
  }
19
19
 
20
- int anagram_p(char *letters, char *word) {
20
+ static int anagram_p(char *letters, char *word) {
21
21
  static char scratch_pad[MAX_LENGTH];
22
22
  register char *scratch_pad_ptr;
23
23
 
@@ -34,7 +34,15 @@ int anagram_p(char *letters, char *word) {
34
34
  return TRUE;
35
35
  }
36
36
 
37
- VALUE Anagrams_anagrams(VALUE self, VALUE letters) {
37
+ /*
38
+ * Document-class: Anagrams
39
+ * Document-method: anagrams
40
+ *
41
+ * call-seq:
42
+ * anagrams(letters) -> array
43
+ *
44
+ */
45
+ static VALUE Anagrams_anagrams(VALUE self, VALUE letters) {
38
46
  return rb_apply(
39
47
  rb_apply(self,
40
48
  rb_intern("enum_for"),
@@ -43,7 +51,15 @@ VALUE Anagrams_anagrams(VALUE self, VALUE letters) {
43
51
  rb_ary_new());
44
52
  }
45
53
 
46
- VALUE Anagrams_each_anagram(VALUE self, VALUE letters_value) {
54
+ /*
55
+ * Document-class: Anagrams
56
+ * Document-method: each_anagram
57
+ *
58
+ * call-seq:
59
+ * each_anagram(letters) { |anagram| ... } -> nil
60
+ *
61
+ */
62
+ static VALUE Anagrams_each_anagram(VALUE self, VALUE letters_value) {
47
63
  rb_io_t *stream;
48
64
  char word[MAX_LENGTH];
49
65
  char *letters = RSTRING(letters_value)->ptr;
@@ -61,6 +77,18 @@ VALUE Anagrams_each_anagram(VALUE self, VALUE letters_value) {
61
77
  return Qnil;
62
78
  }
63
79
 
80
+ /*
81
+ * Anagrams extends a File-backed IO stream with the ability to yield each
82
+ * anagram of the given letters it contains:
83
+ *
84
+ * File.open('/usr/share/dict/words') do |stream|
85
+ * stream.extend(Anagrams)
86
+ * stream.each_anagram('asdfuiop') do |anagram|
87
+ * puts anagram
88
+ * end
89
+ * end
90
+ *
91
+ */
64
92
  void Init_anagrams() {
65
93
  mPerquackey = rb_define_module("Perquackey");
66
94
  mAnagrams = rb_define_module_under(mPerquackey, "Anagrams");
data/lib/perquackey.rb CHANGED
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
  require 'rbconfig/datadir'
4
4
 
5
5
  module Perquackey
6
- VERSION = '0.7.2'
6
+ VERSION = '0.7.3'
7
7
 
8
8
  autoload :Anagrams, 'perquackey/anagrams'
9
9
  autoload :Application,'perquackey/application'
data/man/perquackey.1 CHANGED
@@ -77,8 +77,8 @@ word list at North American Scrabble tournaments. You're going to see some
77
77
  weird ones. ("Ixora"?!)
78
78
  .
79
79
  .SH "AUTHOR"
80
- Matthew Todd, \fI@matthewtodd\fR on GitHub and Twitter. Do drop me a line if you
81
- use \fBperquackey\fR \-\- I'd love to hear from you!
80
+ Matthew Todd, \fImatthewtodd\fR on GitHub. Do drop
81
+ me a line if you use \fBperquackey\fR \-\- I'd love to hear from you!
82
82
  .
83
83
  .SH "SEE ALSO"
84
84
  \fIhttp://en.wikipedia.org/wiki/Perquackey\fR, \fIhttp://en.wikipedia.org/wiki/Tournament_Word_List\fR, \fIhttp://perquackey.matthewtodd.org/\fR
@@ -66,8 +66,8 @@ weird ones. ("Ixora"?!)
66
66
 
67
67
  ## AUTHOR
68
68
 
69
- Matthew Todd, _@matthewtodd_ on GitHub and Twitter. Do drop me a line if you
70
- use `perquackey` -- I'd love to hear from you!
69
+ Matthew Todd, [matthewtodd](http://github.com/matthewtodd) on GitHub. Do drop
70
+ me a line if you use `perquackey` -- I'd love to hear from you!
71
71
 
72
72
  ## SEE ALSO
73
73
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 2
9
- version: 0.7.2
8
+ - 3
9
+ version: 0.7.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matthew Todd
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-21 00:00:00 +03:00
17
+ date: 2010-04-29 00:00:00 +03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -75,30 +75,26 @@ extra_rdoc_files:
75
75
  - CHANGELOG.rdoc
76
76
  - README.rdoc
77
77
  - TODO.rdoc
78
+ - ext/perquackey/anagrams.c
78
79
  files:
79
- - .gitignore
80
80
  - CHANGELOG.rdoc
81
- - Gemfile
82
- - Gemfile.lock
83
81
  - README.rdoc
84
- - Rakefile
85
82
  - TODO.rdoc
86
83
  - bin/perquackey
87
84
  - data/perquackey/dict/TWL06.txt
88
85
  - data/perquackey/templates/index.erb
89
86
  - data/perquackey/templates/layout.erb
90
- - ext/perquackey/anagrams.c
91
87
  - ext/perquackey/extconf.rb
92
- - lib/perquackey.rb
88
+ - ext/perquackey/anagrams.c
93
89
  - lib/perquackey/application.rb
94
90
  - lib/perquackey/console.rb
95
91
  - lib/perquackey/dictionary.rb
96
92
  - lib/perquackey/game.rb
97
93
  - lib/perquackey/server.rb
98
94
  - lib/perquackey/word_table.rb
95
+ - lib/perquackey.rb
99
96
  - man/perquackey.1
100
97
  - man/perquackey.1.ronn
101
- - perquackey.gemspec
102
98
  - test/dictionary_test.rb
103
99
  - test/helper.rb
104
100
  - test/word_table_test.rb
@@ -111,7 +107,7 @@ rdoc_options:
111
107
  - --main
112
108
  - README.rdoc
113
109
  - --title
114
- - perquackey-0.7.2
110
+ - perquackey-0.7.3
115
111
  - --inline-source
116
112
  require_paths:
117
113
  - lib
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- .rvmrc
2
- Makefile
3
- *.bundle
4
- *.gem
5
- *.o
6
- rdoc
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'sinatra'
4
-
5
- group :development do
6
- gem 'redgreen'
7
- gem 'ronn'
8
- gem 'shoe'
9
- end
data/Gemfile.lock DELETED
@@ -1,43 +0,0 @@
1
- ---
2
- dependencies:
3
- shoe:
4
- group:
5
- - :development
6
- version: ">= 0"
7
- ronn:
8
- group:
9
- - :development
10
- version: ">= 0"
11
- sinatra:
12
- group:
13
- - :default
14
- version: ">= 0"
15
- redgreen:
16
- group:
17
- - :development
18
- version: ">= 0"
19
- specs:
20
- - rake:
21
- version: 0.8.7
22
- - configuration:
23
- version: 1.1.0
24
- - hpricot:
25
- version: 0.8.2
26
- - launchy:
27
- version: 0.3.5
28
- - rack:
29
- version: 1.1.0
30
- - rdiscount:
31
- version: 1.6.3.1
32
- - redgreen:
33
- version: 1.2.2
34
- - ronn:
35
- version: "0.5"
36
- - shoe:
37
- version: 0.6.0
38
- - sinatra:
39
- version: "1.0"
40
- hash: 43e16f41a78020948379f93caebbae6705f7a82c
41
- sources:
42
- - Rubygems:
43
- uri: http://gemcutter.org
data/Rakefile DELETED
@@ -1,3 +0,0 @@
1
- require 'shoe'
2
-
3
- Shoe::Tasks.define('perquackey.gemspec')
data/perquackey.gemspec DELETED
@@ -1,35 +0,0 @@
1
- $:.unshift File.expand_path('../lib', __FILE__)
2
- require 'perquackey'
3
-
4
- Gem::Specification.new do |spec|
5
- spec.name = 'perquackey'
6
- spec.version = Perquackey::VERSION
7
-
8
- spec.summary = 'Provides console session and simple webapp for looking up Perquackey word matches'
9
- spec.description = spec.summary
10
- spec.author = 'Matthew Todd'
11
- spec.email = 'matthew.todd@gmail.com'
12
- spec.homepage = 'http://github.com/matthewtodd/perquackey'
13
-
14
- spec.required_ruby_version = '>= 1.8.7'
15
- spec.add_runtime_dependency 'sinatra'
16
- spec.add_development_dependency 'redgreen'
17
- spec.add_development_dependency 'ronn'
18
- spec.add_development_dependency 'shoe'
19
-
20
- def spec.git_files(glob=nil)
21
- `git ls-files -z --cached --other --exclude-standard #{glob}`.split("\0")
22
- end
23
-
24
- spec.files = spec.git_files
25
- spec.executables = spec.git_files('bin/*').map &File.method(:basename)
26
- spec.extensions = spec.git_files('ext/**/extconf.rb')
27
- spec.test_files = spec.git_files('test/{,**/}*_test.rb')
28
-
29
- spec.extra_rdoc_files = spec.git_files('{,**/}*.rdoc')
30
- spec.rdoc_options = %W(
31
- --main README.rdoc
32
- --title #{spec.full_name}
33
- --inline-source
34
- )
35
- end