hitimes 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY CHANGED
@@ -1,4 +1,9 @@
1
1
  = Changelog
2
+ == Version 1.0.4 2009-08-1
3
+
4
+ * Add in support for x86-mingw32 gem
5
+ * Add version subdirectory for extension on all platforms
6
+
2
7
  == Version 1.0.3 2009-06-28
3
8
 
4
9
  * Fix bug with time.h on linode (reported by Roger Pack)
@@ -13,9 +13,5 @@ else
13
13
  end
14
14
 
15
15
  # put in a different location if on windows so we can have fat binaries
16
- parent_dir = "hitimes"
17
- if RUBY_PLATFORM =~ /(mswin|mingw)/i then
18
- v = RUBY_VERSION.gsub(/\.\d$/,'')
19
- parent_dir = File.join( parent_dir, v )
20
- end
21
- create_makefile("#{parent_dir}/hitimes_ext")
16
+ subdir = RUBY_VERSION.gsub(/\.\d$/,'')
17
+ create_makefile("hitimes/#{subdir}/hitimes_ext")
data/gemspec.rb CHANGED
@@ -49,9 +49,12 @@ Hitimes::GEM_SPEC = Gem::Specification.new do |spec|
49
49
  end
50
50
  end
51
51
 
52
- Hitimes::GEM_SPEC_WIN = Hitimes::GEM_SPEC.clone
53
- Hitimes::GEM_SPEC_WIN.platform = ::Gem::Platform.new( "i386-mswin32_60" )
54
- Hitimes::GEM_SPEC_WIN.extensions = []
55
- #Hitimes::GEM_SPEC_WIN.files +=
52
+ Hitimes::GEM_SPEC_MSWIN32 = Hitimes::GEM_SPEC.clone
53
+ Hitimes::GEM_SPEC_MSWIN32.platform = ::Gem::Platform.new( "i386-mswin32" )
54
+ Hitimes::GEM_SPEC_MSWIN32.extensions = []
56
55
 
57
- Hitimes::SPECS = [ Hitimes::GEM_SPEC, Hitimes::GEM_SPEC_WIN ]
56
+ Hitimes::GEM_SPEC_MINGW32= Hitimes::GEM_SPEC.clone
57
+ Hitimes::GEM_SPEC_MINGW32.platform = ::Gem::Platform.new( "i386-mingw32" )
58
+ Hitimes::GEM_SPEC_MINGW32.extensions = []
59
+
60
+ Hitimes::SPECS = [ Hitimes::GEM_SPEC, Hitimes::GEM_SPEC_MSWIN32, Hitimes::GEM_SPEC_MINGW32 ]
@@ -19,12 +19,9 @@ end
19
19
  require 'hitimes/paths'
20
20
  require 'hitimes/version'
21
21
 
22
- # support for fat binaries on windows
23
- if RUBY_PLATFORM =~ /(mswin|mingw)/i
24
- require "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}/hitimes_ext"
25
- else
26
- require 'hitimes/hitimes_ext'
27
- end
22
+ # use a version subdirectory for extensions, initially to support windows, but
23
+ # why make a special case. It doesn't hurt anyone to have an extra subdir.
24
+ require "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}/hitimes_ext"
28
25
  require 'hitimes/stats'
29
26
  require 'hitimes/mutexed_stats'
30
27
  require 'hitimes/metric'
@@ -16,7 +16,7 @@ module Hitimes
16
16
  MINOR = 0
17
17
 
18
18
  # Build number
19
- BUILD = 3
19
+ BUILD = 4
20
20
 
21
21
  #
22
22
  # :call-seq:
@@ -1,6 +1,6 @@
1
1
  require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
2
2
 
3
- require 'hitimes/hitimes_ext'
3
+ require 'hitimes'
4
4
 
5
5
  describe Hitimes::Interval do
6
6
  it "has a 0 duration when newly created" do
@@ -1,6 +1,6 @@
1
1
  require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
2
2
 
3
- require 'hitimes/hitimes_ext'
3
+ require 'hitimes'
4
4
  require 'hitimes/mutexed_stats'
5
5
 
6
6
  describe Hitimes::MutexedStats do
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'spec'
3
3
 
4
- $: << File.expand_path(File.join(File.dirname(__FILE__),"..","ext"))
5
4
  $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
6
5
 
@@ -17,16 +17,19 @@ namespace :announce do
17
17
  mail.puts
18
18
  mail.puts info[:title]
19
19
  mail.puts
20
- mail.puts " gem install #{Hitimes::GEM_SPEC.name}"
20
+ mail.puts "{{ Release notes for Version #{Hitimes::VERSION} }}"
21
21
  mail.puts
22
- mail.puts info[:urls]
23
- mail.puts
24
- mail.puts info[:description]
22
+ mail.puts info[:release_notes]
23
+ mail.puts
24
+ mail.puts " #{info[:urls]}"
25
25
  mail.puts
26
- mail.puts "{{ Release notes for Version #{Hitimes::VERSION} }}"
26
+ mail.puts "=== Installation"
27
+ mail.puts
28
+ mail.puts " gem install #{Hitimes::GEM_SPEC.name}"
27
29
  mail.puts
28
- mail.puts info[:release_notes]
30
+ mail.puts "=== Description"
29
31
  mail.puts
32
+ mail.puts info[:description]
30
33
  end
31
34
  puts "Created the following as email.txt:"
32
35
  puts "-" * 72
@@ -49,10 +49,13 @@ if pkg_config = Configuration.for_if_exist?("packaging") then
49
49
  cp "ext/hitimes/hitimes_ext.so", "lib/hitimes/#{s}/", :verbose => true
50
50
  end
51
51
 
52
- Hitimes::GEM_SPEC_WIN.files += FileList["lib/hitimes/{1.8,1.9}/**.{dll,so}"]
53
- Gem::Builder.new( Hitimes::GEM_SPEC_WIN ).build
54
- mkdir "pkg" unless File.directory?( 'pkg' )
55
- mv Dir["*.gem"].first, "pkg"
52
+ Hitimes::SPECS.each do |spec|
53
+ next if spec.platform == "ruby"
54
+ spec.files += FileList["lib/hitimes/{1.8,1.9}/**.{dll,so}"]
55
+ Gem::Builder.new( spec ).build
56
+ mkdir "pkg" unless File.directory?( 'pkg' )
57
+ mv Dir["*.gem"].first, "pkg"
58
+ end
56
59
  end
57
60
 
58
61
  task :clobber do
@@ -9,13 +9,19 @@ if ext_config = Configuration.for_if_exist?('extension') then
9
9
  namespace :ext do
10
10
  desc "Build the extension(s)"
11
11
  task :build => :clean do
12
- Hitimes::GEM_SPEC.extensions.each do |extension|
13
- path = Pathname.new(extension)
12
+ ext_config.configs.each do |extension|
13
+ path = Pathname.new(extension)
14
14
  parts = path.split
15
- conf = parts.last
15
+ conf = parts.last
16
16
  Dir.chdir(path.dirname) do |d|
17
17
  ruby conf.to_s
18
18
  sh "make"
19
+
20
+ # install into requireable location so specs will run
21
+ subdir = "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}"
22
+ dest_dir = Hitimes::Paths.lib_path( subdir )
23
+ mkdir_p dest_dir, :verbose => true
24
+ cp "hitimes_ext.#{Config::CONFIG['DLEXT']}", dest_dir, :verbose => true
19
25
  end
20
26
  end
21
27
  end
@@ -34,6 +40,9 @@ if ext_config = Configuration.for_if_exist?('extension') then
34
40
  parts = path.split
35
41
  conf = parts.last
36
42
  Dir.chdir(path.dirname) do |d|
43
+ if File.exist?( "Makefile" ) then
44
+ sh "make clean distclean"
45
+ end
37
46
  cp "#{rbconfig}", "rbconfig.rb"
38
47
  sh "#{ruby_exe} -I. extconf.rb"
39
48
  sh "make"
@@ -61,6 +70,7 @@ if ext_config = Configuration.for_if_exist?('extension') then
61
70
  if File.exist?( "Makefile" ) then
62
71
  sh "make clean"
63
72
  end
73
+ rm_f "rbconfig.rb"
64
74
  end
65
75
  end
66
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hitimes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hinegardner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-28 00:00:00 -06:00
12
+ date: 2009-08-01 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency