Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

save_me

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

save_me

  • 1.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SaveMe

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.

Installation

Add this line to your application's Gemfile:

gem 'save_me'

And then execute:

$ bundle

Or install it yourself as:

$ gem install save_me

Usage

Put this line in your code before you run your script

SaveMe.call("path_to_what_you_want_to_copy", results_path: "./results", ymd: 0b110, params: { whatever: "you need here" })

First argument is a path to the file/folder you want to save.

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.

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.

  • y - year
  • m - month
  • d - day

A 1 creates a folder for a year/month/day, a 0 will put a year/month/day in the final folder name.

Examples:

  • 0b111
SaveMe.call("results", results_path: "archive", ymd: 0b111, params: { test: "test" })
archive/
└── 2017
    └── 4
        └── 3
            └── 10:16:18
                ├── params.json
                └── results
                    └── results.json
  • 0b110
SaveMe.call("results", results_path: "archive", ymd: 0b110, params: { test: "test" })
archive/
└── 2017
    └── 4
        └── 03_10:18:55
            ├── params.json
            └── results
                └── results.json

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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/michal-januszkiewicz/save_me.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 07 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc