hanami-utils 1.3.6 → 2.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -21
- data/README.md +4 -13
- data/hanami-utils.gemspec +18 -16
- data/lib/hanami-utils.rb +3 -1
- data/lib/hanami/interactor.rb +16 -14
- data/lib/hanami/logger.rb +6 -6
- data/lib/hanami/logger/filter.rb +1 -12
- data/lib/hanami/logger/formatter.rb +3 -3
- data/lib/hanami/middleware.rb +11 -0
- data/lib/hanami/utils.rb +11 -25
- data/lib/hanami/utils/basic_object.rb +3 -63
- data/lib/hanami/utils/blank.rb +7 -7
- data/lib/hanami/utils/callbacks.rb +21 -2
- data/lib/hanami/utils/class.rb +4 -53
- data/lib/hanami/utils/class_attribute.rb +23 -12
- data/lib/hanami/utils/class_attribute/attributes.rb +45 -0
- data/lib/hanami/utils/deprecation.rb +3 -1
- data/lib/hanami/utils/escape.rb +267 -265
- data/lib/hanami/utils/file_list.rb +3 -1
- data/lib/hanami/utils/files.rb +3 -30
- data/lib/hanami/utils/hash.rb +13 -340
- data/lib/hanami/utils/io.rb +2 -0
- data/lib/hanami/utils/json.rb +5 -3
- data/lib/hanami/utils/kernel.rb +16 -14
- data/lib/hanami/utils/load_paths.rb +5 -3
- data/lib/hanami/utils/path_prefix.rb +6 -4
- data/lib/hanami/utils/query_string.rb +1 -1
- data/lib/hanami/utils/shell_color.rb +2 -2
- data/lib/hanami/utils/string.rb +35 -100
- data/lib/hanami/utils/version.rb +3 -1
- metadata +10 -10
- data/lib/hanami/utils/duplicable.rb +0 -80
- data/lib/hanami/utils/inflector.rb +0 -494
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d4523d52299280469a80451592c55d5771aeaf8e0f93644291f5e9d7a66237a
|
4
|
+
data.tar.gz: 27c144da73fcbd992b4fefdddb9dc1b5be1e58b5abff3fd4078c67f8ec561d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0e48686597a78927e05bff5da29e0ba0db65f8a03796b36046bb6f84cf35bf964662a87a73bad88bca47096b2b51e737bee0b0545f7341cbbd3579c4e74d4bf
|
7
|
+
data.tar.gz: ebf2deed3ccf571a88ffd151d544254d483f65f26c5bf027c78cbe31220b22afc6b0c9f5b7a6223dd685c553b41fb80c2fe4a7b2a3629d4ab1cdfc5f9293e038
|
data/CHANGELOG.md
CHANGED
@@ -1,29 +1,22 @@
|
|
1
1
|
# Hanami::Utils
|
2
2
|
Ruby core extentions and class utilities for Hanami
|
3
3
|
|
4
|
-
##
|
4
|
+
## v2.0.0.alpha1 - 2019-01-30
|
5
5
|
### Added
|
6
|
-
- [
|
6
|
+
- [Gustavo Caso] Introduce `Hanami::Middleware` namespace
|
7
|
+
- [Luca Guidi] Introduce `Callbacks::Chain#dup`
|
7
8
|
|
8
|
-
###
|
9
|
-
- [
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
- [
|
14
|
-
- [Luca Guidi]
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
- [
|
19
|
-
|
20
|
-
## v1.3.3 - 2019-09-13
|
21
|
-
### Fixed
|
22
|
-
- [Mauro Morales] Ensure `Utils::Inflector.pluralize` and `.singularize` to work with words that contain an underscore (`_`)
|
23
|
-
|
24
|
-
## v1.3.2 - 2019-06-21
|
25
|
-
### Added
|
26
|
-
- [Vladislav Yashin & Luca Guidi] Added `Utils::BasicObject#instance_of?`, `#is_a?`, and `#kind_of`
|
9
|
+
### Changed
|
10
|
+
- [Luca Guidi] Drop support for Ruby: MRI 2.3, and 2.4.
|
11
|
+
- [Luca Guidi] Remove `Utils::Duplicable`
|
12
|
+
- [Luca Guidi] Remove `Utils::Inflector`
|
13
|
+
- [Luca Guidi] Remove `Utils::String.singularize`, and `.pluralize`
|
14
|
+
- [Luca Guidi] Remove `Utils::String#singularize`, and `#pluralize`
|
15
|
+
- [Luca Guidi] Remove instance level interface for `Utils::Hash`
|
16
|
+
- [Luca Guidi] Transform `Utils::Hash` from class to module
|
17
|
+
- [Luca Guidi] Remove `Utils.reload!`
|
18
|
+
- [Gustavo Caso] Remove `Utils::File.rewrite`
|
19
|
+
- [Vladimir Suvorov] Remove `Utils::Class.load_from_pattern!`
|
27
20
|
|
28
21
|
## v1.3.1 - 2019-01-18
|
29
22
|
### Added
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Ruby core extensions and class utilities for [Hanami](http://hanamirb.org)
|
|
5
5
|
## Status
|
6
6
|
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/hanami-utils.svg)](https://badge.fury.io/rb/hanami-utils)
|
8
|
-
[![
|
8
|
+
[![TravisCI](https://travis-ci.org/hanami/utils.svg?branch=master)](https://travis-ci.org/hanami/utils)
|
9
9
|
[![CircleCI](https://circleci.com/gh/hanami/utils/tree/master.svg?style=svg)](https://circleci.com/gh/hanami/utils/tree/master)
|
10
10
|
[![Test Coverage](https://codecov.io/gh/hanami/utils/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/utils)
|
11
11
|
[![Depfu](https://badges.depfu.com/badges/a8545fb67cf32a2c75b6227bc0821027/overview.svg)](https://depfu.com/github/hanami/utils?project=Bundler)
|
@@ -22,7 +22,7 @@ Ruby core extensions and class utilities for [Hanami](http://hanamirb.org)
|
|
22
22
|
|
23
23
|
## Rubies
|
24
24
|
|
25
|
-
__Hanami::Utils__ supports Ruby (MRI) 2.
|
25
|
+
__Hanami::Utils__ supports Ruby (MRI) 2.5+
|
26
26
|
|
27
27
|
## Installation
|
28
28
|
|
@@ -79,11 +79,6 @@ Inheritable class attributes. [[API doc](http://www.rubydoc.info/gems/hanami-uti
|
|
79
79
|
|
80
80
|
Deprecate Hanami features. [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/Deprecation)]
|
81
81
|
|
82
|
-
### Hanami::Utils::Duplicable
|
83
|
-
|
84
|
-
Safe `#dup` logic for Ruby objects. [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/Duplicable)]
|
85
|
-
|
86
|
-
|
87
82
|
### Hanami::Utils::Escape
|
88
83
|
|
89
84
|
Safe and fast escape for URLs, HTML content and attributes. Based on OWASP/ESAPI code. [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/Escape)]
|
@@ -98,16 +93,12 @@ File utilities to manipulate files and directories. [[API doc](http://www.rubydo
|
|
98
93
|
|
99
94
|
### Hanami::Utils::Hash
|
100
95
|
|
101
|
-
|
96
|
+
`Hash` transformations. [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/Hash)]
|
102
97
|
|
103
98
|
### Hanami::Utils::IO
|
104
99
|
|
105
100
|
Silence Ruby warnings. [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/IO)]
|
106
101
|
|
107
|
-
### Hanami::Utils::Inflector
|
108
|
-
|
109
|
-
Complete and customizable english inflections (pluralization and singularization). [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/Inflector)]
|
110
|
-
|
111
102
|
### Hanami::Utils::Json
|
112
103
|
|
113
104
|
JSON engine with swappable backends (via optional `multi_json` gem) or powered by Ruby's `json` (default). [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/Json)]
|
@@ -150,6 +141,6 @@ __Hanami::Utils__ uses [Semantic Versioning 2.0.0](http://semver.org)
|
|
150
141
|
|
151
142
|
## Copyright
|
152
143
|
|
153
|
-
Copyright © 2014-
|
144
|
+
Copyright © 2014-2019 Luca Guidi – Released under MIT License
|
154
145
|
|
155
146
|
This project was formerly known as Lotus (`lotus-utils`).
|
data/hanami-utils.gemspec
CHANGED
@@ -1,27 +1,29 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require
|
5
|
+
require "hanami/utils/version"
|
4
6
|
|
5
7
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
8
|
+
spec.name = "hanami-utils"
|
7
9
|
spec.version = Hanami::Utils::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
10
|
-
spec.description =
|
11
|
-
spec.summary =
|
12
|
-
spec.homepage =
|
13
|
-
spec.license =
|
10
|
+
spec.authors = ["Luca Guidi"]
|
11
|
+
spec.email = ["me@lucaguidi.com"]
|
12
|
+
spec.description = "Hanami utilities"
|
13
|
+
spec.summary = "Ruby core extentions and Hanami utilities"
|
14
|
+
spec.homepage = "http://hanamirb.org"
|
15
|
+
spec.license = "MIT"
|
14
16
|
|
15
17
|
spec.files = `git ls-files -- lib/* CHANGELOG.md LICENSE.md README.md hanami-utils.gemspec`.split($/)
|
16
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
-
spec.require_paths = [
|
19
|
-
spec.required_ruby_version =
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
spec.required_ruby_version = ">= 2.5.0"
|
20
22
|
|
21
|
-
spec.add_dependency
|
22
|
-
spec.add_dependency
|
23
|
+
spec.add_dependency "transproc", "~> 1.0"
|
24
|
+
spec.add_dependency "concurrent-ruby", "~> 1.0"
|
23
25
|
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
26
|
+
spec.add_development_dependency "bundler", ">= 1.6", "< 3"
|
27
|
+
spec.add_development_dependency "rake", "~> 12"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.7"
|
27
29
|
end
|
data/lib/hanami-utils.rb
CHANGED
data/lib/hanami/interactor.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "hanami/utils/basic_object"
|
4
|
+
require "hanami/utils/class_attribute"
|
5
|
+
require "hanami/utils/hash"
|
4
6
|
|
5
7
|
module Hanami
|
6
8
|
# Hanami Interactor
|
@@ -40,7 +42,7 @@ module Hanami
|
|
40
42
|
@success = true
|
41
43
|
end
|
42
44
|
|
43
|
-
#
|
45
|
+
# Check if the current status is successful
|
44
46
|
#
|
45
47
|
# @return [TrueClass,FalseClass] the result of the check
|
46
48
|
#
|
@@ -52,7 +54,7 @@ module Hanami
|
|
52
54
|
# @since 0.3.5
|
53
55
|
alias success? successful?
|
54
56
|
|
55
|
-
#
|
57
|
+
# Check if the current status is not successful
|
56
58
|
#
|
57
59
|
# @return [TrueClass,FalseClass] the result of the check
|
58
60
|
#
|
@@ -61,7 +63,7 @@ module Hanami
|
|
61
63
|
!successful?
|
62
64
|
end
|
63
65
|
|
64
|
-
#
|
66
|
+
# Force the status to be a failure
|
65
67
|
#
|
66
68
|
# @since 0.3.5
|
67
69
|
def fail!
|
@@ -104,7 +106,7 @@ module Hanami
|
|
104
106
|
errors.first
|
105
107
|
end
|
106
108
|
|
107
|
-
#
|
109
|
+
# Prepare the result before to be returned
|
108
110
|
#
|
109
111
|
# @param payload [Hash] an updated payload
|
110
112
|
#
|
@@ -377,7 +379,7 @@ module Hanami
|
|
377
379
|
|
378
380
|
private
|
379
381
|
|
380
|
-
#
|
382
|
+
# Check if proceed with <tt>#call</tt> invokation.
|
381
383
|
# By default it returns <tt>true</tt>.
|
382
384
|
#
|
383
385
|
# Developers can override it.
|
@@ -389,7 +391,7 @@ module Hanami
|
|
389
391
|
true
|
390
392
|
end
|
391
393
|
|
392
|
-
#
|
394
|
+
# Fail and interrupt the current flow.
|
393
395
|
#
|
394
396
|
# @since 0.3.5
|
395
397
|
#
|
@@ -428,7 +430,7 @@ module Hanami
|
|
428
430
|
throw :fail
|
429
431
|
end
|
430
432
|
|
431
|
-
#
|
433
|
+
# Log an error without interrupting the flow.
|
432
434
|
#
|
433
435
|
# When used, the returned result won't be successful.
|
434
436
|
#
|
@@ -483,7 +485,7 @@ module Hanami
|
|
483
485
|
false
|
484
486
|
end
|
485
487
|
|
486
|
-
#
|
488
|
+
# Log an error AND interrupting the flow.
|
487
489
|
#
|
488
490
|
# When used, the returned result won't be successful.
|
489
491
|
#
|
@@ -546,7 +548,7 @@ module Hanami
|
|
546
548
|
# @since 0.5.0
|
547
549
|
# @api private
|
548
550
|
def _exposures
|
549
|
-
Hash[].tap do |result|
|
551
|
+
::Hash[].tap do |result|
|
550
552
|
self.class.exposures.each do |name, ivar|
|
551
553
|
result[name] = instance_variable_defined?(ivar) ? instance_variable_get(ivar) : nil
|
552
554
|
end
|
@@ -579,7 +581,7 @@ module Hanami
|
|
579
581
|
end
|
580
582
|
end
|
581
583
|
|
582
|
-
#
|
584
|
+
# Expose local instance variables into the returning value of <tt>#call</tt>
|
583
585
|
#
|
584
586
|
# @param instance_variable_names [Symbol,Array<Symbol>] one or more instance
|
585
587
|
# variable names
|
@@ -588,7 +590,7 @@ module Hanami
|
|
588
590
|
#
|
589
591
|
# @see Hanami::Interactor::Result
|
590
592
|
#
|
591
|
-
# @example
|
593
|
+
# @example Expose instance variable
|
592
594
|
#
|
593
595
|
# class Signup
|
594
596
|
# include Hanami::Interactor
|
data/lib/hanami/logger.rb
CHANGED
@@ -7,7 +7,7 @@ require "hanami/utils/files"
|
|
7
7
|
module Hanami
|
8
8
|
# Hanami logger
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# Implement with the same interface of Ruby std lib `Logger`.
|
11
11
|
# It uses `STDOUT`, `STDERR`, file name or open file as output stream.
|
12
12
|
#
|
13
13
|
#
|
@@ -16,7 +16,7 @@ module Hanami
|
|
16
16
|
#
|
17
17
|
# This is useful for auto-tagging the output. Eg (`app=Booshelf`).
|
18
18
|
#
|
19
|
-
# When used
|
19
|
+
# When used stand alone (eg. `Hanami::Logger.info`), it tags lines with `app=Shared`.
|
20
20
|
#
|
21
21
|
#
|
22
22
|
# The available severity levels are the same of `Logger`:
|
@@ -30,7 +30,7 @@ module Hanami
|
|
30
30
|
#
|
31
31
|
# Those levels are available both as class and instance methods.
|
32
32
|
#
|
33
|
-
# Also Hanami::Logger
|
33
|
+
# Also Hanami::Logger support different formatters. Now available only two:
|
34
34
|
#
|
35
35
|
# * Formatter (default)
|
36
36
|
# * JSONFormatter
|
@@ -279,7 +279,7 @@ module Hanami
|
|
279
279
|
# logger.info "Hello World"
|
280
280
|
#
|
281
281
|
# # => {"app":"Hanami","severity":"DEBUG","time":"2017-03-30T13:57:59Z","message":"Hello World"}
|
282
|
-
# rubocop:disable Lint/
|
282
|
+
# rubocop:disable Lint/HandleExceptions
|
283
283
|
# rubocop:disable Metrics/ParameterLists
|
284
284
|
def initialize(application_name = nil, *args, stream: $stdout, level: DEBUG, formatter: nil, filter: [], colorizer: nil)
|
285
285
|
begin
|
@@ -296,7 +296,7 @@ module Hanami
|
|
296
296
|
end
|
297
297
|
|
298
298
|
# rubocop:enable Metrics/ParameterLists
|
299
|
-
# rubocop:enable Lint/
|
299
|
+
# rubocop:enable Lint/HandleExceptions
|
300
300
|
|
301
301
|
# Returns the current application name, this is used for tagging purposes
|
302
302
|
#
|
@@ -313,7 +313,7 @@ module Hanami
|
|
313
313
|
super _level(value)
|
314
314
|
end
|
315
315
|
|
316
|
-
#
|
316
|
+
# Close the logging stream if this stream isn't an STDOUT
|
317
317
|
#
|
318
318
|
# @since 0.8.0
|
319
319
|
def close
|
data/lib/hanami/logger/filter.rb
CHANGED
@@ -42,7 +42,7 @@ module Hanami
|
|
42
42
|
# @api private
|
43
43
|
def _key_paths(hash, base = nil)
|
44
44
|
hash.inject([]) do |results, (k, v)|
|
45
|
-
results + (
|
45
|
+
results + (v.respond_to?(:each) ? _key_paths(v, _build_path(base, k)) : [_build_path(base, k)])
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -63,17 +63,6 @@ module Hanami
|
|
63
63
|
res + [correct_key]
|
64
64
|
end
|
65
65
|
end
|
66
|
-
|
67
|
-
# Check if the given value can be iterated (`Enumerable`) and that isn't a `File`.
|
68
|
-
# This is useful to detect closed `Tempfiles`.
|
69
|
-
#
|
70
|
-
# @since 1.3.5
|
71
|
-
# @api private
|
72
|
-
#
|
73
|
-
# @see https://github.com/hanami/utils/pull/342
|
74
|
-
def _key_paths?(value)
|
75
|
-
value.is_a?(Enumerable) && !value.is_a?(File)
|
76
|
-
end
|
77
66
|
end
|
78
67
|
end
|
79
68
|
end
|
@@ -105,16 +105,16 @@ module Hanami
|
|
105
105
|
# @api private
|
106
106
|
def _message_hash(message) # rubocop:disable Metrics/MethodLength
|
107
107
|
case message
|
108
|
-
when Hash
|
108
|
+
when ::Hash
|
109
109
|
@filter.call(message)
|
110
110
|
when Exception
|
111
|
-
Hash[
|
111
|
+
::Hash[
|
112
112
|
message: message.message,
|
113
113
|
backtrace: message.backtrace || [],
|
114
114
|
error: message.class
|
115
115
|
]
|
116
116
|
else
|
117
|
-
Hash[message: message]
|
117
|
+
::Hash[message: message]
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
data/lib/hanami/utils.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pathname"
|
2
4
|
|
3
5
|
# Hanami - The web, with simplicity
|
4
6
|
#
|
5
7
|
# @since 0.1.0
|
6
8
|
module Hanami
|
7
|
-
require
|
8
|
-
require
|
9
|
+
require "hanami/utils/version"
|
10
|
+
require "hanami/utils/file_list"
|
9
11
|
|
10
12
|
# Ruby core extentions and Hanami utilities
|
11
13
|
#
|
@@ -13,15 +15,15 @@ module Hanami
|
|
13
15
|
module Utils
|
14
16
|
# @since 0.3.1
|
15
17
|
# @api private
|
16
|
-
HANAMI_JRUBY =
|
18
|
+
HANAMI_JRUBY = "java"
|
17
19
|
|
18
20
|
# @since 0.3.1
|
19
21
|
# @api private
|
20
|
-
HANAMI_RUBINIUS =
|
22
|
+
HANAMI_RUBINIUS = "rbx"
|
21
23
|
|
22
24
|
# Checks if the current VM is JRuby
|
23
25
|
#
|
24
|
-
# @return [TrueClass,FalseClass]
|
26
|
+
# @return [TrueClass,FalseClass] return if the VM is JRuby or not
|
25
27
|
#
|
26
28
|
# @since 0.3.1
|
27
29
|
# @api private
|
@@ -31,7 +33,7 @@ module Hanami
|
|
31
33
|
|
32
34
|
# Checks if the current VM is Rubinius
|
33
35
|
#
|
34
|
-
# @return [TrueClass,FalseClass]
|
36
|
+
# @return [TrueClass,FalseClass] return if the VM is Rubinius or not
|
35
37
|
#
|
36
38
|
# @since 0.3.1
|
37
39
|
# @api private
|
@@ -39,7 +41,7 @@ module Hanami
|
|
39
41
|
RUBY_ENGINE == HANAMI_RUBINIUS
|
40
42
|
end
|
41
43
|
|
42
|
-
# Recursively
|
44
|
+
# Recursively require Ruby files under the given directory.
|
43
45
|
#
|
44
46
|
# If the directory is relative, it implies it's the path from current directory.
|
45
47
|
# If the directory is absolute, it uses as it is.
|
@@ -54,22 +56,6 @@ module Hanami
|
|
54
56
|
for_each_file_in(directory) { |file| require_relative(file) }
|
55
57
|
end
|
56
58
|
|
57
|
-
# Recursively reloads Ruby files under the given directory.
|
58
|
-
#
|
59
|
-
# If the directory is relative, it implies it's the path from current directory.
|
60
|
-
# If the directory is absolute, it uses as it is.
|
61
|
-
#
|
62
|
-
# It respects file separator of the current operating system.
|
63
|
-
# A pattern like <tt>"path/to/files"</tt> will work both on *NIX and Windows machines.
|
64
|
-
#
|
65
|
-
# @param directory [String, Pathname] the directory
|
66
|
-
#
|
67
|
-
# @since 1.0.0
|
68
|
-
# @api private
|
69
|
-
def self.reload!(directory)
|
70
|
-
for_each_file_in(directory) { |file| load(file) }
|
71
|
-
end
|
72
|
-
|
73
59
|
# Recursively scans through the given directory and yields the given block
|
74
60
|
# for each Ruby source file.
|
75
61
|
#
|
@@ -87,7 +73,7 @@ module Hanami
|
|
87
73
|
def self.for_each_file_in(directory, &blk)
|
88
74
|
directory = directory.to_s.gsub(%r{(\/|\\)}, File::SEPARATOR)
|
89
75
|
directory = Pathname.new(Dir.pwd).join(directory).to_s
|
90
|
-
directory = File.join(directory,
|
76
|
+
directory = File.join(directory, "**", "*.rb") unless directory =~ /(\*\*)/
|
91
77
|
|
92
78
|
FileList[directory].each(&blk)
|
93
79
|
end
|