win32-dir 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.3.5 - 6-Aug-2009
2
+ * Changed the license to Artistic 2.0.
3
+ * Updated the gemspec, including the addition of a license attribute and
4
+ test-unit as a development dependency.
5
+
1
6
  == 0.3.4 - 5-May-2009
2
7
  * Redefined the Dir.getwd (and the Dir.pwd alias) to always return a
3
8
  normalized path.
data/README CHANGED
@@ -258,7 +258,7 @@ Dir::TEMPLATES
258
258
  Most of the documentation was copied from the MSDN web site.
259
259
 
260
260
  == License
261
- Ruby's
261
+ Artistic 2.0
262
262
 
263
263
  == Copyright
264
264
  (C) 2003-2009 Daniel J. Berger, All Rights Reserved
@@ -0,0 +1,23 @@
1
+ ####################################################################
2
+ # dir_example.rb
3
+ #
4
+ # Generic test script for general futzing. Modify as you see fit.
5
+ # You can run this via the 'rake example' task.
6
+ ####################################################################
7
+ require 'win32/dir'
8
+
9
+ puts "Admin Tools:\t\t" + Dir::ADMINTOOLS
10
+ puts "Common Admin Tools:\t" + Dir::COMMON_ADMINTOOLS
11
+ puts "App Data:\t\t" + Dir::APPDATA
12
+ puts "Common App Data:\t" + Dir::COMMON_APPDATA
13
+ puts "Common Documents:\t" + Dir::COMMON_DOCUMENTS
14
+ puts "Cookies:\t\t" + Dir::COOKIES
15
+ puts "History:\t\t" + Dir::HISTORY
16
+ puts "Internet Cache:\t\t" + Dir::INTERNET_CACHE
17
+ puts "Local App Data:\t\t" + Dir::LOCAL_APPDATA
18
+ puts "My Pictures:\t\t" + Dir::MYPICTURES
19
+ puts "Personal:\t\t" + Dir::PERSONAL
20
+ puts "Program Files:\t\t" + Dir::PROGRAM_FILES
21
+ puts "Program Files Common:\t" + Dir::PROGRAM_FILES_COMMON
22
+ puts "System:\t\t\t" + Dir::SYSTEM
23
+ puts "Windows:\t\t" + Dir::WINDOWS
data/lib/win32/dir.rb CHANGED
@@ -30,7 +30,7 @@ class Dir
30
30
  extend Windows::SystemInfo
31
31
 
32
32
  # The version of the win32-dir library.
33
- VERSION = '0.3.4'
33
+ VERSION = '0.3.5'
34
34
 
35
35
  # Dynamically set each of the CSIDL_ constants
