dbum 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/Gemfile +15 -0
- data/LICENSE +13 -0
- data/Rakefile +29 -0
- data/Readme.md +3 -0
- data/VERSION +1 -0
- data/bin/dbum +3 -0
- data/dbum.gemspec +25 -0
- data/lib/dbum.rb +1 -0
- data/lib/dbum/app.rb +23 -0
- data/lib/dbum/helpers.rb +28 -0
- data/lib/dbum/main.rb +38 -0
- data/lib/dbum/metadata.rb +36 -0
- data/test/test_dbum.rb +27 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ad519cdebdace7e30281919c5e11996a57cb2d7b
|
4
|
+
data.tar.gz: 95f488b44c47ae91b69e9b97bc7620123177cbcf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5f480562d08b7aa7999ae05c63ce7229f88ee55348afaa0c793a54da3d2e930a5ab39874dc90e713160ec3f47ce5c601351663dafd056f345090f3b796f097ec
|
7
|
+
data.tar.gz: f59ed81129c080a20e0e25381e96a9b760641f752bd78b1276527a23adbe23226e5c70d90e57e9891a106d271d12d14616444823528407b2bf51195c38da9305
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (c) 2015 Sean Clemmer
|
2
|
+
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
purpose with or without fee is hereby granted, provided that the above
|
5
|
+
copyright notice and this permission notice appear in all copies.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
require 'rake'
|
4
|
+
|
5
|
+
require 'rake/testtask'
|
6
|
+
Rake::TestTask.new(:test) do |test|
|
7
|
+
test.libs << 'lib' << 'test'
|
8
|
+
test.test_files = FileList['test/test*.rb']
|
9
|
+
test.verbose = true
|
10
|
+
end
|
11
|
+
|
12
|
+
task default: :test
|
13
|
+
|
14
|
+
|
15
|
+
require 'yard'
|
16
|
+
YARD::Rake::YardocTask.new do |t|
|
17
|
+
t.files = %w[ --readme Readme.md lib/**/*.rb - VERSION ]
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
require 'rubygems/tasks'
|
22
|
+
Gem::Tasks.new push: true, sign: {} do |tasks|
|
23
|
+
tasks.console.command = 'pry'
|
24
|
+
end
|
25
|
+
Gem::Tasks::Sign::Checksum.new sha2: true
|
26
|
+
|
27
|
+
|
28
|
+
require 'rake/version_task'
|
29
|
+
Rake::VersionTask.new
|
data/Readme.md
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/bin/dbum
ADDED
data/dbum.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path(File.join('..', 'lib'), __FILE__)
|
3
|
+
require 'dbum/metadata'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'dbum'
|
7
|
+
s.version = DBum::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.author = DBum::AUTHOR
|
10
|
+
s.license = DBum::LICENSE
|
11
|
+
s.homepage = DBum::HOMEPAGE
|
12
|
+
s.email = DBum::EMAIL
|
13
|
+
s.summary = DBum::SUMMARY
|
14
|
+
s.description = DBum::SUMMARY + '.'
|
15
|
+
|
16
|
+
s.add_runtime_dependency 'thor', '~> 0'
|
17
|
+
s.add_runtime_dependency 'slog', '~> 1.1'
|
18
|
+
s.add_runtime_dependency 'sinatra', '~> 1.4'
|
19
|
+
s.add_runtime_dependency 'daybreak', '~> 0.3'
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- test/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File::basename(f) }
|
24
|
+
s.require_paths = %w[ lib ]
|
25
|
+
end
|
data/lib/dbum.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'dbum/main'
|
data/lib/dbum/app.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'thread'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
require 'sinatra/base'
|
6
|
+
|
7
|
+
require_relative 'helpers'
|
8
|
+
require_relative 'metadata'
|
9
|
+
|
10
|
+
|
11
|
+
module DBum
|
12
|
+
|
13
|
+
# Web frontend for DBum, backed by Sinatra.
|
14
|
+
class App < Sinatra::Application
|
15
|
+
include DBum::Helpers
|
16
|
+
|
17
|
+
get '/' do
|
18
|
+
content_type :text
|
19
|
+
VERSION
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
data/lib/dbum/helpers.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'thor/util'
|
2
|
+
require 'thor/actions'
|
3
|
+
|
4
|
+
|
5
|
+
module DBum
|
6
|
+
|
7
|
+
# Mixins for DBum's Thor subclasses.
|
8
|
+
module Helpers
|
9
|
+
|
10
|
+
# Save the canonical implementation of "puts"
|
11
|
+
alias_method :old_puts, :puts
|
12
|
+
|
13
|
+
# Monkeypatch puts to support Thor::Shell::Color.
|
14
|
+
def puts *args
|
15
|
+
return old_puts if args.empty?
|
16
|
+
old_puts shell.set_color(*args)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
# Shortcut for Thor::Util.
|
21
|
+
def util ; Thor::Util end
|
22
|
+
|
23
|
+
|
24
|
+
# Shortcut for Thor::Actions.
|
25
|
+
def actions ; Thor::Actions end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/dbum/main.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'slog'
|
3
|
+
|
4
|
+
require_relative 'app'
|
5
|
+
require_relative 'helpers'
|
6
|
+
require_relative 'metadata'
|
7
|
+
|
8
|
+
|
9
|
+
module DBum
|
10
|
+
|
11
|
+
# DBum's entrypoint.
|
12
|
+
class Main < Thor
|
13
|
+
include DBum::Helpers
|
14
|
+
|
15
|
+
|
16
|
+
desc 'version', 'Echo the application version'
|
17
|
+
def version
|
18
|
+
puts VERSION
|
19
|
+
return nil
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
desc 'art', 'View the application art'
|
24
|
+
def art
|
25
|
+
puts
|
26
|
+
puts ART
|
27
|
+
puts
|
28
|
+
return nil
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
desc 'app', 'Start the application and server'
|
33
|
+
def app
|
34
|
+
App.run!
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# DBum gives you confidence!
|
2
|
+
module DBum
|
3
|
+
|
4
|
+
# Project root
|
5
|
+
ROOT = File.dirname(__FILE__), '..', '..'
|
6
|
+
|
7
|
+
# Pull the project version out of the VERSION file
|
8
|
+
VERSION = File.read(File.join(ROOT, 'VERSION')).strip
|
9
|
+
|
10
|
+
# A quick summary for use in the command-line interface
|
11
|
+
SUMMARY = 'A no-nonsense, JSON-based key-value store'
|
12
|
+
|
13
|
+
# Take credit for your work
|
14
|
+
AUTHOR = 'Sean Clemmer'
|
15
|
+
|
16
|
+
# Like the MIT license, but even simpler
|
17
|
+
LICENSE = 'ISC'
|
18
|
+
|
19
|
+
# Where you should look first
|
20
|
+
HOMEPAGE = 'https://github.com/sczizzo/dbum'
|
21
|
+
|
22
|
+
# Take responsibility for your work
|
23
|
+
EMAIL = 'sczizzo@gmail.com'
|
24
|
+
|
25
|
+
# Every project deserves its own ASCII art
|
26
|
+
ART = <<-'EOART'
|
27
|
+
88 88
|
28
|
+
88 88
|
29
|
+
88 88
|
30
|
+
,adPPYb,88 88,dPPYba, 88 88 88,dPYba,,adPYba,
|
31
|
+
a8" `Y88 88P' "8a 88 88 88P' "88" "8a
|
32
|
+
8b 88 88 d8 88 88 88 88 88
|
33
|
+
"8a, ,d88 88b, ,a8" "8a, ,a88 88 88 88
|
34
|
+
`"8bbdP"Y8 8Y"Ybbd8"' `"YbbdP'Y8 88 88 88
|
35
|
+
EOART
|
36
|
+
end
|
data/test/test_dbum.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'logger'
|
3
|
+
require 'tempfile'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
require 'minitest/autorun'
|
8
|
+
|
9
|
+
require_relative '../lib/dbum'
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
class TestDBum < MiniTest::Test
|
14
|
+
def setup
|
15
|
+
@tmpdir = Dir.mktmpdir
|
16
|
+
@logger = Logger.new STDERR
|
17
|
+
@logger.level = Logger::WARN
|
18
|
+
end
|
19
|
+
|
20
|
+
def teardown
|
21
|
+
FileUtils.rm_rf @tmpdir
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_something
|
25
|
+
assert true
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dbum
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sean Clemmer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: slog
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sinatra
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.4'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: daybreak
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.3'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.3'
|
69
|
+
description: A no-nonsense, JSON-based key-value store.
|
70
|
+
email: sczizzo@gmail.com
|
71
|
+
executables:
|
72
|
+
- dbum
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE
|
79
|
+
- Rakefile
|
80
|
+
- Readme.md
|
81
|
+
- VERSION
|
82
|
+
- bin/dbum
|
83
|
+
- dbum.gemspec
|
84
|
+
- lib/dbum.rb
|
85
|
+
- lib/dbum/app.rb
|
86
|
+
- lib/dbum/helpers.rb
|
87
|
+
- lib/dbum/main.rb
|
88
|
+
- lib/dbum/metadata.rb
|
89
|
+
- test/test_dbum.rb
|
90
|
+
homepage: https://github.com/sczizzo/dbum
|
91
|
+
licenses:
|
92
|
+
- ISC
|
93
|
+
metadata: {}
|
94
|
+
post_install_message:
|
95
|
+
rdoc_options: []
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 2.2.2
|
111
|
+
signing_key:
|
112
|
+
specification_version: 4
|
113
|
+
summary: A no-nonsense, JSON-based key-value store
|
114
|
+
test_files:
|
115
|
+
- test/test_dbum.rb
|