fswatch-rb 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cabcaba7f96355f07e80ca8577d1af6977a7976093c9682a8d6fae76ad1884a1
4
- data.tar.gz: b2999f5a2dacef0eea46a0e92dd9b286bf2612602b1ed1b089eaded57409a03f
3
+ metadata.gz: 07d51a0528b244617035ba2f3680ab2bb672260ebc098db0fb74d5e886e18a63
4
+ data.tar.gz: 2920513f8fc56ff9b44e58fc64b1c7671c16758acb73405b2f0c8b20a969edf0
5
5
  SHA512:
6
- metadata.gz: '09c131fcb0dd838b7dc933c46dbdc5265ec934758251265aee89590181812b28bd8bd12c4731c1ed3568bf0e719588b5a1bd7e169f90f5d20b8f5e030e17028d'
7
- data.tar.gz: b70b7914fa11fd56d6e666174cd3ff744cc24ce8269d7240b715fde8adbf0dcde67adba938a787eabb9e5d69fe5ad67def5aeb7614d65a734edb9be480717f8c
6
+ metadata.gz: 5cd9264814810a5ceacd2529302b825982e095a9e8c72192e9e4414127ac550b2b7c60669b4cb515942219217a073792bc855be06d748a1ae4a11a3d29db387e
7
+ data.tar.gz: 71b970728d53327f46335e766b3df9f1a047d907a7969a52d11d8818ce44b3170fbda387ca6e7b63fc0a1bd562cfdc01a982d927cafc222b8e613793b7deb096
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # fswatch-rb
2
2
 
3
- fswatch-rb is binding for multi-platform fswatch library.
3
+ fswatch-rb is Ruby binding gem for multi-platform fswatch library.
4
4
 
5
5
  https://github.com/emcrisostomo/fswatch/
6
6
 
