tidings 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3 -0
- data/README.md +31 -0
- data/ext/Makefile +12 -12
- data/ext/fs_event.bundle +0 -0
- data/ext/fs_event.o +0 -0
- data/lib/tidings/version.rb +1 -1
- data/lib/tidings/watcher.rb +13 -2
- metadata +5 -5
- data/README.rdoc +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 228de1321d524ee89a186eace9228e3623b196427da359390c4ea1cbd41a7895
|
4
|
+
data.tar.gz: 362d9e11a2c6787945ae39b2871a05e2e86dfe4f4e65380597a743189f5490dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 695ca41270ccf3733528294f19e4763fb2161d01b58923d21b89a8c790305a203e4b3e8c81bd21ee71a3f5a5906ba85dbeb2a3f9a1bc8008e9b840f332cfa760
|
7
|
+
data.tar.gz: 790e9090ee80303967de22507844ca594267386a89918d24a11b66a2e17f9f2eb8c7ce99f632d166c9f0e78ada63e535e50a985464fbdb92fd98f22097f5d115
|
data/CHANGELOG.md
ADDED
data/README.md
ADDED
@@ -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
|
+
````
|
data/ext/Makefile
CHANGED
@@ -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.
|
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.
|
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.
|
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
|
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
|
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.
|
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.
|
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 =
|
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-
|
105
|
+
arch = x86_64-darwin17
|
106
106
|
sitearch = $(arch)
|
107
|
-
ruby_version = 2.
|
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)
|
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
|
|
data/ext/fs_event.bundle
CHANGED
Binary file
|
data/ext/fs_event.o
CHANGED
Binary file
|
data/lib/tidings/version.rb
CHANGED
data/lib/tidings/watcher.rb
CHANGED
@@ -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
|
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.
|
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.
|
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:
|
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.
|
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
|
67
|
+
rubygems_version: 2.7.6
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: A platform optimized file-change watcher.
|
data/README.rdoc
DELETED
@@ -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)
|