36
36
  constants.grep(/CSIDL/).each{ |constant|
@@ -97,6 +97,11 @@ class Dir
97
97
 
98
98
  # Creates the symlink +to+, linked to the existing directory +from+. If the
99
99
  # +to+ directory already exists, it must be empty or an error is raised.
100
+ #
101
+ # Example:
102
+ #
103
+ # Dir.mkdir('C:\from')
104
+ # Dir.create_junction('C:\to', 'C:\from')
100
105
  #
101
106
  def self.create_junction(to, from)
102
107
  to = to.tr(File::SEPARATOR, File::ALT_SEPARATOR) # Normalize path
@@ -194,9 +199,13 @@ class Dir
194
199
  bool = true
195
200
  attrib = GetFileAttributes(path)
196
201
 
197
- bool = false if attrib == INVALID_FILE_ATTRIBUTES
198
- bool = false if attrib & FILE_ATTRIBUTE_DIRECTORY == 0
199
- bool = false if attrib & FILE_ATTRIBUTE_REPARSE_POINT == 0
202
+
203
+ if attrib == INVALID_FILE_ATTRIBUTES ||
204
+ attrib & FILE_ATTRIBUTE_DIRECTORY == 0 ||
205
+ attrib & FILE_ATTRIBUTE_REPARSE_POINT == 0
206
+ then
207
+ bool = false
208
+ end
200
209
 
201
210
  bool
202
211
  end
data/test/test_dir.rb CHANGED
@@ -27,7 +27,7 @@ class TC_Win32_Dir < Test::Unit::TestCase
27
27
  end
28
28
 
29
29
  def test_version
30
- assert_equal('0.3.4', Dir::VERSION)
30
+ assert_equal('0.3.5', Dir::VERSION)
31
31
  end
32
32
 
33
33
  def test_create_junction_basic
data/win32-dir.gemspec CHANGED
@@ -1,31 +1,30 @@
1
- require "rubygems"
1
+ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = 'win32-dir'
5
- gem.version = '0.3.4'
5
+ gem.version = '0.3.5'
6
6
  gem.authors = ['Daniel J. Berger', 'Park Heesob']
7
+ gem.license = 'Artistic 2.0'
7
8
  gem.email = 'djberg96@gmail.com'
8
9
  gem.homepage = 'http://www.rubyforge.org/projects/win32utils'
9
10
  gem.platform = Gem::Platform::RUBY
10
11
  gem.summary = 'Extra constants and methods for the Dir class on Windows.'
11
12
  gem.test_file = 'test/test_dir.rb'
12
- gem.files = Dir["lib/win32/*.rb"] + Dir["test/*"] + Dir["[A-Z]*"]
13
+ gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
13
14
 
14
15
  gem.rubyforge_project = 'win32utils'
15
16
  gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
16
17
 
17
18
  gem.add_dependency('windows-pr', '>= 0.9.3')
19
+ gem.add_development_dependency('test-unit', '>= 2.0.3')
18
20
 
19
- gem.files.reject!{ |fn| fn.include? "CVS" }
20
-
21
- gem.description = "The win32-dir library provides extra methods and
22
- constants for the builtin Dir class. The constants provide a convenient
23
- way to identify certain directories across all versions of Windows. Some
24
- methods have been added, such as the ability to create junctions. Others
25
- have been modified to provide a more consistent result for MS Windows.".gsub(/\s+/, ' ')
21
+ gem.description = <<-EOF
22
+ The win32-dir library provides extra methods and constants for the
23
+ builtin Dir class. The constants provide a convenient way to identify
24
+ certain directories across all versions of Windows. Some methods have
25
+ been added, such as the ability to create junctions. Others have been
26
+ modified to provide a more consistent result for MS Windows.
27
+ EOF
26
28
  end
27
29
 
28
- if $0 == __FILE__
29
- Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0
30
- Gem::Builder.new(spec).build
31
- end
30
+ Gem::Builder.new(spec).build
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-dir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-05-19 00:00:00 -06:00
13
+ date: 2009-08-06 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -23,7 +23,17 @@ dependencies:
23
23
  - !ruby/object:Gem::Version
24
24
  version: 0.9.3
25
25
  version:
26
- description: The win32-dir library provides extra methods and constants for the builtin Dir class. The constants provide a convenient way to identify certain directories across all versions of Windows. Some methods have been added, such as the ability to create junctions. Others have been modified to provide a more consistent result for MS Windows.
26
+ - !ruby/object:Gem::Dependency
27
+ name: test-unit
28
+ type: :development
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 2.0.3
35
+ version:
36
+ description: " The win32-dir library provides extra methods and constants for the\n builtin Dir class. The constants provide a convenient way to identify\n certain directories across all versions of Windows. Some methods have\n been added, such as the ability to create junctions. Others have been\n modified to provide a more consistent result for MS Windows.\n"
27
37
  email: djberg96@gmail.com
28
38
  executables: []
29
39
 
@@ -34,17 +44,18 @@ extra_rdoc_files:
34
44
  - CHANGES
35
45
  - MANIFEST
36
46
  files:
37
- - lib/win32/dir.rb
38
- - test/test_dir.rb
39
47
  - CHANGES
48
+ - examples/dir_example.rb
49
+ - lib/win32/dir.rb
40
50
  - MANIFEST
41
51
  - Rakefile
42
52
  - README
53
+ - test/test_dir.rb
43
54
  - win32-dir.gemspec
44
55
  has_rdoc: true
45
56
  homepage: http://www.rubyforge.org/projects/win32utils
46
- licenses: []
47
-
57
+ licenses:
58
+ - Artistic 2.0
48
59
  post_install_message:
49
60
  rdoc_options: []
50
61
 
@@ -65,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
76
  requirements: []
66
77
 
67
78
  rubyforge_project: win32utils
68
- rubygems_version: 1.3.3
79
+ rubygems_version: 1.3.4
69
80
  signing_key:
70
81
  specification_version: 3
71
82
  summary: Extra constants and methods for the Dir class on Windows.