simple_hot_folder 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +61 -0
- data/lib/simple_hot_folder/version.rb +1 -1
- data/simple_hot_folder.gemspec +1 -44
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5d628ab6d1c8b9f73a849e877a72e0524bf5560
|
4
|
+
data.tar.gz: 461a54314b24ab407e58fc931e506fb92a24ae55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8390e89d2d03a0fea0b116d8baf8922c50292263b68669c1d6c96dc14cb9e36b38f243296a154ae395ce756ce7be2796e498add73b825fbca1a4221fb10f9f8
|
7
|
+
data.tar.gz: 5d844e412483647632b54aa63bc3ea460dfe89d6cbb0513edb17eca499885e3bc1e30520c71cbd3ed32328138e86f37a16daa62af61bba4b7c57eb4cb3cbc2b3
|
data/README.md
CHANGED
@@ -1,2 +1,63 @@
|
|
1
1
|
# Simple Hot Folder
|
2
2
|
|
3
|
+
### NOTE
|
4
|
+
|
5
|
+
This gem is at an early stage of development. Please do not use it already.}
|
6
|
+
|
7
|
+
|
8
|
+
## Install
|
9
|
+
|
10
|
+
```bash
|
11
|
+
gem install simple_hot_folder
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'simple_hot_folder'
|
18
|
+
|
19
|
+
hot_folder = SimpleHotFolder.for_files(
|
20
|
+
'/path/to/input_folder',
|
21
|
+
'/path/to/error_folder',
|
22
|
+
'/path/to/output_folder'
|
23
|
+
)
|
24
|
+
|
25
|
+
# Successful
|
26
|
+
hot_folder.process_input! do |entry|
|
27
|
+
puts "Processing file #{entry.name}..."
|
28
|
+
puts "File path: #{entry.path}"
|
29
|
+
puts "Now, the file is automatically moved to the output folder"
|
30
|
+
end
|
31
|
+
|
32
|
+
# On error
|
33
|
+
hot_folder.process_input! do |entry|
|
34
|
+
puts "Processing file #{entry.name}..."
|
35
|
+
puts "File path: #{entry.path}"
|
36
|
+
puts "The file will be automatically moved to the error folder"
|
37
|
+
puts "A text file will be created with the error message ('Trigger error')"
|
38
|
+
puts "The process will continue with the next file"
|
39
|
+
raise 'Trigger error'
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
The MIT License
|
46
|
+
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
48
|
+
of this software and associated documentation files (the "Software"), to deal
|
49
|
+
in the Software without restriction, including without limitation the rights
|
50
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
51
|
+
copies of the Software, and to permit persons to whom the Software is
|
52
|
+
furnished to do so, subject to the following conditions:
|
53
|
+
|
54
|
+
The above copyright notice and this permission notice shall be included in
|
55
|
+
all copies or substantial portions of the Software.
|
56
|
+
|
57
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
58
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
59
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
60
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
61
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
62
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
63
|
+
THE SOFTWARE.
|
data/simple_hot_folder.gemspec
CHANGED
@@ -11,59 +11,16 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.email = ["galfus@gmail.com"]
|
12
12
|
s.date = Time.now.strftime('%Y-%m-%d')
|
13
13
|
s.summary = %q{A simple hot folder.}
|
14
|
-
s.description = %q{This
|
14
|
+
s.description = %q{This gem is at an early stage of development. Please do not use it already.}
|
15
15
|
s.licenses = ['MIT']
|
16
16
|
s.homepage = "https://gitlab.com/galfuslab/simple-hot-folder"
|
17
|
-
|
18
|
-
# s.required_ruby_version = '>= 2.1.0'
|
19
|
-
|
20
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
21
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
22
|
-
# if spec.respond_to?(:metadata)
|
23
|
-
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
24
|
-
# else
|
25
|
-
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
26
|
-
# end
|
27
|
-
|
28
|
-
# Jekyll
|
29
|
-
# s.files = all_files.grep(%r!^(exe|lib)/|^.rubocop.yml$!)
|
30
|
-
# s.executables = all_files.grep(%r!^exe/!) { |f| File.basename(f) }
|
31
|
-
|
32
|
-
# Colorize
|
33
|
-
# s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
-
# s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
-
|
36
|
-
# Custom
|
37
17
|
all_files = `git ls-files -z`.split("\x0")
|
38
18
|
s.files = all_files
|
39
19
|
.reject { |f| f.match(%r{^(test|spec|features|doc|tmp|pkg)/}) }
|
40
20
|
s.executables = all_files.grep(%r{^exe/}) { |f| File.basename(f) }
|
41
|
-
|
42
|
-
# spec.test_files = [
|
43
|
-
# 'test/bla-bla.rb'
|
44
|
-
# ]
|
45
|
-
|
46
21
|
s.bindir = "exe"
|
47
22
|
s.require_paths = ["lib"]
|
48
|
-
|
49
|
-
# s.add_runtime_dependency("addressable", "~> 2.4")
|
50
|
-
# s.add_runtime_dependency("dry-struct")
|
51
|
-
|
52
23
|
s.add_development_dependency "bundler", "~> 1.12"
|
53
24
|
s.add_development_dependency "rake", "~> 10.0"
|
54
25
|
s.add_development_dependency 'minitest', '~> 5.0'
|
55
|
-
|
56
|
-
# puts ''
|
57
|
-
# puts '------------ Configurando gem'
|
58
|
-
# puts ''
|
59
|
-
# puts 'All:'
|
60
|
-
# p all_files
|
61
|
-
# puts ''
|
62
|
-
# puts 'Files:'
|
63
|
-
# p s.files
|
64
|
-
# puts ''
|
65
|
-
# puts 'Execuables:'
|
66
|
-
# p s.executables
|
67
|
-
# puts '------------'
|
68
|
-
# puts ''
|
69
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_hot_folder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manu
|
@@ -52,8 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.0'
|
55
|
-
description: This
|
56
|
-
already.
|
55
|
+
description: This gem is at an early stage of development. Please do not use it already.
|
57
56
|
email:
|
58
57
|
- galfus@gmail.com
|
59
58
|
executables: []
|