@@ -31,8 +31,6 @@ Or install it yourself as:
31
31
  ```ruby
32
32
  require 'fswatch'
33
33
 
34
- events_array = []
35
-
36
34
  watcher = Fswatch::Watcher.new(
37
35
  path: '~/my/awesome/project/directory/',
38
36
  event_flags: [:created, :updated, :is_file, :renamed, :removed],
@@ -15,7 +15,7 @@ void* fswatch_callback_handler_with_gvl(void* data) {
15
15
 
16
16
  VALUE rb_aEvents = rb_ary_new2(context->event_num);
17
17
 
18
- for (int i = 0 ; i < context->event_num ; i++) {
18
+ for (unsigned int i = 0 ; i < context->event_num ; i++) {
19
19
  const fsw_cevent event = context->events[i];
20
20
 
21
21
  VALUE rb_aEvent = rb_ary_new2(2 + event.flags_num);
@@ -23,7 +23,7 @@ void* fswatch_callback_handler_with_gvl(void* data) {
23
23
  rb_ary_push(rb_aEvent, rb_str_new2(event.path));
24
24
  rb_ary_push(rb_aEvent, INT2NUM(event.evt_time));
25
25
 
26
- for (int c = 0 ; c < event.flags_num ; c++) {
26
+ for (unsigned int c = 0 ; c < event.flags_num ; c++) {
27
27
  rb_ary_push(rb_aEvent, fswatch_event_name(event.flags[c]));
28
28
  }
29
29
 
@@ -1,6 +1,10 @@
1
1
  require 'mkmf'
2
2
 
3
- $CXXFLAGS += " -std=c++11 "
3
+
4
+ $CFLAGS += ' -Wall -Wextra '
5
+ $CXXFLAGS += ' -std=c++11 '
6
+
7
+ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
4
8
 
5
9
  HEADER_DIRS = [
6
10
  '/opt/local/include',
@@ -26,8 +30,4 @@ unless find_library('fswatch', 'fsw_init_library')
26
30
  abort "libfswatch is missing. please install libfswatch"
27
31
  end
28
32
 
29
- unless have_func('fsw_is_running')
30
- abort 'libfswatch version >= 1.11.3 is required. Please upgrade!'
31
- end
32
-
33
33
  create_makefile('fswatch/fswatch')
@@ -6,5 +6,10 @@ void Init_fswatch() {
6
6
 
7
7
  FSW_STATUS error = fsw_init_library();
8
8
 
9
+ if (error != FSW_OK) {
10
+ // unable to initialize fswatch library
11
+ rb_raise(rb_eRuntimeError, "Unable to initialize fswatch library!");
12
+ }
13
+
9
14
  init_fswatch_monitor();
10
15
  }
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fswatch-rb"
7
- spec.version = '0.1.2'
7
+ spec.version = '0.1.3'
8
8
  spec.authors = ['Igor Yamolov']
9
9
  spec.email = %w(clouster@yandex.ru)
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fswatch-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Yamolov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2018-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,7 +81,6 @@ files:
81
81
  - LICENSE.txt
82
82
  - README.md
83
83
  - Rakefile
84
- - ext/fswatch/Makefile
85
84
  - ext/fswatch/callback.c
86
85
  - ext/fswatch/configure.c
87
86
  - ext/fswatch/enums.c
@@ -1,264 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- # V=0 quiet, V=1 verbose. other values don't work.
5
- V = 0
6
- Q1 = $(V:1=)
7
- Q = $(Q1:0=@)
8
- ECHO1 = $(V:1=@ :)
9
- ECHO = $(ECHO1:0=@ echo)
10
- NULLCMD = :
11
-
12
- #### Start of system configuration section. ####
13
-
14
- srcdir = .
15
- topdir = /Users/tehkode/.rubies/ruby-2.4.2/include/ruby-2.4.0
16
- hdrdir = $(topdir)
17
- arch_hdrdir = /Users/tehkode/.rubies/ruby-2.4.2/include/ruby-2.4.0/x86_64-darwin16
18
- PATH_SEPARATOR = :
19
- VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
- prefix = $(DESTDIR)/Users/tehkode/.rubies/ruby-2.4.2
21
- rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
- rubyarchprefix = $(rubylibprefix)/$(arch)
23
- rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
24
- exec_prefix = $(prefix)
25
- vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
26
- sitearchhdrdir = $(sitehdrdir)/$(sitearch)
27
- rubyarchhdrdir = $(rubyhdrdir)/$(arch)
28
- vendorhdrdir = $(rubyhdrdir)/vendor_ruby
29
- sitehdrdir = $(rubyhdrdir)/site_ruby
30
- rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
- vendorarchdir = $(vendorlibdir)/$(sitearch)
32
- vendorlibdir = $(vendordir)/$(ruby_version)
33
- vendordir = $(rubylibprefix)/vendor_ruby
34
- sitearchdir = $(sitelibdir)/$(sitearch)
35
- sitelibdir = $(sitedir)/$(ruby_version)
36
- sitedir = $(rubylibprefix)/site_ruby
37
- rubyarchdir = $(rubylibdir)/$(arch)
38
- rubylibdir = $(rubylibprefix)/$(ruby_version)
39
- sitearchincludedir = $(includedir)/$(sitearch)
40
- archincludedir = $(includedir)/$(arch)
41
- sitearchlibdir = $(libdir)/$(sitearch)
42
- archlibdir = $(libdir)/$(arch)
43
- ridir = $(datarootdir)/$(RI_BASE_NAME)
44
- mandir = $(datarootdir)/man
45
- localedir = $(datarootdir)/locale
46
- libdir = $(exec_prefix)/lib
47
- psdir = $(docdir)
48
- pdfdir = $(docdir)
49
- dvidir = $(docdir)
50
- htmldir = $(docdir)
51
- infodir = $(datarootdir)/info
52
- docdir = $(datarootdir)/doc/$(PACKAGE)
53
- oldincludedir = $(SDKROOT)/usr/include
54
- includedir = $(prefix)/include
55
- localstatedir = $(prefix)/var
56
- sharedstatedir = $(prefix)/com
57
- sysconfdir = $(prefix)/etc
58
- datadir = $(datarootdir)
59
- datarootdir = $(prefix)/share
60
- libexecdir = $(exec_prefix)/libexec
61
- sbindir = $(exec_prefix)/sbin
62
- bindir = $(exec_prefix)/bin
63
- archdir = $(rubyarchdir)
64
-
65
-
66
- CC = clang
67
- CXX = clang++
68
- LIBRUBY = $(LIBRUBY_A)
69
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
70
- LIBRUBYARG_SHARED =
71
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
72
- empty =
73
- OUTFLAG = -o $(empty)
74
- COUTFLAG = -o $(empty)
75
- CSRCFLAG = $(empty)
76
-
77
- RUBY_EXTCONF_H =
78
- cflags = $(optflags) $(debugflags) $(warnflags)
79
- cxxflags = $(optflags) $(debugflags) $(warnflags)
80
- optflags = -O3 -fno-fast-math
81
- debugflags = -ggdb3
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
- CCDLFLAGS = -fno-common
84
- CFLAGS = $(CCDLFLAGS) -O3 -Wno-error=shorten-64-to-32 -pipe $(ARCH_FLAG)
85
- INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
86
- DEFS =
87
- CPPFLAGS = -I/usr/local/include -I/usr/include -I/Users/tehkode/.rubies/ruby-2.4.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
88
- CXXFLAGS = $(CCDLFLAGS) $(cxxflags) -std=c++11 $(ARCH_FLAG)
89
- ldflags = -L. -L/Users/tehkode/.rubies/ruby-2.4.2/lib -fstack-protector -L/usr/local/lib
90
- dldflags = -L/Users/tehkode/.rubies/ruby-2.4.2/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
91
- ARCH_FLAG =
92
- DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
93
- LDSHARED = $(CC) -dynamic -bundle
94
- LDSHAREDXX = $(CXX) -dynamic -bundle
95
- AR = ar
96
- EXEEXT =
97
-
98
- RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
99
- RUBY_SO_NAME = ruby
100
- RUBYW_INSTALL_NAME =
101
- RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
102
- RUBYW_BASE_NAME = rubyw
103
- RUBY_BASE_NAME = ruby
104
-
105
- arch = x86_64-darwin16
106
- sitearch = $(arch)
107
- ruby_version = 2.4.0
108
- ruby = $(bindir)/$(RUBY_BASE_NAME)
109
- RUBY = $(ruby)
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
111
-
112
- RM = rm -f
113
- RM_RF = $(RUBY) -run -e rm -- -rf
114
- RMDIRS = rmdir -p
115
- MAKEDIRS = mkdir -p
116
- INSTALL = /usr/bin/install -c
117
- INSTALL_PROG = $(INSTALL) -m 0755
118
- INSTALL_DATA = $(INSTALL) -m 644
119
- COPY = cp
120
- TOUCH = exit >
121
-
122
- #### End of system configuration section. ####
123
-
124
- preload =
125
- libpath = . $(libdir) /usr/local/lib /usr/lib
126
- LIBPATH = -L. -L$(libdir) -L/usr/local/lib -L/usr/lib
127
- DEFFILE =
128
-
129
- CLEANFILES = mkmf.log
130
- DISTCLEANFILES =
131
- DISTCLEANDIRS =
132
-
133
- extout =
134
- extout_prefix =
135
- target_prefix = /fswatch
136
- LOCAL_LIBS =
137
- LIBS = -lfswatch -lpthread -ldl -lobjc
138
- ORIG_SRCS = callback.c enums.c fswatch.c listener.c
139
- SRCS = $(ORIG_SRCS) enums.c callback.c fswatch.c listener.c
140
- OBJS = enums.o callback.o fswatch.o listener.o
141
- HDRS = $(srcdir)/fswatch.h
142
- LOCAL_HDRS =
143
- TARGET = fswatch
144
- TARGET_NAME = fswatch
145
- TARGET_ENTRY = Init_$(TARGET_NAME)
146
- DLLIB = $(TARGET).bundle
147
- EXTSTATIC =
148
- STATIC_LIB =
149
-
150
- TIMESTAMP_DIR = .
151
- BINDIR = $(bindir)
152
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
153
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
154
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
155
- HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
156
- ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
157
- TARGET_SO_DIR =
158
- TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
159
- CLEANLIBS = $(TARGET_SO)
160
- CLEANOBJS = *.o *.bak
161
-
162
- all: $(DLLIB)
163
- static: $(STATIC_LIB)
164
- .PHONY: all install static install-so install-rb
165
- .PHONY: clean clean-so clean-static clean-rb
166
-
167
- clean-static::
168
- clean-rb-default::
169
- clean-rb::
170
- clean-so::
171
- clean: clean-so clean-static clean-rb-default clean-rb
172
- -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
173
-
174
- distclean-rb-default::
175
- distclean-rb::
176
- distclean-so::
177
- distclean-static::
178
- distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
179
- -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
180
- -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
181
- -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
182
-
183
- realclean: distclean
184
- install: install-so install-rb
185
-
186
- install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.-.fswatch.time
187
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
188
- clean-static::
189
- -$(Q)$(RM) $(STATIC_LIB)
190
- install-rb: pre-install-rb do-install-rb install-rb-default
191
- install-rb-default: pre-install-rb-default do-install-rb-default
192
- pre-install-rb: Makefile
193
- pre-install-rb-default: Makefile
194
- do-install-rb:
195
- do-install-rb-default:
196
- pre-install-rb-default:
197
- @$(NULLCMD)
198
- $(TIMESTAMP_DIR)/.sitearchdir.-.fswatch.time:
199
- $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
200
- $(Q) $(TOUCH) $@
201
-
202
- site-install: site-install-so site-install-rb
203
- site-install-so: install-so
204
- site-install-rb: install-rb
205
-
206
- .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
207
-
208
- .cc.o:
209
- $(ECHO) compiling $(<)
210
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
211
-
212
- .cc.S:
213
- $(ECHO) translating $(<)
214
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
215
-
216
- .mm.o:
217
- $(ECHO) compiling $(<)
218
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
219
-
220
- .mm.S:
221
- $(ECHO) translating $(<)
222
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
223
-
224
- .cxx.o:
225
- $(ECHO) compiling $(<)
226
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
227
-
228
- .cxx.S:
229
- $(ECHO) translating $(<)
230
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
231
-
232
- .cpp.o:
233
- $(ECHO) compiling $(<)
234
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
235
-
236
- .cpp.S:
237
- $(ECHO) translating $(<)
238
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
239
-
240
- .c.o:
241
- $(ECHO) compiling $(<)
242
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
243
-
244
- .c.S:
245
- $(ECHO) translating $(<)
246
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
247
-
248
- .m.o:
249
- $(ECHO) compiling $(<)
250
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
251
-
252
- .m.S:
253
- $(ECHO) translating $(<)
254
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
255
-
256
- $(TARGET_SO): $(OBJS) Makefile
257
- $(ECHO) linking shared-object fswatch/$(DLLIB)
258
- -$(Q)$(RM) $(@)
259
- $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
260
- $(Q) $(POSTLINK)
261
-
262
-
263
-
264
- $(OBJS): $(HDRS) $(ruby_headers)