oculus 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/README.md +5 -1
- data/TODO.md +6 -1
- data/lib/oculus/connection.rb +2 -3
- data/lib/oculus/storage/file_store.rb +2 -2
- data/lib/oculus/version.rb +1 -1
- data/lib/oculus.rb +1 -1
- data/oculus.gemspec +1 -1
- data/spec/connection/mysql2_spec.rb +1 -0
- data/spec/connection/postgres_spec.rb +1 -0
- metadata +61 -30
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -15,11 +15,15 @@ readonly MySQL account.**
|
|
15
15
|
## Installation
|
16
16
|
|
17
17
|
$ gem install oculus
|
18
|
+
$ gem install mysql2 # to enable MySQL support
|
19
|
+
$ gem install pg # to enable Postgres support
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
23
|
Oculus is a Sinatra app. Run it from the command line, or mount `Oculus::Server`
|
22
|
-
as middleware in your Rack application.
|
24
|
+
as middleware in your Rack application (recommended). For more information on
|
25
|
+
mounting Oculus as middleware, see the wiki:
|
26
|
+
[Running with Rack](https://github.com/paulrosania/oculus/wiki/Running-with-Rack).
|
23
27
|
|
24
28
|
For details on command line options, run:
|
25
29
|
|
data/TODO.md
CHANGED
@@ -2,11 +2,16 @@
|
|
2
2
|
|
3
3
|
## Upcoming (pre-1.0)
|
4
4
|
|
5
|
-
* Setup instructions
|
6
5
|
* New user experience
|
6
|
+
* Useful error message for bad MySQL credentials
|
7
7
|
|
8
8
|
## Eventually (1.1 or later)
|
9
9
|
|
10
|
+
* Don't load results unless necessary
|
11
|
+
* Paginate large result sets? (probably no)
|
10
12
|
* Restartable queries
|
11
13
|
* Reports/query groups
|
12
14
|
* Processlist monitor
|
15
|
+
* Email notifications
|
16
|
+
* True multiuser
|
17
|
+
* Comments
|
data/lib/oculus/connection.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'oculus/connection/mysql2'
|
2
|
-
require 'oculus/connection/postgres'
|
3
|
-
|
4
1
|
module Oculus
|
5
2
|
module Connection
|
6
3
|
class Error < StandardError; end
|
@@ -9,8 +6,10 @@ module Oculus
|
|
9
6
|
def self.connect(options)
|
10
7
|
case options[:adapter]
|
11
8
|
when 'mysql'
|
9
|
+
require 'oculus/connection/mysql2'
|
12
10
|
Mysql2
|
13
11
|
when 'postgres', 'pg'
|
12
|
+
require 'oculus/connection/postgres'
|
14
13
|
Postgres
|
15
14
|
else
|
16
15
|
raise AdapterNotFound, "#{options[:adapter]} is not currently implemented. You should write it!"
|
@@ -70,7 +70,7 @@ module Oculus
|
|
70
70
|
|
71
71
|
class File < ::File
|
72
72
|
def self.parse(path)
|
73
|
-
file = File.open(path)
|
73
|
+
file = File.open(path, 'r:UTF-8')
|
74
74
|
|
75
75
|
file.flock(File::LOCK_EX)
|
76
76
|
attributes = file.attributes
|
@@ -88,7 +88,7 @@ module Oculus
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def write_results(results)
|
91
|
-
csv_data = CSV.generate do |csv|
|
91
|
+
csv_data = CSV.generate(:encoding => 'UTF-8') do |csv|
|
92
92
|
csv << results.first
|
93
93
|
results[1..-1].each do |result|
|
94
94
|
csv << result
|
data/lib/oculus/version.rb
CHANGED
data/lib/oculus.rb
CHANGED
@@ -27,7 +27,7 @@ module Oculus
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def connection_string
|
30
|
-
user = "#{connection_options[:
|
30
|
+
user = "#{connection_options[:username]}@" if connection_options[:username]
|
31
31
|
port = ":#{connection_options[:port]}" if connection_options[:port]
|
32
32
|
"#{connection_options[:adapter]}://#{user}#{connection_options[:host]}#{port}/#{connection_options[:database]}"
|
33
33
|
end
|
data/oculus.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["paul.rosania@gmail.com"]
|
7
7
|
gem.description = %q{Oculus is a web-based logging SQL client. It keeps a history of your queries and the results they returned, so your research is always at hand, easy to share and easy to repeat or reproduce in the future.}
|
8
8
|
gem.summary = %q{Oculus is a web-based logging SQL client.}
|
9
|
-
gem.homepage = "
|
9
|
+
gem.homepage = "http://oculusapp.com"
|
10
10
|
|
11
11
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
12
|
gem.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oculus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 1.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.3.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: vegas
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: 0.1.4
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.1.4
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: rake
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: cucumber
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '1'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: rspec
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '2'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '2'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: capybara
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: '1'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1'
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: mysql2
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,10 +117,15 @@ dependencies:
|
|
87
117
|
version: 0.3.11
|
88
118
|
type: :development
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.3.11
|
91
126
|
- !ruby/object:Gem::Dependency
|
92
127
|
name: pg
|
93
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
94
129
|
none: false
|
95
130
|
requirements:
|
96
131
|
- - ! '>='
|
@@ -98,7 +133,12 @@ dependencies:
|
|
98
133
|
version: 0.13.2
|
99
134
|
type: :development
|
100
135
|
prerelease: false
|
101
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 0.13.2
|
102
142
|
description: Oculus is a web-based logging SQL client. It keeps a history of your
|
103
143
|
queries and the results they returned, so your research is always at hand, easy
|
104
144
|
to share and easy to repeat or reproduce in the future.
|
@@ -154,7 +194,7 @@ files:
|
|
154
194
|
- spec/file_store_spec.rb
|
155
195
|
- spec/query_presenter_spec.rb
|
156
196
|
- spec/query_spec.rb
|
157
|
-
homepage:
|
197
|
+
homepage: http://oculusapp.com
|
158
198
|
licenses: []
|
159
199
|
post_install_message:
|
160
200
|
rdoc_options: []
|
@@ -174,17 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
214
|
version: '0'
|
175
215
|
requirements: []
|
176
216
|
rubyforge_project:
|
177
|
-
rubygems_version: 1.8.
|
217
|
+
rubygems_version: 1.8.23
|
178
218
|
signing_key:
|
179
219
|
specification_version: 3
|
180
220
|
summary: Oculus is a web-based logging SQL client.
|
181
|
-
test_files:
|
182
|
-
- features/query.feature
|
183
|
-
- features/step_definitions/query_steps.rb
|
184
|
-
- features/support/env.rb
|
185
|
-
- spec/connection/mysql2_spec.rb
|
186
|
-
- spec/connection/postgres_spec.rb
|
187
|
-
- spec/connection_spec.rb
|
188
|
-
- spec/file_store_spec.rb
|
189
|
-
- spec/query_presenter_spec.rb
|
190
|
-
- spec/query_spec.rb
|
221
|
+
test_files: []
|