markov_chain 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.2 / 2011-10-31
2
+
3
+ * Fixes a UTF-8 issue in Ruby 1.9
4
+
1
5
  === 0.2.1 / 2011-10-31
2
6
 
3
7
  * Fixes issue reading dictionary passed in as symbol or string.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/markov_chain.rb CHANGED
@@ -55,16 +55,18 @@ class MarkovChain
55
55
  file = File.join File.dirname(__FILE__), 'dictionaries', file.to_s
56
56
  end
57
57
 
58
- dictionary = File.read file
58
+ dictionary = File.new file, 'r:ASCII-8BIT'
59
59
 
60
60
  if dictionary
61
- dictionary.each do |line|
61
+ while (line = dictionary.gets)
62
62
  s = line.strip
63
63
  instance.add_str s
64
64
  end
65
65
 
66
66
  @dictionary_loaded = true
67
67
  @dictionary = File.expand_path file
68
+
69
+ dictionary.close
68
70
  end
69
71
  end
70
72
 
data/markov_chain.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{markov_chain}
8
- s.version = "0.2.1"
7
+ s.name = "markov_chain"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alex Rabarts"]
12
- s.date = %q{2011-10-31}
13
- s.description = %q{Markov chain generator}
14
- s.email = %q{alexrabarts@gmail.com}
12
+ s.date = "2011-10-31"
13
+ s.description = "Markov chain generator"
14
+ s.email = "alexrabarts@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
@@ -28,10 +28,10 @@ Gem::Specification.new do |s|
28
28
  "test/markov_chain_test.rb",
29
29
  "test/test_helper.rb"
30
30
  ]
31
- s.homepage = %q{http://github.com/alexrabarts/markov_chain}
31
+ s.homepage = "http://github.com/alexrabarts/markov_chain"
32
32
  s.require_paths = ["lib"]
33
- s.rubygems_version = %q{1.4.2}
34
- s.summary = %q{A simple Markov chain generator.}
33
+ s.rubygems_version = "1.8.10"
34
+ s.summary = "A simple Markov chain generator."
35
35
 
36
36
  if s.respond_to? :specification_version then
37
37
  s.specification_version = 3
metadata CHANGED
@@ -1,60 +1,45 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: markov_chain
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Alex Rabarts
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-31 00:00:00 +00:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-10-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rake
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2152556280 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: jeweler
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2152556280
25
+ - !ruby/object:Gem::Dependency
26
+ name: jeweler
27
+ requirement: &2152554540 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :development
48
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *2152554540
49
36
  description: Markov chain generator
50
37
  email: alexrabarts@gmail.com
51
38
  executables: []
52
-
53
39
  extensions: []
54
-
55
- extra_rdoc_files:
40
+ extra_rdoc_files:
56
41
  - README.rdoc
57
- files:
42
+ files:
58
43
  - Gemfile
59
44
  - Gemfile.lock
60
45
  - History.txt
@@ -66,39 +51,28 @@ files:
66
51
  - markov_chain.gemspec
67
52
  - test/markov_chain_test.rb
68
53
  - test/test_helper.rb
69
- has_rdoc: true
70
54
  homepage: http://github.com/alexrabarts/markov_chain
71
55
  licenses: []
72
-
73
56
  post_install_message:
74
57
  rdoc_options: []
75
-
76
- require_paths:
58
+ require_paths:
77
59
  - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
60
+ required_ruby_version: !ruby/object:Gem::Requirement
79
61
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
87
- required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
67
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
96
72
  requirements: []
97
-
98
73
  rubyforge_project:
99
- rubygems_version: 1.4.2
74
+ rubygems_version: 1.8.10
100
75
  signing_key:
101
76
  specification_version: 3
102
77
  summary: A simple Markov chain generator.
103
78
  test_files: []
104
-