tidings 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3d3cc9a5d1312a5afae2fadc4992d75b2cd2b10e
4
- data.tar.gz: 31ce95fb5c83594657b1f19839233690e693da5b
2
+ SHA256:
3
+ metadata.gz: 228de1321d524ee89a186eace9228e3623b196427da359390c4ea1cbd41a7895
4
+ data.tar.gz: 362d9e11a2c6787945ae39b2871a05e2e86dfe4f4e65380597a743189f5490dc
5
5
  SHA512:
6
- metadata.gz: 37dbc3dc2da9443465c28e570bccf3cde0a9dc20e6648fdbbef4347e592e51606ba57306c8bae6e8594eeea77932f19b7c9a86a5e822be4f6f5667eeea841f3b
7
- data.tar.gz: b912279ffdda8238c7537c28d40091b0d788b7b36f828807c486d94994621134bef3e77d43b42300aa2fcf4142329174374876fd709d5e45aec44a5ece8fcb17
6
+ metadata.gz: 695ca41270ccf3733528294f19e4763fb2161d01b58923d21b89a8c790305a203e4b3e8c81bd21ee71a3f5a5906ba85dbeb2a3f9a1bc8008e9b840f332cfa760
7
+ data.tar.gz: 790e9090ee80303967de22507844ca594267386a89918d24a11b66a2e17f9f2eb8c7ce99f632d166c9f0e78ada63e535e50a985464fbdb92fd98f22097f5d115
@@ -0,0 +1,3 @@
1
+ # 0.3.0
2
+
3
+ * Watcher now catches exceptions and uses #waitpid for clean process shutdown.
@@ -0,0 +1,31 @@
1
+ # Tidings
2
+
3
+ A platform optimized file-change watcher.
4
+
5
+ ## Installation
6
+
7
+ $ gem install tidings
8
+
9
+ ## Short example
10
+
11
+ ```ruby
12
+ Tidings.watch('/Users/janice/Code') do |file_or_path, flags|
13
+ if flags.include(:dir)
14
+ puts "Change to directory: #{file_or_path}"
15
+ else
16
+ puts "Change to file: #{file_or_path}"
17
+ end
18
+ end
19
+ ```
20
+
21
+ ## Long example
22
+
23
+ ```ruby
24
+ module MyFileWatcher
25
+ def self.call(file_or_path, flags)
26
+ puts "#{file_or_path.inspect}:#{flags.inspect}"
27
+ end
28
+ end
29
+
30
+ Tidings.watch('/Users/janice/Code', MyFileWatcher)
31
+ ````
@@ -12,12 +12,12 @@ NULLCMD = :
12
12
  #### Start of system configuration section. ####
13
13
 
14
14
  srcdir = fs_event
15
- topdir = /Users/manfred/.rbenv/versions/2.4.0/include/ruby-2.4.0
15
+ topdir = /Users/manfred/.rbenv/versions/2.5.1/include/ruby-2.5.0
16
16
  hdrdir = $(topdir)
17
- arch_hdrdir = /Users/manfred/.rbenv/versions/2.4.0/include/ruby-2.4.0/x86_64-darwin16
17
+ arch_hdrdir = /Users/manfred/.rbenv/versions/2.5.1/include/ruby-2.5.0/x86_64-darwin17
18
18
  PATH_SEPARATOR = :
19
19
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
- prefix = $(DESTDIR)/Users/manfred/.rbenv/versions/2.4.0
20
+ prefix = $(DESTDIR)/Users/manfred/.rbenv/versions/2.5.1
21
21
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
22
  rubyarchprefix = $(rubylibprefix)/$(arch)
23
23
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -68,7 +68,7 @@ CXX = clang++
68
68
  LIBRUBY = $(LIBRUBY_A)
69
69
  LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
70
70
  LIBRUBYARG_SHARED =
71
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
71
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework Foundation
72
72
  empty =
73
73
  OUTFLAG = -o $(empty)
74
74
  COUTFLAG = -o $(empty)
@@ -77,34 +77,34 @@ CSRCFLAG = $(empty)
77
77
  RUBY_EXTCONF_H =
78
78
  cflags = $(optflags) $(debugflags) $(warnflags)
79
79
  cxxflags = $(optflags) $(debugflags) $(warnflags)
80
- optflags = -O3 -fno-fast-math
80
+ optflags = -O3
81
81
  debugflags = -ggdb3
82
82
  warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens
83
83
  CCDLFLAGS = -fno-common
84
84
  CFLAGS = $(CCDLFLAGS) -O3 -Wno-error=shorten-64-to-32 -pipe $(ARCH_FLAG)
85
85
  INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
86
86
  DEFS =
87
- CPPFLAGS = -I/Users/manfred/.rbenv/versions/2.4.0/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
87
+ CPPFLAGS = -I/Users/manfred/.rbenv/versions/2.5.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
88
88
  CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
89
89
  ldflags = -framework CoreServices
90
- dldflags = -L/Users/manfred/.rbenv/versions/2.4.0/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
90
+ dldflags = -L/Users/manfred/.rbenv/versions/2.5.1/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
91
91
  ARCH_FLAG =
92
92
  DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
93
93
  LDSHARED = $(CC) -dynamic -bundle
94
94
  LDSHAREDXX = $(CXX) -dynamic -bundle
95
- AR = ar
95
+ AR = libtool -static
96
96
  EXEEXT =
97
97
 
98
98
  RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
99
- RUBY_SO_NAME = ruby
99
+ RUBY_SO_NAME = ruby.2.5.1
100
100
  RUBYW_INSTALL_NAME =
101
101
  RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
102
102
  RUBYW_BASE_NAME = rubyw
103
103
  RUBY_BASE_NAME = ruby
104
104
 
105
- arch = x86_64-darwin16
105
+ arch = x86_64-darwin17
106
106
  sitearch = $(arch)
107
- ruby_version = 2.4.0
107
+ ruby_version = 2.5.0
108
108
  ruby = $(bindir)/$(RUBY_BASE_NAME)
109
109
  RUBY = $(ruby)
110
110
  ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
@@ -160,7 +160,7 @@ CLEANLIBS = $(TARGET_SO)
160
160
  CLEANOBJS = *.o *.bak
161
161
 
162
162
  all: $(DLLIB)
163
- static: $(STATIC_LIB) install-rb
163
+ static: $(STATIC_LIB)
164
164
  .PHONY: all install static install-so install-rb
165
165
  .PHONY: clean clean-so clean-static clean-rb
166
166
 
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module Tidings
2
- VERSION = '0.2.2'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -5,15 +5,26 @@ module Tidings
5
5
  end
6
6
 
7
7
  def start
8
+ Signal.trap("HUP") { stop }
8
9
  Signal.trap("SIGINT") { stop }
9
- @pid = fork { watch }
10
+ @pid = fork do
11
+ begin
12
+ watch
13
+ rescue Exception => exception
14
+ Tidings.log(
15
+ "Tidings encountered an uncaught exeption: #{exception.message}"
16
+ )
17
+ exit
18
+ end
19
+ end
10
20
  Tidings.log("Tidings running on PID: #{@pid}")
11
- Process.wait
21
+ Process.waitpid(@pid)
12
22
  Tidings.log("Tidings stopped running")
13
23
  end
14
24
 
15
25
  def stop
16
26
  Process.kill("KILL", @pid)
27
+ rescue Errno::ESRCH
17
28
  end
18
29
 
19
30
  if const_defined?(:FSEvent)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tidings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manfred Stienstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-17 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -31,11 +31,11 @@ executables: []
31
31
  extensions:
32
32
  - ext/extconf.rb
33
33
  extra_rdoc_files:
34
- - README.rdoc
35
34
  - COPYING
36
35
  files:
36
+ - CHANGELOG.md
37
37
  - COPYING
38
- - README.rdoc
38
+ - README.md
39
39
  - ext/Makefile
40
40
  - ext/extconf.rb
41
41
  - ext/fs_event.bundle
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  requirements: []
66
66
  rubyforge_project:
67
- rubygems_version: 2.6.8
67
+ rubygems_version: 2.7.6
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: A platform optimized file-change watcher.
@@ -1,27 +0,0 @@
1
- = Tidings
2
-
3
- A platform optimized file-change watcher.
4
-
5
- == Installation
6
-
7
- $ gem install tidings
8
-
9
- == Short example
10
-
11
- Tidings.watch('/Users/janice/Code') do |file_or_path, flags|
12
- if flags.include(:dir)
13
- puts "Change to directory: #{file_or_path}"
14
- else
15
- puts "Change to file: #{file_or_path}"
16
- end
17
- end
18
-
19
- == Long example
20
-
21
- module MyFileWatcher
22
- def self.call(file_or_path, flags)
23
- puts "#{file_or_path.inspect}:#{flags.inspect}"
24
- end
25
- end
26
-
27
- Tidings.watch('/Users/janice/Code', MyFileWatcher)