thrifty_file_applier 0.1.3 → 0.1.4
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/Gemfile.lock +1 -1
- data/README.md +8 -0
- data/lib/thrifty_file_applier/version.rb +1 -1
- data/lib/thrifty_file_applier.rb +6 -2
- data/sample/sample.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b182ac8ec44b18363dd385c06ecb2be25a59ee4739843a5a50acaf991b50cb
|
4
|
+
data.tar.gz: e10c9c36a3edd194e307cd0d4596f3bce1810fe4fcc13a46167795821687c6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83c1ca72d170b537be81f24f7d10f36fe9e3b24c69b0ee9edc45842cd4d7cc255a1976635cf90768454234f9d25571218783ee4bf105b45ef3f54357e21e5d26
|
7
|
+
data.tar.gz: 3a558bf863bcc064820c899c95c2dd9f4287c8c75eeb56492ccdb46ca11d9cb7341a068e6c4b97fd4ee4630c869960cdb8c15bab0610cbe184f280c86957d0ef
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -41,6 +41,14 @@ ThriftyFileApplier.applier("tmp/last_application_time", "source1", "source2") do
|
|
41
41
|
end
|
42
42
|
```
|
43
43
|
|
44
|
+
### Shorthands
|
45
|
+
If reusing applier was not needed, shorthands are available.
|
46
|
+
```ruby
|
47
|
+
ThriftyFileApplier.apply("tmp/last_application_time", "source") do
|
48
|
+
puts "compile"
|
49
|
+
end # => "compile"
|
50
|
+
```
|
51
|
+
|
44
52
|
## Development
|
45
53
|
|
46
54
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/thrifty_file_applier.rb
CHANGED
@@ -7,8 +7,12 @@ require "fileutils"
|
|
7
7
|
module ThriftyFileApplier
|
8
8
|
class Error < StandardError; end
|
9
9
|
|
10
|
-
def self.applier(last_execution_log_path,
|
11
|
-
Applier.new(last_execution_log_path,
|
10
|
+
def self.applier(last_execution_log_path, *source_paths, &executor)
|
11
|
+
Applier.new(last_execution_log_path, *source_paths, &executor)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.apply(last_execution_log_path, *source_paths, &executor)
|
15
|
+
applier(last_execution_log_path, *source_paths, &executor).apply
|
12
16
|
end
|
13
17
|
|
14
18
|
# Actual applier class.
|
data/sample/sample.rb
CHANGED
@@ -10,5 +10,12 @@ applier.apply # => compile
|
|
10
10
|
applier.apply # => nil
|
11
11
|
FileUtils.touch "source/file"
|
12
12
|
applier.apply # => compile
|
13
|
-
FileUtils.rm "
|
13
|
+
FileUtils.rm "tmp/last_application_time"
|
14
14
|
applier.apply # => compile
|
15
|
+
|
16
|
+
FileUtils.rm "tmp/last_application_time"
|
17
|
+
ThriftyFileApplier.apply("tmp/last_application_time", "source") do
|
18
|
+
puts "compile"
|
19
|
+
end # => "compile"
|
20
|
+
|
21
|
+
FileUtils.rm "source/file"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thrifty_file_applier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yudai Tanaka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|