-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
188 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Ruby | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Ruby ${{ matrix.ruby }} | ||
strategy: | ||
matrix: | ||
ruby: | ||
- '3.1.2' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- name: Run the default task | ||
run: bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
.DS_Store | ||
pkg | ||
/.bundle/ | ||
/.yardoc | ||
/_yardoc/ | ||
/coverage/ | ||
/doc/ | ||
/pkg/ | ||
/spec/reports/ | ||
/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.7.5 | ||
|
||
Style/StringLiterals: | ||
Enabled: true | ||
EnforcedStyle: double_quotes | ||
|
||
Style/StringLiteralsInInterpolation: | ||
Enabled: true | ||
EnforcedStyle: double_quotes | ||
|
||
Layout/LineLength: | ||
Max: 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in redis-dump.gemspec | ||
gemspec | ||
|
||
gem "rake", "~> 13.0" | ||
|
||
gem "rubocop", "~> 1.21" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Redis::Dump | ||
|
||
TODO: Delete this and the text below, and describe your gem | ||
|
||
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/redis/dump`. To experiment with that code, run `bin/console` for an interactive prompt. | ||
|
||
## Installation | ||
|
||
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org. | ||
|
||
Install the gem and add to the application's Gemfile by executing: | ||
|
||
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG | ||
|
||
If bundler is not being used to manage dependencies, install the gem by executing: | ||
|
||
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG | ||
|
||
## Usage | ||
|
||
TODO: Write usage instructions here | ||
|
||
## Development | ||
|
||
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. | ||
|
||
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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/redis-dump. | ||
|
||
## License | ||
|
||
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,8 @@ | ||
require "rubygems" | ||
require "rake" | ||
require "rake/clean" | ||
require "rdoc/task" | ||
# frozen_string_literal: true | ||
|
||
task :default => ["build"] | ||
CLEAN.include [ 'pkg', 'rdoc' ] | ||
name = "redis-dump" | ||
|
||
$:.unshift File.join(File.dirname(__FILE__), 'lib') | ||
require "redis/dump" | ||
version = Redis::Dump::VERSION.to_s | ||
|
||
begin | ||
require "jeweler" | ||
Jeweler::Tasks.new do |s| | ||
s.version = version | ||
s.name = name | ||
s.summary = "Backup and restore your Redis data to and from JSON." | ||
s.description = s.summary | ||
s.email = "[email protected]" | ||
s.homepage = "http://github.com/delano/redis-dump" | ||
s.authors = ["Delano Mandelbaum"] | ||
|
||
s.add_dependency("yajl-ruby", ">= 0.1") | ||
s.add_dependency("redis", ">= 4.0") | ||
s.add_dependency("uri-redis", ">= 0.4.0") | ||
s.add_dependency("drydock", ">= 0.6.9") | ||
|
||
s.license = "MIT" | ||
|
||
s.signing_key = File.join('/mnt/gem/', 'gem-private_key.pem') | ||
s.cert_chain = ['gem-public_cert.pem'] | ||
end | ||
Jeweler::GemcutterTasks.new | ||
rescue LoadError | ||
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" | ||
end | ||
|
||
require 'rake/testtask' | ||
Rake::TestTask.new do |t| | ||
t.libs = ["lib", "test"] | ||
end | ||
|
||
extra_files = %w[LICENSE.txt THANKS.txt CHANGES.txt ] | ||
RDoc::Task.new do |rdoc| | ||
rdoc.rdoc_dir = "rdoc" | ||
rdoc.title = "#{name} #{version}" | ||
rdoc.generator = 'hanna' # gem install hanna-nouveau | ||
rdoc.main = 'README.rdoc' | ||
rdoc.rdoc_files.include("README*") | ||
rdoc.rdoc_files.include("bin/*.rb") | ||
rdoc.rdoc_files.include("lib/**/*.rb") | ||
extra_files.each { |file| | ||
rdoc.rdoc_files.include(file) if File.exists?(file) | ||
} | ||
end | ||
require "bundler/gem_tasks" | ||
require "rubocop/rake_task" | ||
|
||
RuboCop::RakeTask.new | ||
|
||
task default: :rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require "bundler/setup" | ||
require "redis/dump" | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
# require "pry" | ||
# Pry.start | ||
|
||
require "irb" | ||
IRB.start(__FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module Redis | ||
class Dump | ||
VERSION = "1.0.0" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "lib/redis/dump/version" | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "redis-dump" | ||
spec.version = Redis::Dump::VERSION | ||
spec.authors = ["delano"] | ||
spec.email = "[email protected]" | ||
|
||
spec.summary = "Backup and restore your Redis data to and from JSON." | ||
spec.description = "Backup and restore your Redis data to and from JSON by database, key, or key pattern." | ||
spec.homepage = "https://rubygems.org/gems/redis-dump" | ||
spec.license = "MIT" | ||
spec.required_ruby_version = ">= 2.7.5" | ||
|
||
spec.metadata["allowed_push_host"] = "https://rubygems.org/" | ||
|
||
spec.metadata["homepage_uri"] = spec.homepage | ||
spec.metadata["source_code_uri"] = "https://github.com/delano/redis-dump" | ||
spec.metadata["changelog_uri"] = "https://github.com/delano/redis-dump/blob/main/CHANGES.txt" | ||
|
||
# Specify which files should be added to the gem when it is released. | ||
# The `git ls-files -z` loads the files in the RubyGem that have been added into git. | ||
spec.files = Dir.chdir(__dir__) do | ||
`git ls-files -z`.split("\x0").reject do |f| | ||
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)}) | ||
end | ||
end | ||
spec.bindir = "bin" | ||
spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_dependency("yajl-ruby", ">= 0.1") | ||
spec.add_dependency("oj", ">= 3.13.14") | ||
spec.add_dependency("redis", ">= 4.0") | ||
spec.add_dependency("uri-redis", ">= 1.0.0") | ||
spec.add_dependency("drydock", ">= 0.6.9") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Redis | ||
module Dump | ||
VERSION: String | ||
# See the writing guide of rbs: https://github.com/ruby/rbs#guides | ||
end | ||
end |