win32-changenotify 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 07c45d703b303035e2b57bdf85bfea1f31b17cea
4
+ data.tar.gz: a1804830a560e2aa35988900b95394558522fa59
5
+ SHA512:
6
+ metadata.gz: 9915924bc56a91d81437e64cab7bb495297683ee4cb6835c32806a689f7e57f1e705ccbacdc1cc6b657e731ec62d94338a4e243f4c0233b88b7a465d55b20a20
7
+ data.tar.gz: 871f135bdd7f00971de340600904226f4e5af36c475ee3447401a36d4f8cabf335605c6d67ffa37373f9d54dda955e3a3eecf0ca8ce1eb8b08bcb9e7edf5729c
data/CHANGES CHANGED
@@ -1,66 +1,70 @@
1
- == 0.5.1 - 21-Aug-2009
2
- * License changed to Artistic 2.0.
3
- * The ChangeNotify#wait method is now slightly more robust.
4
- * Renamed test file to test_win32_changenotify.rb.
5
- * Some gemspec updates, including license and description.
6
- * Renamed example file to example_win32_changenotify.rb to avoid any
7
- confusion with actual test files.
8
- * Removed the doc/changenotify.txt file because I felt it was redundant.
9
- * Added an example rake task.
10
-
11
- == 0.5.0 - 9-Aug-2007
12
- * Now pure Ruby!
13
- * Now requires the win32-event library.
14
- * The constructor now accepts a block. If provided, it yields itself
15
- and automatically closes itself when the block terminates.
16
- * Removed the ChangeNotify#reset method. It was never especially useful,
17
- and now it's useless because of the way we wait for events (see below).
18
- * Added a Rakefile with tasks for installation and testing.
19
- * The code now uses completion ports internally, which greatly improves the
20
- number of simultaneous events it can detect and report. See the 'Known
21
- Issues' in the README for details on potential misses, however.
22
- * Some internal reorganization, with the C related code now moved into a
23
- separate directory.
24
- * Doc, test, and example program updates.
25
-
26
- == 0.4.2 - 22-Nov-2006
27
- * Fixed bugs caused by changes to the Ruby internals with regards to question
28
- marks and instance variables. Thanks go to an anonymous user for the spot.
29
- * Minor documentation updates.
30
-
31
- == 0.4.1 - 2-Jan-2006
32
- * Code cleanup
33
-
34
- == 0.4.0 - 20-Apr-2005
35
- * ChangeNotify#wait now returns an array of ChangeNotifyStruct's, rather than
36
- a single struct, because multiple notifications can occur for a single
37
- event.
38
- * Example program and test suite updates.
39
- * Removed the changenotify.rd file.
40
-
41
- == 0.3.1 - 4-Feb-2005
42
- * Fixed a bug in ChangeNotify#wait where the timeout was not set to the
43
- proper default if a timeout was not specified by the user. Thanks go
44
- to CT for the spot.
45
- * Made this document rdoc friendly.
46
- * Corrected the release date for 0.3.0.
47
-
48
- == 0.3.0 - 25-Jan-2005
49
- * The ChangeNotify#wait method now yields a ChangeNotifyStruct if a block is
50
- provided. This struct contains more detail on what changes occurred.
51
- * Added the ChangeNotify#path, ChangeNotify#recursive? and ChangeNotify#filter
52
- methods.
53
- * The ChangeNotify.new method no longer accepts a block. See the developer's
54
- notes if you want the nitty gritty details.
55
- * Added more code to the extconf.rb file. This was needed to set the
56
- _WIN32_WINNT macro properly.
57
- * Moved the 'examples' directory to the toplevel.
58
- * Test suite and documentation updates.
59
-
60
- == 0.2.0 - 17-Jul-2004
61
- * Now uses the newer allocation framework. This means that, as of this
62
- releas, this package requires Ruby 1.8.0 or later.
63
- * Moved the test.rb file to doc/examples.
64
-
65
- == 0.1.0 - 7-May-2004
66
- * Initial release
1
+ == 0.6.0 - 16-Aug-2013
2
+ * Converted code to FFI.
3
+ * Updated dependencies in the gemspec, including ffi and win32-event.
4
+
5
+ == 0.5.1 - 21-Aug-2009
6
+ * License changed to Artistic 2.0.
7
+ * The ChangeNotify#wait method is now slightly more robust.
8
+ * Renamed test file to test_win32_changenotify.rb.
9
+ * Some gemspec updates, including license and description.
10
+ * Renamed example file to example_win32_changenotify.rb to avoid any
11
+ confusion with actual test files.
12
+ * Removed the doc/changenotify.txt file because I felt it was redundant.
13
+ * Added an example rake task.
14
+
15
+ == 0.5.0 - 9-Aug-2007
16
+ * Now pure Ruby!
17
+ * Now requires the win32-event library.
18
+ * The constructor now accepts a block. If provided, it yields itself
19
+ and automatically closes itself when the block terminates.
20
+ * Removed the ChangeNotify#reset method. It was never especially useful,
21
+ and now it's useless because of the way we wait for events (see below).
22
+ * Added a Rakefile with tasks for installation and testing.
23
+ * The code now uses completion ports internally, which greatly improves the
24
+ number of simultaneous events it can detect and report. See the 'Known
25
+ Issues' in the README for details on potential misses, however.
26
+ * Some internal reorganization, with the C related code now moved into a
27
+ separate directory.
28
+ * Doc, test, and example program updates.
29
+
30
+ == 0.4.2 - 22-Nov-2006
31
+ * Fixed bugs caused by changes to the Ruby internals with regards to question
32
+ marks and instance variables. Thanks go to an anonymous user for the spot.
33
+ * Minor documentation updates.
34
+
35
+ == 0.4.1 - 2-Jan-2006
36
+ * Code cleanup
37
+
38
+ == 0.4.0 - 20-Apr-2005
39
+ * ChangeNotify#wait now returns an array of ChangeNotifyStruct's, rather than
40
+ a single struct, because multiple notifications can occur for a single
41
+ event.
42
+ * Example program and test suite updates.
43
+ * Removed the changenotify.rd file.
44
+
45
+ == 0.3.1 - 4-Feb-2005
46
+ * Fixed a bug in ChangeNotify#wait where the timeout was not set to the
47
+ proper default if a timeout was not specified by the user. Thanks go
48
+ to CT for the spot.
49
+ * Made this document rdoc friendly.
50
+ * Corrected the release date for 0.3.0.
51
+
52
+ == 0.3.0 - 25-Jan-2005
53
+ * The ChangeNotify#wait method now yields a ChangeNotifyStruct if a block is
54
+ provided. This struct contains more detail on what changes occurred.
55
+ * Added the ChangeNotify#path, ChangeNotify#recursive? and ChangeNotify#filter
56
+ methods.
57
+ * The ChangeNotify.new method no longer accepts a block. See the developer's
58
+ notes if you want the nitty gritty details.
59
+ * Added more code to the extconf.rb file. This was needed to set the
60
+ _WIN32_WINNT macro properly.
61
+ * Moved the 'examples' directory to the toplevel.
62
+ * Test suite and documentation updates.
63
+
64
+ == 0.2.0 - 17-Jul-2004
65
+ * Now uses the newer allocation framework. This means that, as of this
66
+ releas, this package requires Ruby 1.8.0 or later.
67
+ * Moved the test.rb file to doc/examples.
68
+
69
+ == 0.1.0 - 7-May-2004
70
+ * Initial release
data/MANIFEST CHANGED
@@ -1,11 +1,11 @@
1
- * CHANGES
2
- * README
3
- * MANIFEST
4
- * Rakefile
5
- * win32-changenotify.gemspec
6
- * examples/test.rb
7
- * ext/extconf.rb
8
- * ext/win32/changenotify.c
9
- * ext/win32/changenotify.h
10
- * lib/win32/changenotify.rb
11
- * test/test_win32_changenotify.rb
1
+ * CHANGES
2
+ * README
3
+ * MANIFEST
4
+ * Rakefile
5
+ * win32-changenotify.gemspec
6
+ * examples/test.rb
7
+ * lib/win32/changenotify.rb
8
+ * lib/win32/changenotify/constants.rb
9
+ * lib/win32/changenotify/functions.rb
10
+ * lib/win32/changenotify/structs.rb
11
+ * test/test_win32_changenotify.rb
data/README CHANGED
@@ -1,97 +1,91 @@
1
- = Description
2
- A class for monitoring events related to files and directories. This
3
- package is deprecated in favor of win32-changejournal on NTFS filesystems.
4
-
5
- = Prerequisites
6
- * Ruby 1.8.0 or later
7
- * win32-ipc 0.4.0 or later
8
-
9
- = Installation
10
- rake test (optional)
11
- rake install (non-gem) OR rake install_gem (gem)
12
-
13
- = Synopsis
14
- require 'win32/changenotify'
15
- include Win32
16
-
17
- # Indefinitely wait for a change in 'C:\some\path' and any of its
18
- # subdirectories. Print the file and action affected.
19
-
20
- filter = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME
21
- path = 'C:\some\path'
22
-
23
- cn = ChangeNotify.new(path, true, filter)
24
-
25
- cn.wait{ |arr|
26
- arr.each{ |info|
27
- p info.file_name
28
- p info.action
29
- }
30
- }
31
-
32
- cn.close
33
-
34
- # OR
35
-
36
- ChangeNotify.new(path, true, filter) do |events|
37
- events.each{ |event|
38
- p event.file_name
39
- p event.action
40
- }
41
- end
42
-
43
- = Notes
44
- The Win32::ChangeNotify class is a subclass of Win32::Ipc, and thus has
45
- all of its methods available as well.
46
-
47
- This library is deprecated in favor of win32-changejournal on NTFS
48
- filesystems.
49
-
50
- = Pure Ruby vs C Extension
51
- The C code we used for this library prior to 0.5.0 is still available in
52
- CVS for this project, but is not distributed with official releases. Note
53
- that it does NOT contain the completion port approach we use in 0.5.0 and
54
- later and is actually less reliable (in terms of how many simultaneous
55
- events it can pickup) as a result.
56
-
57
- = Known Issues
58
- Despite the improvements yielded as a result of using completion ports,
59
- it's still possible that events could be missed. To be more precise,
60
- any events that occur in the fraction of a second between the call to
61
- GetQueuedCompletionStatus() and ReadDirectoryChangesW() in the wait loop
62
- will not get picked up. As a general rule, the faster your system is,
63
- the less likely you are to encounter this scenario.
64
-
65
- We do not believe it is possible to resolve this issue without native
66
- thread support. We are, however, open to suggestions. :)
67
-
68
- = Acknowledgements
69
- This class was originally based on the Win32::ChangeNotify Perl module by
70
- Christopher Madsen.
71
-
72
- = Future Plans
73
- Probably none. This library is deprecated in favor of win32-changejournal.
74
- However, that library only works on NTFS filesystems, so this library will
75
- be maintained as well.
76
-
77
- That being said, I'm always open to improvements, so feel free to submit
78
- ideas and patches.
79
-
80
- = Known Bugs
81
- None that I know of. Please log any other bug reports on the RubyForge
82
- project page at http://www.rubyforge.net/projects/win32utils
83
-
84
- = License
85
- Artistic 2.0
86
-
87
- = Copyright
88
- (C) 2003-2009 Daniel J. Berger, All Rights Reserved
89
-
90
- = Warranty
91
- This package is provided "as is" and without any express or
92
- implied warranties, including, without limitation, the implied
93
- warranties of merchantability and fitness for a particular purpose.
94
-
95
- = Authors
96
- Park Heesob
97
- Daniel J. Berger
1
+ = Description
2
+ A class for monitoring events related to files and directories. This
3
+ package is deprecated in favor of win32-changejournal on NTFS filesystems.
4
+
5
+ = Prerequisites
6
+ * ffi
7
+ * win32-ipc
8
+ * win32-event
9
+
10
+ = Installation
11
+ gem install win32-changenotify
12
+
13
+ = Synopsis
14
+ require 'win32/changenotify'
15
+ include Win32
16
+
17
+ # Indefinitely wait for a change in 'C:\some\path' and any of its
18
+ # subdirectories. Print the file and action affected.
19
+
20
+ filter = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME
21
+ path = 'C:\some\path'
22
+
23
+ cn = ChangeNotify.new(path, true, filter)
24
+
25
+ cn.wait{ |arr|
26
+ arr.each{ |info|
27
+ p info.file_name
28
+ p info.action
29
+ }
30
+ }
31
+
32
+ cn.close
33
+
34
+ # OR
35
+
36
+ ChangeNotify.new(path, true, filter) do |events|
37
+ events.each{ |event|
38
+ p event.file_name
39
+ p event.action
40
+ }
41
+ end
42
+
43
+ = Notes
44
+ The Win32::ChangeNotify class is a subclass of Win32::Ipc, and thus has
45
+ all of its methods available as well.
46
+
47
+ This library is deprecated in favor of win32-changejournal on NTFS
48
+ filesystems.
49
+
50
+ = Known Issues
51
+ Despite the improvements yielded as a result of using completion ports,
52
+ it's still possible that events could be missed. To be more precise,
53
+ any events that occur in the fraction of a second between the call to
54
+ GetQueuedCompletionStatus() and ReadDirectoryChangesW() in the wait loop
55
+ will not get picked up. As a general rule, the faster your system is,
56
+ the less likely you are to encounter this scenario.
57
+
58
+ With Ruby 2.x and JRuby this should be even less of an issue than it's
59
+ been in the past.
60
+
61
+ = Acknowledgements
62
+ This class was originally based on the Win32::ChangeNotify Perl module by
63
+ Christopher Madsen.
64
+
65
+ = Future Plans
66
+ Probably none. This library is deprecated in favor of win32-changejournal.
67
+ However, that library only works on NTFS filesystems, so this library will
68
+ be maintained as well.
69
+
70
+ That being said, I'm always open to improvements, so feel free to submit
71
+ ideas and patches.
72
+
73
+ = Known Bugs
74
+ None that I know of. Please report any issues on the project page at:
75
+
76
+ http://www.github.com/djberg96/win32-changenotify
77
+
78
+ = License
79
+ Artistic 2.0
80
+
81
+ = Copyright
82
+ (C) 2003-2013 Daniel J. Berger, All Rights Reserved
83
+
84
+ = Warranty
85
+ This package is provided "as is" and without any express or
86
+ implied warranties, including, without limitation, the implied
87
+ warranties of merchantability and fitness for a particular purpose.
88
+
89
+ = Authors
90
+ Park Heesob
91
+ Daniel J. Berger
data/Rakefile CHANGED
@@ -1,30 +1,39 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
+ require 'rake/clean'
3
4
  require 'rbconfig'
4
- include Config
5
+ include RbConfig
5
6
 
6
- desc 'Install the win32-changenotify package (non-gem)'
7
- task :install do
8
- sitelibdir = CONFIG['sitelibdir']
9
- installdir = File.join(sitelibdir, 'win32')
10
- file = 'lib\win32\changenotify.rb'
7
+ CLEAN.include("**/*.gem")
11
8
 
12
- Dir.mkdir(installdir) unless File.exists?(installdir)
13
- FileUtils.cp(file, installdir, :verbose => true)
14
- end
9
+ namespace :gem do
10
+ desc 'Create the win32-changenotify gem'
11
+ task :create => [:clean] do
12
+ spec = eval(IO.read('win32-changenotify.gemspec'))
13
+ if Gem::VERSION.to_f >= 2.0
14
+ require 'rubygems/package'
15
+ Gem::Package.build(spec)
16
+ else
17
+ Gem::Builder.new(spec).build
18
+ end
19
+ end
15
20
 
16
- desc 'Install the win32-changenotify library as a gem'
17
- task :install_gem do
18
- ruby 'win32-changenotify.gemspec'
19
- file = Dir["*.gem"].first
20
- sh "gem install #{file}"
21
+ desc 'Install the win32-changenotify gem'
22
+ task :install => [:create] do
23
+ ruby 'win32-changenotify.gemspec'
24
+ file = Dir["*.gem"].first
25
+ sh "gem install #{file}"
26
+ end
21
27
  end
