redis-ui 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/Gemfile.lock +25 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +69 -0
- data/VERSION +1 -0
- data/bin/redis-ui +5 -0
- data/config.ru +2 -0
- data/lib/redis-ui.rb +50 -0
- data/lib/static/stylesheets/redis-ui.css +2 -0
- data/lib/views/index.erb +8 -0
- data/lib/views/layout.erb +10 -0
- data/lib/views/show.erb +8 -0
- data/pkg/redis-ui-0.1.0.gem +0 -0
- data/redis-ui.gemspec +83 -0
- data/test/helper.rb +18 -0
- data/test/test_redis_ui.rb +7 -0
- metadata +196 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
git (1.2.5)
|
5
|
+
jeweler (1.5.2)
|
6
|
+
bundler (~> 1.0.0)
|
7
|
+
git (>= 1.2.5)
|
8
|
+
rake
|
9
|
+
rack (1.2.2)
|
10
|
+
rake (0.8.7)
|
11
|
+
rcov (0.9.9)
|
12
|
+
redis (2.1.1)
|
13
|
+
sinatra (1.2.0)
|
14
|
+
rack (~> 1.1)
|
15
|
+
tilt (>= 1.2.2, < 2.0)
|
16
|
+
tilt (1.2.2)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
|
21
|
+
DEPENDENCIES
|
22
|
+
jeweler
|
23
|
+
rcov
|
24
|
+
redis
|
25
|
+
sinatra
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 jwelshiv
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= redishub
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to redishub
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2011 jwelshiv. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "redis-ui"
|
16
|
+
gem.homepage = "http://github.com/jwelshiv/redis-ui"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{Sinatra backed redis ui}
|
19
|
+
gem.description = %Q{RedisUI is a redis db web accessible viewer}
|
20
|
+
gem.email = "james@supermatter.com"
|
21
|
+
gem.authors = ["jwelshiv"]
|
22
|
+
|
23
|
+
gem.add_development_dependency "bacon", ">= 0"
|
24
|
+
gem.add_runtime_dependency 'redis', ">= 0"
|
25
|
+
gem.add_runtime_dependency 'sinatra', ">= 1"
|
26
|
+
gem.add_runtime_dependency 'json', ">= 0"
|
27
|
+
|
28
|
+
gem.files.include 'lib/*.rb'
|
29
|
+
gem.files.include 'lib/views/*.erb'
|
30
|
+
gem.files.include 'lib/static/stylesheets/*.css'
|
31
|
+
gem.files.include 'lib/static/javascript/*.js'
|
32
|
+
|
33
|
+
gem.executables = ['redis-ui']
|
34
|
+
end
|
35
|
+
Jeweler::RubygemsDotOrgTasks.new
|
36
|
+
|
37
|
+
require 'rake/testtask'
|
38
|
+
Rake::TestTask.new(:test) do |test|
|
39
|
+
test.libs << 'lib' << 'test'
|
40
|
+
test.pattern = 'test/**/test_*.rb'
|
41
|
+
test.verbose = true
|
42
|
+
end
|
43
|
+
|
44
|
+
begin
|
45
|
+
require 'rcov/rcovtask'
|
46
|
+
Rcov::RcovTask.new do |test|
|
47
|
+
test.libs << 'test'
|
48
|
+
test.pattern = 'test/**/test_*.rb'
|
49
|
+
test.verbose = true
|
50
|
+
end
|
51
|
+
rescue LoadError
|
52
|
+
task :rcov do
|
53
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
task :default => :test
|
58
|
+
|
59
|
+
require 'rake/rdoctask'
|
60
|
+
Rake::RDocTask.new do |rdoc|
|
61
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
62
|
+
|
63
|
+
rdoc.rdoc_dir = 'rdoc'
|
64
|
+
rdoc.title = "Anyhub #{version}"
|
65
|
+
rdoc.rdoc_files.include('README*')
|
66
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
67
|
+
end
|
68
|
+
|
69
|
+
Jeweler::GemcutterTasks.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/bin/redis-ui
ADDED
data/config.ru
ADDED
data/lib/redis-ui.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
module RedisUI
|
2
|
+
require 'rubygems'
|
3
|
+
require 'sinatra/base'
|
4
|
+
require 'redis'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
def self.redis
|
8
|
+
Redis.new
|
9
|
+
end
|
10
|
+
|
11
|
+
class Server < Sinatra::Base
|
12
|
+
|
13
|
+
configure do
|
14
|
+
set :views, File.dirname(__FILE__) + '/views'
|
15
|
+
set :redis, Redis.new('/tmp/redis.sock')
|
16
|
+
set :public, File.dirname(__FILE__) + '/static'
|
17
|
+
end
|
18
|
+
|
19
|
+
helpers do
|
20
|
+
# helpers go here
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
get "/" do
|
25
|
+
@keys = RedisUI.redis.keys
|
26
|
+
#@keys.to_json
|
27
|
+
erb :index
|
28
|
+
end
|
29
|
+
|
30
|
+
get "/index" do
|
31
|
+
"Welcome"
|
32
|
+
end
|
33
|
+
|
34
|
+
get "/:key" do
|
35
|
+
@key = params[:key]
|
36
|
+
@data = case RedisUI.redis.type(@key)
|
37
|
+
when "string"
|
38
|
+
Array(RedisUI.redis[@key])
|
39
|
+
when "list"
|
40
|
+
RedisUI.redis.lrange(@key, 0, -1)
|
41
|
+
when "set"
|
42
|
+
RedisUI.redis.set_members(@key)
|
43
|
+
else
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
erb :show
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
data/lib/views/index.erb
ADDED
data/lib/views/show.erb
ADDED
Binary file
|
data/redis-ui.gemspec
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{redis-ui}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["jwelshiv"]
|
12
|
+
s.date = %q{2011-03-26}
|
13
|
+
s.default_executable = %q{redis-ui}
|
14
|
+
s.description = %q{RedisUI is a redis db web accessible viewer}
|
15
|
+
s.email = %q{james@supermatter.com}
|
16
|
+
s.executables = ["redis-ui"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bin/redis-ui",
|
29
|
+
"config.ru",
|
30
|
+
"lib/redis-ui.rb",
|
31
|
+
"lib/static/stylesheets/redis-ui.css",
|
32
|
+
"lib/views/index.erb",
|
33
|
+
"lib/views/layout.erb",
|
34
|
+
"lib/views/show.erb",
|
35
|
+
"pkg/redis-ui-0.1.0.gem",
|
36
|
+
"redis-ui.gemspec",
|
37
|
+
"test/helper.rb",
|
38
|
+
"test/test_redis_ui.rb"
|
39
|
+
]
|
40
|
+
s.homepage = %q{http://github.com/jwelshiv/redis-ui}
|
41
|
+
s.licenses = ["MIT"]
|
42
|
+
s.require_paths = ["lib"]
|
43
|
+
s.rubygems_version = %q{1.4.1}
|
44
|
+
s.summary = %q{Sinatra backed redis ui}
|
45
|
+
s.test_files = [
|
46
|
+
"test/helper.rb",
|
47
|
+
"test/test_redis_ui.rb"
|
48
|
+
]
|
49
|
+
|
50
|
+
if s.respond_to? :specification_version then
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
55
|
+
s.add_runtime_dependency(%q<redis>, [">= 0"])
|
56
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
|
57
|
+
s.add_runtime_dependency(%q<rcov>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<bacon>, [">= 0"])
|
59
|
+
s.add_runtime_dependency(%q<redis>, [">= 0"])
|
60
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 1"])
|
61
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
62
|
+
else
|
63
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
64
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
65
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
66
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
67
|
+
s.add_dependency(%q<bacon>, [">= 0"])
|
68
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
69
|
+
s.add_dependency(%q<sinatra>, [">= 1"])
|
70
|
+
s.add_dependency(%q<json>, [">= 0"])
|
71
|
+
end
|
72
|
+
else
|
73
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
74
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
75
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
76
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
77
|
+
s.add_dependency(%q<bacon>, [">= 0"])
|
78
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
79
|
+
s.add_dependency(%q<sinatra>, [">= 1"])
|
80
|
+
s.add_dependency(%q<json>, [">= 0"])
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'redishub'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redis-ui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- jwelshiv
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-03-26 00:00:00 -07:00
|
19
|
+
default_executable: redis-ui
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :runtime
|
23
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
requirement: *id001
|
33
|
+
prerelease: false
|
34
|
+
name: jeweler
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
requirement: *id002
|
47
|
+
prerelease: false
|
48
|
+
name: redis
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
requirement: *id003
|
61
|
+
prerelease: false
|
62
|
+
name: sinatra
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
requirement: *id004
|
75
|
+
prerelease: false
|
76
|
+
name: rcov
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
type: :development
|
79
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
requirement: *id005
|
89
|
+
prerelease: false
|
90
|
+
name: bacon
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
type: :runtime
|
93
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
102
|
+
requirement: *id006
|
103
|
+
prerelease: false
|
104
|
+
name: redis
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
type: :runtime
|
107
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 1
|
113
|
+
segments:
|
114
|
+
- 1
|
115
|
+
version: "1"
|
116
|
+
requirement: *id007
|
117
|
+
prerelease: false
|
118
|
+
name: sinatra
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
type: :runtime
|
121
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
requirement: *id008
|
131
|
+
prerelease: false
|
132
|
+
name: json
|
133
|
+
description: RedisUI is a redis db web accessible viewer
|
134
|
+
email: james@supermatter.com
|
135
|
+
executables:
|
136
|
+
- redis-ui
|
137
|
+
extensions: []
|
138
|
+
|
139
|
+
extra_rdoc_files:
|
140
|
+
- LICENSE.txt
|
141
|
+
- README.rdoc
|
142
|
+
files:
|
143
|
+
- Gemfile
|
144
|
+
- Gemfile.lock
|
145
|
+
- LICENSE.txt
|
146
|
+
- README.rdoc
|
147
|
+
- Rakefile
|
148
|
+
- VERSION
|
149
|
+
- bin/redis-ui
|
150
|
+
- config.ru
|
151
|
+
- lib/redis-ui.rb
|
152
|
+
- lib/static/stylesheets/redis-ui.css
|
153
|
+
- lib/views/index.erb
|
154
|
+
- lib/views/layout.erb
|
155
|
+
- lib/views/show.erb
|
156
|
+
- pkg/redis-ui-0.1.0.gem
|
157
|
+
- redis-ui.gemspec
|
158
|
+
- test/helper.rb
|
159
|
+
- test/test_redis_ui.rb
|
160
|
+
has_rdoc: true
|
161
|
+
homepage: http://github.com/jwelshiv/redis-ui
|
162
|
+
licenses:
|
163
|
+
- MIT
|
164
|
+
post_install_message:
|
165
|
+
rdoc_options: []
|
166
|
+
|
167
|
+
require_paths:
|
168
|
+
- lib
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
hash: 3
|
175
|
+
segments:
|
176
|
+
- 0
|
177
|
+
version: "0"
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
hash: 3
|
184
|
+
segments:
|
185
|
+
- 0
|
186
|
+
version: "0"
|
187
|
+
requirements: []
|
188
|
+
|
189
|
+
rubyforge_project:
|
190
|
+
rubygems_version: 1.4.1
|
191
|
+
signing_key:
|
192
|
+
specification_version: 3
|
193
|
+
summary: Sinatra backed redis ui
|
194
|
+
test_files:
|
195
|
+
- test/helper.rb
|
196
|
+
- test/test_redis_ui.rb
|