rego 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +8 -0
  3. data/bin/rego +27 -159
  4. data/lib/rego/_lib.rb +4 -4
  5. data/rego.gemspec +5 -4
  6. metadata +13 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70783e05102258fdf51e66b7faee09e47739298b46b1f8f8adc8d0969a4a9e52
4
- data.tar.gz: 71fab4873bff533a3dd2dfec2b05a6567ecda8c1e9692a64c1e31c7e2bfd917f
3
+ metadata.gz: bb49b3d2016108b3dec5ada89bc0e68ab2a5910845a629926929f10510a62f2c
4
+ data.tar.gz: 27aac62ef93b549bb813978e17b1202c8b5af1ce06c4324fed147bcebbdc4bc2
5
5
  SHA512:
6
- metadata.gz: 18f97d4298c284803c987b56696d40935bd7fe6c1ed2d77da8e9e25d4ca3cc482f4e9fc80f61064a6c6ce1f5e2e669f8c049ea31cfc10d948f48ba7d09b7aee3
7
- data.tar.gz: 4f5325abee199099e64b09e68d58c93e49df2de54f8208f5887bb7bc1ced6ee9157fd34ac70bb5d3db2c2ba938703bbadb719324f2846080e12a39a081296937
6
+ metadata.gz: 9e4ae3bf5f6947650575517dc3d679983e119e724f50f9edf5e6474d850067439766633b2022a0c706d226ff4f4aeb89b85f18d8979d76eaaacb1a27f25f6dee
7
+ data.tar.gz: a9e310138224b88f4f4b3a9858a3a3dd3517f97c7525884a4a521d50e27425d72c0a7ecdda004aab34fd98b1a68ae90226384764d87ccf995c0c93d71eff7052
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ This.rubyforge_project = 'codeforpeople'
1
2
  This.author = "Ara T. Howard"
2
3
  This.email = "ara.t.howard@gmail.com"
3
4
  This.homepage = "https://github.com/ahoward/#{ This.lib }"
@@ -144,6 +145,7 @@ task :gemspec do
144
145
 
145
146
  spec.extensions.push(*<%= extensions.inspect %>)
146
147
 
148
+ spec.rubyforge_project = <%= This.rubyforge_project.inspect %>
147
149
  spec.author = <%= This.author.inspect %>
148
150
  spec.email = <%= This.email.inspect %>
149
151
  spec.homepage = <%= This.homepage.inspect %>
@@ -228,6 +230,12 @@ task :release => [:clean, :gemspec, :gem] do
228
230
  puts
229
231
  system(cmd)
230
232
  abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
233
+
234
+ cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.gem }"
235
+ puts cmd
236
+ puts
237
+ system(cmd)
238
+ abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
231
239
  end
232
240
 
233
241
 
data/bin/rego CHANGED
@@ -68,44 +68,19 @@ Main {
68
68
  @replacement = false
69
69
  end
70
70
 
71
- @paths, @command = @argv, command
71
+ _args, _command = @argv, command
72
+ _paths = _args.join(' ').strip.scan(/[^\s]+/)
72
73
 
73
- @paths = @paths.join(' ').strip.scan(/[^\s]+/)
74
- @command = @command.to_s.strip
75
-
76
- if @paths.empty?
77
- @paths.push('.')
74
+ if _paths.empty?
75
+ _paths.push '.'
78
76
  end
79
77
 
78
+ @paths = _args.join(' ').strip.scan(/[^\s]+/).sort.uniq
79
+ @command = _command.to_s.strip
80
+
80
81
  if @command.empty?
81
82
  @command = false
82
83
  end
83
-
84
- @paths.map! do |path|
85
- if test(?d, path)
86
- globbed =
87
- Dir.glob(
88
- File.join(path, '**/**'),
89
- File::FNM_DOTMATCH
90
- ).delete_if{|path| %w[ .. ].include?(File.basename(path))}
91
-
92
- [path, globbed]
93
- else
94
- path
95
- end
96
- end
97
-
98
- @paths.flatten!
99
- @paths.compact!
100
- @paths.uniq!
101
- @paths.map! do |path|
102
- begin
103
- Rego.realpath(path)
104
- rescue Object
105
- nil
106
- end
107
- end
108
- @paths.compact!
109
84
  end
110
85
 
111
86
  def print_a_summary_of_watched_files
@@ -191,144 +166,36 @@ Main {
191
166
  rego.call(:__START__)
192
167
 
193
168
  #
194
- fsevent = FSEvent.new
195
-
196
- options = {
197
- :latency => 0.01,
198
- :no_defer => true,
199
- :file_events => true,
200
- :since_when => 0
201
- }
202
169
 
203
- watchlist = (@files + @directories).uniq
204
-
205
- watching = watchlist.inject(Hash.new){|hash, path| hash.update(path => true)}
170
+ watchlist =
171
+ [].tap do |list|
172
+ @directories.each do |directory|
173
+ list.push directory
174
+ end
206
175
 
207
- fsevent.watch(watchlist, options) do |directories, meta|
208
- meta = Map.for(meta)
209
- events = meta.events
210
- paths = []
176
+ @files.each do |file|
177
+ list.push File.dirname(file)
178
+ end
211
179
 
212
- meta.events.each do |event|
213
- paths << event.path
180
+ list.flatten!
181
+ list.sort!
182
+ list.uniq!
214
183
  end
184
+
185
+ watching = watchlist.inject(Hash.new){|hash, path| hash.update(path => true)}
215
186
 
216
- paths.flatten.compact.sort.uniq.each do |path|
217
- path =
218
- begin
219
- Rego.realpath(path)
220
- rescue Object
221
- next
222
- end
223
-
224
- ignore = false # TODO
225
-
226
- unless ignore
227
- @initial_directories.each do |directory|
228
- if path =~ /^#{ Regexp.escape(directory) }\b/
229
- watching[path] = true
230
- end
231
- end
232
-
233
- if watching[path]
234
- before = stats[path]
235
- after = File.stat(path)
187
+ listener = Listen.to(*watchlist) do |modified, added, removed|
188
+ paths = [modified, added, removed].flatten.compact.sort.uniq
236
189
 
237
- if before.nil? or after.mtime > before.mtime
238
- stats[path] = after
239
- @started_at ||= Time.now.to_f
240
- q.push(path)
241
- end
242
- end
243
- end
190
+ paths.each do |path|
191
+ q.push(path)
244
192
  end
245
-
246
- =begin
247
- unless $running
248
- $running = true
249
-
250
- args.flatten.each do |dir|
251
- glob = File.join(dir, '**/**')
252
- entries = Dir.glob(glob)
253
-
254
- entries.each do |entry|
255
- entry = File.expand_path(entry)
256
- next unless stats.has_key?(entry)
257
-
258
- begin
259
- stats[entry] ||= File.stat(entry)
260
- before = stats[entry]
261
- after = File.stat(entry)
262
- rescue
263
- next
264
- end
265
-
266
- unless before.mtime == after.mtime
267
- stats[entry] = after
268
- rego[ entry ]
269
- end
270
- end
271
- end
272
- end
273
- $running = false
274
- =end
275
193
  end
276
194
 
277
- begin
278
- fsevent.run
279
- rescue SignalException
280
- exit(0)
281
- end
282
- end
283
- =begin
284
- fsevent = FSEvent.new
285
-
286
- fsevent.watch(
287
-
288
- @directories,
289
- :latency => 0.42,
290
- :no_defer => true,
291
- :file_events => true,
292
- :watch_root => true,
293
- :since_when => 0
294
-
295
- ) do |*args|
296
- unless $running
297
- $running = true
298
-
299
- args.flatten.each do |dir|
300
- glob = File.join(dir, '**/**')
301
- entries = Dir.glob(glob)
302
-
303
- entries.each do |entry|
304
- entry = File.expand_path(entry)
305
- next unless stats.has_key?(entry)
306
-
307
- begin
308
- stats[entry] ||= File.stat(entry)
309
- before = stats[entry]
310
- after = File.stat(entry)
311
- rescue
312
- next
313
- end
314
-
315
- unless before.mtime == after.mtime
316
- stats[entry] = after
317
- rego[ entry ]
318
- end
319
- end
320
- end
321
- end
322
- $running = false
323
- end
195
+ listener.start
324
196
 
325
- begin
326
- fsevent.run
327
- rescue SignalException
328
- exit(0)
329
- end
197
+ sleep
330
198
  end
331
- =end
332
199
  }
333
200
 
334
201
 
@@ -368,6 +235,7 @@ end
368
235
 
369
236
  require 'pathname'
370
237
  require 'thread'
238
+ require 'set'
371
239
 
372
240
  this = Pathname.new(__FILE__).realpath.to_s
373
241
  bindir = File.dirname(this)
data/lib/rego/_lib.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Rego
2
- Version = '2.2.0' unless defined?(Version)
2
+ Version = '3.0.0' unless defined?(Version)
3
3
 
4
4
  def Rego.version
5
5
  Rego::Version
@@ -7,9 +7,9 @@ module Rego
7
7
 
8
8
  def Rego.dependencies
9
9
  {
10
- 'main' => [ 'main' , ' ~> 6.3.0' ] ,
11
- 'map' => [ 'map' , ' ~> 6.6.0' ] ,
12
- 'rb-fsevent' => [ 'rb-fsevent' , ' ~> 0.11.2' ] ,
10
+ 'main' => [ 'main' , ' ~> 6.0' ] ,
11
+ 'map' => [ 'map' , ' ~> 6.6' ] ,
12
+ 'listen' => [ 'listen' , '~> 3.0' ] ,
13
13
  }
14
14
  end
15
15
 
data/rego.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "rego"
6
- spec.version = "2.2.0"
6
+ spec.version = "3.0.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "rego"
9
9
  spec.description = "description: rego kicks the ass"
@@ -28,15 +28,16 @@ Gem::Specification::new do |spec|
28
28
  spec.test_files = nil
29
29
 
30
30
 
31
- spec.add_dependency(*["main", " ~> 6.3.0"])
31
+ spec.add_dependency(*["main", " ~> 6.0"])
32
32
 
33
- spec.add_dependency(*["map", " ~> 6.6.0"])
33
+ spec.add_dependency(*["map", " ~> 6.6"])
34
34
 
35
- spec.add_dependency(*["rb-fsevent", " ~> 0.11.2"])
35
+ spec.add_dependency(*["listen", "~> 3.0"])
36
36
 
37
37
 
38
38
  spec.extensions.push(*[])
39
39
 
40
+ spec.rubyforge_project = "codeforpeople"
40
41
  spec.author = "Ara T. Howard"
41
42
  spec.email = "ara.t.howard@gmail.com"
42
43
  spec.homepage = "https://github.com/ahoward/rego"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rego
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ara T. Howard
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-24 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: main
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 6.3.0
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 6.3.0
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: map
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 6.6.0
33
+ version: '6.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 6.6.0
40
+ version: '6.6'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rb-fsevent
42
+ name: listen
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.11.2
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.11.2
54
+ version: '3.0'
55
55
  description: 'description: rego kicks the ass'
56
56
  email: ara.t.howard@gmail.com
57
57
  executables:
@@ -70,7 +70,7 @@ homepage: https://github.com/ahoward/rego
70
70
  licenses:
71
71
  - Ruby
72
72
  metadata: {}
73
- post_install_message:
73
+ post_install_message:
74
74
  rdoc_options: []
75
75
  require_paths:
76
76
  - lib
@@ -85,8 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubygems_version: 3.3.7
89
- signing_key:
88
+ rubygems_version: 3.0.3
89
+ signing_key:
90
90
  specification_version: 4
91
91
  summary: rego
92
92
  test_files: []