22
28
 
23
29
  desc 'Run the example program'
24
30
  task :example do
25
- ruby '-Ilib examples/example_win32_changenotify.rb'
31
+ ruby '-Ilib examples/example_win32_changenotify.rb'
32
+ end
26
33
 
27
34
  Rake::TestTask.new do |t|
28
- t.verbose = true
29
- t.warning = true
35
+ t.verbose = true
36
+ t.warning = true
30
37
  end
38
+
39
+ task :default => :test
@@ -1,35 +1,36 @@
1
- #######################################################################
2
- # example_win32_changenotify.rb
3
- #
4
- # An example script for general futzing and demonstration. You can
5
- # run this program via the 'rake example' task.
6
- #
7
- # Modify as you see fit.
8
- #######################################################################
9
- require 'win32/changenotify'
10
- require 'pp'
11
- include Win32
12
-
13
- puts "VERSION: " + ChangeNotify::VERSION
14
-
15
- puts "This will run for 20 seconds"
16
-
17
- flags = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME
18
- flags |= ChangeNotify::LAST_WRITE
19
-
20
- cn = ChangeNotify.new("c:\\", true, flags)
21
-
22
- # Wait up to 20 seconds for something to happen
23
- begin
24
- cn.wait(20){ |events|
25
- events.each { |event|
26
- puts "Something changed"
27
- puts "File: " + event.file_name
28
- puts "Action: " + event.action
29
- }
30
- }
31
- rescue
32
- cn.close
33
- end
34
-
35
- puts "ChangeNotify example program done"
1
+ #######################################################################
2
+ # example_win32_changenotify.rb
3
+ #
4
+ # An example script for general futzing and demonstration. You can
5
+ # run this program via the 'rake example' task.
6
+ #
7
+ # Modify as you see fit.
8
+ #######################################################################
9
+ require 'win32/changenotify'
10
+ include Win32
11
+
12
+ puts "VERSION: " + ChangeNotify::VERSION
13
+ sec = 10
14
+ dir = "C:\\Users"
15
+
16
+ puts "This will timeout after #{sec} seconds of inactivity on #{dir}."
17
+
18
+ flags = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME
19
+ flags |= ChangeNotify::LAST_WRITE
20
+
21
+ cn = ChangeNotify.new(dir, true, flags)
22
+
23
+ # Wait up to 'sec' seconds for something to happen
24
+ begin
25
+ cn.wait(sec) do |events|
26
+ events.each { |event|
27
+ puts "Something changed"
28
+ puts "File: " + event.file_name
29
+ puts "Action: " + event.action
30
+ }
31
+ end
32
+ rescue
33
+ cn.close
34
+ end
35
+
36
+ puts "ChangeNotify example program done"