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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +46 -7
  3. data/lib/save_me/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fea807550b555780fea5136d5711a2f3db45dd41
4
- data.tar.gz: 9aafba1e224f9d1aec1e4cec766ef4e54d3901d4
3
+ metadata.gz: 94b459381452701de5d6cdc73fe022dc311df872
4
+ data.tar.gz: 08ef6b7db47d99214022b0c70eef5af97d31ff71
5
5
  SHA512:
6
- metadata.gz: 346ade4f570eae26405a7991549a596a018e5c67fd04168cef87b6cdea7b7db6844f2ec6ca6e9b52d10d55a2c1a7b59c9ba80e4d176425c0a52edcb791fd1357
7
- data.tar.gz: 4345802733dcae998af672530f21c4a640c558a3b55eaf1435ff42c4a3dc81b0c7402e4e3898ff293666b661105a206c5e4fa42296495fe1d70836ea9f2da6b2
6
+ metadata.gz: 73c5f35ff29686e9c632719dffe622eff58042e082ffcacc8f4d7acc01f3d28e3c32e948ff5804482eb49c9f0eaf499710e93445a804b16f127fb7ccf3bfa0a3
7
+ data.tar.gz: f82610098ba1d05c2440cac14761d35feed4658923b070144d7cfc654ce2f23d45316839ed08be7251addfc767a6b2f0b0bccf88d12cb53eac8a9076f3cc42f9
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # SaveMe
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/save_me`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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
- ## Development
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
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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
 
@@ -1,3 +1,3 @@
1
1
  class SaveMe
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-31 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler