save_me 1.0.1 → 1.0.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 +46 -7
- data/lib/save_me/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94b459381452701de5d6cdc73fe022dc311df872
|
4
|
+
data.tar.gz: 08ef6b7db47d99214022b0c70eef5af97d31ff71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73c5f35ff29686e9c632719dffe622eff58042e082ffcacc8f4d7acc01f3d28e3c32e948ff5804482eb49c9f0eaf499710e93445a804b16f127fb7ccf3bfa0a3
|
7
|
+
data.tar.gz: f82610098ba1d05c2440cac14761d35feed4658923b070144d7cfc654ce2f23d45316839ed08be7251addfc767a6b2f0b0bccf88d12cb53eac8a9076f3cc42f9
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# SaveMe
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
SaveMe is a gem to store your data in an organized way. Let's say you have a script that saves the results in `results` file/folder and another run of this script (accidental or not) would overwrite your previous results. This is where SaveMe comes in. You put a one-liner in your code and your data is safe and organized.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,13 +20,54 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
Put this line in your code before you run your script
|
24
|
+
```ruby
|
25
|
+
SaveMe.call("path_to_what_you_want_to_copy", results_path: "./results", ymd: 0b110, params: { whatever: "you need here" })
|
26
|
+
```
|
27
|
+
|
28
|
+
First argument is a path to the file/folder you want to save.
|
29
|
+
|
30
|
+
Argument `results_path`(optional, default: "./") is a path to a folder where your results will be copied. If any directory in the path doesn't exist yet, it will be created by the gem.
|
31
|
+
|
32
|
+
Argument `ymd`(optional, default: `0b111`) is the folder structure. Notice it's in binary format. Each 1 or 0 corresponds to a letter in the `ymd`.
|
33
|
+
* `y` - year
|
34
|
+
* `m` - month
|
35
|
+
* `d` - day
|
36
|
+
|
37
|
+
A `1` creates a folder for a year/month/day, a `0` will put a year/month/day in the final folder name.
|
38
|
+
|
39
|
+
Examples:
|
40
|
+
* `0b111`
|
41
|
+
```ruby
|
42
|
+
SaveMe.call("results", results_path: "archive", ymd: 0b111, params: { test: "test" })
|
43
|
+
```
|
44
|
+
```
|
45
|
+
archive/
|
46
|
+
└── 2017
|
47
|
+
└── 4
|
48
|
+
└── 3
|
49
|
+
└── 10:16:18
|
50
|
+
├── params.json
|
51
|
+
└── results
|
52
|
+
└── results.json
|
53
|
+
```
|
26
54
|
|
27
|
-
|
55
|
+
* `0b110`
|
56
|
+
```ruby
|
57
|
+
SaveMe.call("results", results_path: "archive", ymd: 0b110, params: { test: "test" })
|
58
|
+
```
|
59
|
+
```
|
60
|
+
archive/
|
61
|
+
└── 2017
|
62
|
+
└── 4
|
63
|
+
└── 03_10:18:55
|
64
|
+
├── params.json
|
65
|
+
└── results
|
66
|
+
└── results.json
|
67
|
+
```
|
28
68
|
|
29
|
-
|
69
|
+
Argument `params`(optional, default: `nil`) will be saved as json file with your results so you don't need to remember what params were used to get those particular results.
|
30
70
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
71
|
|
33
72
|
## Contributing
|
34
73
|
|
data/lib/save_me/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: save_me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Januszkiewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03
|
11
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|