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

sequential_file

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequential_file

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

sequential_file

Sequential File makes determination of which file to process (read or write) easy!

ProjectSequential File
gem namesequential_file
licenseMIT
moldinessMaintainer Status
versionGem Version
dependenciesDependency Status
code qualityCode Climate
continuous integrationBuild Status
test coverageCoverage Status
homepagehttps://github.com/pboling/sequential_file
documentationhttp://rdoc.info/github/pboling/sequential_file/frames
authorPeter Boling
Spread ♡ⓛⓞⓥⓔ♡Endorse Me

Summary

It allows you to create files that are named sequentially and intelligently.

Files will have four primary parts in their filenames:

  1. First part, which will be useful for list files in the shell.
  2. Second part is a date stamp, which will be useful in not having unwanted junk in our globs.
  3. Third part makes it easy to find the counter
  4. Fourth part is the counter

Compatibility

Tested with Ruby 2.0.0+. Due to the use of Ruby's 'prepend' initialization feature, will not work with anything older.

There are no dependencies, gem or otherwise, this is a pure Ruby library, and will work with any sort of File-type class.

Installation

Add this line to your application's Gemfile:

gem 'sequential_file'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sequential_file

Usage

If you have your own File-like class then you may just need to use the SequentialFile::Namer by including it.

class MyFileLikeThing
    include SequentialFile::Namer
end

This gem ships with a reference implementation of a File-wrapper class that uses the Namer to determine which file to process.

Have a look at lib/sequential_file/base.rb or require it and play with it:

require 'sequential_file/base'

file = SequentialFile::Base.new({
                           directory_path: '/tmp',
                           name: 'access_log.FileBase.csv',
                           process_date: Date.today
                         })

file.write('this is new text')          # => write ensures that the file is open for writing, but you have to remember to close!
file.close
file.write('this is after close text')
file.read =~ /this is after close text/ # => integer representation of the position in the file where the text match starts
file.close

Also, see the specs.

Contributors

See the Network View and the CHANGELOG

How you can help!

Take a look at the reek and roodi lists. These are the files names REEK and ROODI in the root of the gem.

Currently they are clean, and we like to keep them that way! Once you complete a change, run the tests:

bundle exec rake spec

If the tests pass refresh the reek and roodi lists and make sure things have not gotten worse:

bundle exec rake reek > REEK
bundle exec rake reek > ROODI

Follow the instructions for "Contributing" below.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Versioning

This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions.

As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision.

For example:

spec.add_dependency 'sequential_file', '~> 1.0.8'

Bitdeli Badge

FAQs

Package last updated on 26 Feb 2014

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