guid 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,2 +1,5 @@
1
+ 0.1.1
2
+ - Fix Guid for darwin (osx) platforms.
3
+
1
4
  0.1.0
2
5
  - Forked uuid project - http://rubyforge.org/projects/uuid
data/Rakefile CHANGED
@@ -26,7 +26,7 @@ def run_suite
26
26
  end
27
27
 
28
28
  PKG_NAME = "guid"
29
- PKG_VERSION = "0.1.0"
29
+ PKG_VERSION = "0.1.1"
30
30
  PKG_FILES = FileList[
31
31
  '[A-Z]*',
32
32
  '*.rb',
@@ -7,7 +7,15 @@
7
7
  # under the same terms as Ruby itself.
8
8
  #
9
9
 
10
- if RUBY_PLATFORM =~ /win/i
10
+ class Guid
11
+ class << self
12
+ def win32?
13
+ RUBY_PLATFORM =~ /[^r]win/i
14
+ end
15
+ end
16
+ end
17
+
18
+ if Guid.win32?
11
19
  module Guid_Win32_
12
20
  require 'Win32API'
13
21
 
@@ -73,7 +81,7 @@ module Guid_Unix_
73
81
  end
74
82
 
75
83
  class Guid
76
- if RUBY_PLATFORM =~ /win/
84
+ if Guid.win32?
77
85
  include Guid_Win32_
78
86
  else
79
87
  include Guid_Unix_
@@ -0,0 +1,13 @@
1
+ require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
2
+
3
+ describe Guid do
4
+ it "does not load windows specific code on the Darwin platform" do
5
+ script = <<-RUBY
6
+ Object.send(:remove_const, :RUBY_PLATFORM)
7
+ Object.const_set(:RUBY_PLATFORM, "darwin")
8
+ require "guid"
9
+ RUBY
10
+ dir = File.dirname(__FILE__)
11
+ system("cd #{dir}/../lib; ruby -e '#{script}'").should be_true
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ require "rubygems"
2
+ require "spec"
3
+ require "rr"
4
+
5
+ dir = File.dirname(__FILE__)
6
+ $LOAD_PATH.unshift("#{dir}/../lib")
7
+ require "guid"
8
+
9
+ Spec::Runner.configure do |config|
10
+ config.mock_with :rr
11
+ end
@@ -0,0 +1,4 @@
1
+ dir = File.dirname(__FILE__)
2
+ Dir["#{dir}/**/*_spec.rb"].each do |file|
3
+ require file
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Takita, Ross Hale, & David Garamond
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-15 00:00:00 -07:00
12
+ date: 2008-04-24 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -23,12 +23,15 @@ extra_rdoc_files:
23
23
  - README
24
24
  - CHANGES
25
25
  files:
26
- - FAQ
27
- - CHANGES
28
26
  - Rakefile
27
+ - CHANGES
28
+ - FAQ
29
29
  - README
30
30
  - install.rb
31
31
  - lib/guid.rb
32
+ - spec/spec_suite.rb
33
+ - spec/spec_helper.rb
34
+ - spec/osx_spec.rb
32
35
  has_rdoc: true
33
36
  homepage: http://pivotallabs.com
34
37
  post_install_message:
@@ -54,9 +57,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
57
  requirements: []
55
58
 
56
59
  rubyforge_project: pivotalrb
57
- rubygems_version: 1.0.1
60
+ rubygems_version: 1.1.0
58
61
  signing_key:
59
62
  specification_version: 2
60
63
  summary: Guid is a Ruby library for portable GUID/UUID generation. At the moment it can be used on Windows (except first release of Win95 and older) and on Unix. This is a fork of David Garamond's ruby-uuid library.
61
- test_files: []
62
-
64
+ test_files:
65
+ - spec/osx_spec.rb