rankable_graph 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.9.2
5
+ - 1.8.7
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rake-compiler', "~> 0.8.0"
4
+ gem 'rspec', "~> 2.8.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,22 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.3)
5
+ rake (0.9.2.2)
6
+ rake-compiler (0.8.0)
7
+ rake
8
+ rspec (2.8.0)
9
+ rspec-core (~> 2.8.0)
10
+ rspec-expectations (~> 2.8.0)
11
+ rspec-mocks (~> 2.8.0)
12
+ rspec-core (2.8.0)
13
+ rspec-expectations (2.8.0)
14
+ diff-lcs (~> 1.1.2)
15
+ rspec-mocks (2.8.0)
16
+
17
+ PLATFORMS
18
+ ruby
19
+
20
+ DEPENDENCIES
21
+ rake-compiler (~> 0.8.0)
22
+ rspec (~> 2.8.0)
data/README.rdoc CHANGED
@@ -1,7 +1,10 @@
1
+ {<img src="https://secure.travis-ci.org/cubox/rankable_graph.png" />}[http://travis-ci.org/cubox/rankable_graph]
1
2
  = rankable_graph
2
3
 
3
4
  A Ruby {PageRank}[http://en.wikipedia.org/wiki/PageRank] like implementation.
4
5
 
6
+ {<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/PageRanks-Example.svg/596px-PageRanks-Example.svg.png" />}[http://en.wikipedia.org/wiki/PageRank]
7
+
5
8
  == Description
6
9
 
7
10
  This gem is mostly writen in C with a pretty Ruby wrapper.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ version = File.read("VERSION")
1
2
  spec = Gem::Specification.new do |s|
2
3
  s.extensions = FileList["ext/**/extconf.rb"]
3
4
  s.name = "rankable_graph"
@@ -8,22 +9,25 @@ spec = Gem::Specification.new do |s|
8
9
  s.authors = ["Daniel Cadenas"]
9
10
  s.add_development_dependency "rspec", ">= 1.2.9"
10
11
  s.requirements << 'glib2, v2.22.2 or greater'
11
- s.version = File.read("VERSION")
12
- s.files = `git ls-files`.split
12
+ s.version = version
13
+ s.files = `git ls-files`.split("\n")
13
14
  end
14
15
 
15
- require 'rake/extensiontask'
16
- Rake::GemPackageTask.new(spec) do |pkg|
16
+ #Rake::PackageTask.new("rankable_graph", version) do |pkg|
17
+ require 'rubygems/package_task'
18
+ Gem::PackageTask.new(spec) do |pkg|
19
+ pkg.need_zip = false
20
+ pkg.need_tar = false
17
21
  end
18
22
 
23
+ require 'rake/extensiontask'
19
24
  Rake::ExtensionTask.new('rankable_graph', spec)
20
25
 
21
- require 'spec/rake/spectask'
22
- Spec::Rake::SpecTask.new(:spec) do |spec|
23
- spec.libs << 'lib' << 'spec'
24
- spec.spec_files = FileList['spec/**/*_spec.rb']
26
+ require 'rspec/core/rake_task'
27
+ RSpec::Core::RakeTask.new(:spec) do |spec|
25
28
  end
26
29
 
27
30
  task :spec => :compile
28
31
 
29
32
  task :default => :spec
33
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -160,7 +160,7 @@ static gfloat* step(gfloat s, gfloat t_over_size, gfloat *p, RNStruct *rn, GArra
160
160
  }
161
161
 
162
162
  static VALUE rank(VALUE self, VALUE s, VALUE tolerance){
163
- if(rb_block_given_p() == Qtrue){
163
+ if(rb_block_given_p()){
164
164
  RNStruct* rn;
165
165
  Data_Get_Struct(self, RNStruct, rn);
166
166
 
@@ -12,6 +12,14 @@ def assert_rank(rankable_graph, expected_rank)
12
12
  end
13
13
 
14
14
  describe RankableGraph do
15
+ it "should enter the block" do
16
+ rankable_graph = RankableGraph.new
17
+ entered = false
18
+ rankable_graph.link(0, 1)
19
+ rankable_graph.rank(0.85, 0.0001){|_, _| entered = true }
20
+ entered.should be_true
21
+ end
22
+
15
23
  it "should be possible to recalculate the ranks after a new link is added" do
16
24
  rankable_graph = RankableGraph.new
17
25
  rankable_graph.link(0, 1)
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'rankable_graph'
4
- require 'spec'
5
- require 'spec/autorun'
4
+ require 'rspec'
5
+ require 'rspec/autorun'
6
6
 
7
- Spec::Runner.configure do |config|
7
+ RSpec.configure do |config|
8
8
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rankable_graph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
4
+ prerelease:
5
+ version: 0.2.3
11
6
  platform: ruby
12
7
  authors:
13
8
  - Daniel Cadenas
@@ -15,8 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2010-10-14 00:00:00 -02:00
19
- default_executable:
13
+ date: 2012-03-28 00:00:00 Z
20
14
  dependencies:
21
15
  - !ruby/object:Gem::Dependency
22
16
  name: rspec
@@ -26,11 +20,6 @@ dependencies:
26
20
  requirements:
27
21
  - - ">="
28
22
  - !ruby/object:Gem::Version
29
- hash: 13
30
- segments:
31
- - 1
32
- - 2
33
- - 9
34
23
  version: 1.2.9
35
24
  type: :development
36
25
  version_requirements: *id001
@@ -44,6 +33,9 @@ extra_rdoc_files: []
44
33
 
45
34
  files:
46
35
  - .gitignore
36
+ - .travis.yml
37
+ - Gemfile
38
+ - Gemfile.lock
47
39
  - LICENSE
48
40
  - README.rdoc
49
41
  - Rakefile
@@ -54,7 +46,6 @@ files:
54
46
  - spec/rankable_graph_spec.rb
55
47
  - spec/spec.opts
56
48
  - spec/spec_helper.rb
57
- has_rdoc: true
58
49
  homepage: http://github.com/cubox/rankable_graph
59
50
  licenses: []
60
51
 
@@ -68,23 +59,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
59
  requirements:
69
60
  - - ">="
70
61
  - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
62
  version: "0"
75
63
  required_rubygems_version: !ruby/object:Gem::Requirement
76
64
  none: false
77
65
  requirements:
78
66
  - - ">="
79
67
  - !ruby/object:Gem::Version
80
- hash: 3
81
- segments:
82
- - 0
83
68
  version: "0"
84
69
  requirements:
85
70
  - glib2, v2.22.2 or greater
86
71
  rubyforge_project:
87
- rubygems_version: 1.3.7
72
+ rubygems_version: 1.8.16
88
73
  signing_key:
89
74
  specification_version: 3
90
75
  summary: A Ruby Pagerank implementation