tidy-ext 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
- require 'rake/extensiontask'
4
3
 
5
4
  begin
6
5
  require 'jeweler'
@@ -14,6 +13,8 @@ begin
14
13
  gem.extensions = FileList["ext/**/extconf.rb"]
15
14
  end
16
15
  Jeweler::GemcutterTasks.new
16
+
17
+ task :spec => :check_dependencies
17
18
  rescue LoadError
18
19
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
20
  end
@@ -23,21 +24,23 @@ task :console do
23
24
  exec("irb -I lib -r tidy/alone")
24
25
  end
25
26
 
26
- require 'spec/rake/spectask'
27
- Spec::Rake::SpecTask.new(:spec) do |spec|
28
- spec.libs << 'lib' << 'spec'
29
- spec.spec_files = FileList['spec/**/*_spec.rb']
30
- end
31
-
32
- Spec::Rake::SpecTask.new(:rcov) do |spec|
33
- spec.libs << 'lib' << 'spec'
34
- spec.pattern = 'spec/**/*_spec.rb'
35
- spec.rcov = true
36
- end
27
+ begin
28
+ require 'spec/rake/spectask'
29
+ Spec::Rake::SpecTask.new(:spec) do |spec|
30
+ spec.libs << 'lib' << 'spec'
31
+ spec.spec_files = FileList['spec/**/*_spec.rb']
32
+ end
37
33
 
38
- task :spec => :check_dependencies
34
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
35
+ spec.libs << 'lib' << 'spec'
36
+ spec.pattern = 'spec/**/*_spec.rb'
37
+ spec.rcov = true
38
+ end
39
39
 
40
- task :default => :spec
40
+ task :default => :spec
41
+ rescue LoadError
42
+ puts "RSpec (or a dependency) not available. Install it with: gem install rspec"
43
+ end
41
44
 
42
45
  require 'rake/rdoctask'
43
46
  Rake::RDocTask.new do |rdoc|
@@ -49,19 +52,35 @@ Rake::RDocTask.new do |rdoc|
49
52
  rdoc.rdoc_files.include('lib/**/*.rb')
50
53
  end
51
54
 
52
- Rake::ExtensionTask.new do |ext|
53
- ext.name = 'tidy'
54
- ext.ext_dir = 'ext/tidy'
55
- ext.config_options << '--with-coverage' if ENV['COV']
55
+ begin
56
+ require 'rake/extensiontask'
57
+ Rake::ExtensionTask.new do |ext|
58
+ ext.name = 'tidy'
59
+ ext.ext_dir = 'ext/tidy'
60
+ ext.config_options << '--with-coverage' if ENV['COV']
61
+ end
62
+ rescue LoadError
63
+ puts "rake-compiler not available. Install it with: gem install rake-compiler"
56
64
  end
57
65
 
58
- desc "Recompile with gcc coverage options and run specs"
59
- task :gcov => [:clean] do |t|
60
- ENV['COV'] = '1'
61
- Rake::Task[:compile].invoke
62
- Rake::Task[:spec].invoke
66
+ namespace :gcov do
67
+
68
+ desc "Recompile with gcc coverage options"
69
+ task :compile do |t|
70
+ ENV['COV'] = '1'
71
+ Rake::Task["compile"].invoke
72
+ end
73
+
74
+ desc "Run specs and output gcov info"
75
+ task :spec do |t|
76
+ Rake::Task[:spec].invoke
77
+ obj = Dir.glob('**/ruby-tidy.o').first
78
+ puts %x{cd #{File.dirname(obj)} && gcov -b --object-file #{File.basename(obj)} ruby-tidy.c}
79
+ end
80
+
81
+ desc "Clean, compile with gcc coverage and run specs"
82
+ task :all, :needs => ["clean", :compile, :spec] do |t|
83
+ end
63
84
 
64
- ruby_tidy_o = Dir.glob('**/ruby-tidy.o').first
65
- puts %x{gcov --no-output --object-file #{ruby_tidy_o} ext/tidy/ruby-tidy.c}
66
85
  end
67
86
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.1.11
@@ -8,7 +8,7 @@ Given /^(.+) is tidy$/ do |page_name|
8
8
  out = tidy.clean(response.body)
9
9
  end
10
10
 
11
- tidy.errors.scan(/(\d+) warning, (\d+) errors were found!/) do |w,e|
11
+ tidy.errors.scan(/(\d+) warnings?, (\d+) errors? were found!/) do |w,e|
12
12
  warnings = w.to_i
13
13
  errors = e.to_i
14
14
  unless warnings == 0 && errors == 0
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe "tidy compatibility methods" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
  require 'open-uri'
3
3
 
4
4
  describe "tidy class methods" do
@@ -13,4 +13,4 @@ describe "tidy class methods" do
13
13
  end
14
14
  end
15
15
 
16
- end
16
+ end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe "tidy class methods" do
4
4
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tidy-ext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 10
10
- version: 0.1.10
9
+ - 11
10
+ version: 0.1.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Carl Douglas
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-23 00:00:00 +10:00
18
+ date: 2011-02-16 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies: []
21
21