rails-console-tweaks 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -1
- data/lib/rails-console-tweaks.rb +1 -1
- data/lib/rails-console-tweaks/railtie.rb +19 -0
- data/lib/rails-console-tweaks/version.rb +1 -1
- data/rails-console-tweaks.gemspec +0 -1
- metadata +11 -27
- data/lib/rails-console-tweaks/engine.rb +0 -17
data/README.md
CHANGED
@@ -5,17 +5,33 @@ Customize Rails console with more useful defaults.
|
|
5
5
|
Useful for local development as well as inspecting production system
|
6
6
|
output.
|
7
7
|
|
8
|
+
Introduces an optional Bundler group to control what gems are loaded
|
9
|
+
into your console. This is uesful to [prevent console specific gems from
|
10
|
+
being loaded into your production environment](http://iain.nl/getting-the-most-out-of-bundler-groups)
|
11
|
+
|
8
12
|
|
9
13
|
## Features
|
10
14
|
|
15
|
+
* autoload gems in `console` group into your console
|
11
16
|
* print all SQL statments executed within the current console
|
12
|
-
*
|
17
|
+
* (optional) auto enable [HIRB](https://github.com/cldwalker/hirb) to pretty print
|
18
|
+
`ActiveRecord` objects
|
19
|
+
* (optional) auto start [WIRB](https://github.com/janlelis/wirb) to
|
20
|
+
colorize ruby object inspection
|
21
|
+
|
13
22
|
|
14
23
|
## Installation
|
15
24
|
|
16
25
|
```ruby
|
17
26
|
# Gemfile
|
18
27
|
gem 'rails-console-tweaks'
|
28
|
+
|
29
|
+
# add any gems that should be available only to the console
|
30
|
+
group :console do
|
31
|
+
gem 'wirb'
|
32
|
+
gem 'hirb'
|
33
|
+
gem 'awesome_print'
|
34
|
+
end
|
19
35
|
```
|
20
36
|
|
21
37
|
That's it! No extra configuration is necessary!
|
data/lib/rails-console-tweaks.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require "rails-console-tweaks/version"
|
2
|
-
require 'rails-console-tweaks/
|
2
|
+
require 'rails-console-tweaks/railtie'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Rails
|
2
|
+
module ConsoleTweaks
|
3
|
+
class Railtie < Rails::Railtie
|
4
|
+
console do
|
5
|
+
# load gems specifically for the conosle
|
6
|
+
Bundler.require(:console)
|
7
|
+
|
8
|
+
# log sql statements to stdout
|
9
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
10
|
+
|
11
|
+
# pretty print output of models
|
12
|
+
::Hirb.enable if defined?(::Hirb)
|
13
|
+
|
14
|
+
# colorize output
|
15
|
+
::Wirb.start if defined?(::Wirb)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-console-tweaks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.2
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Sonnek
|
@@ -15,11 +15,9 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-03-12 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name: rails
|
22
|
-
prerelease: false
|
23
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
22
|
none: false
|
25
23
|
requirements:
|
@@ -31,27 +29,11 @@ dependencies:
|
|
31
29
|
- 0
|
32
30
|
version: "3.0"
|
33
31
|
requirement: *id001
|
34
|
-
type: :runtime
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: hirb
|
37
32
|
prerelease: false
|
38
|
-
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 11
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
- 5
|
47
|
-
- 0
|
48
|
-
version: 0.5.0
|
49
|
-
requirement: *id002
|
33
|
+
name: rails
|
50
34
|
type: :runtime
|
51
35
|
- !ruby/object:Gem::Dependency
|
52
|
-
|
53
|
-
prerelease: false
|
54
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
55
37
|
none: false
|
56
38
|
requirements:
|
57
39
|
- - "="
|
@@ -63,7 +45,9 @@ dependencies:
|
|
63
45
|
- 2
|
64
46
|
- 2
|
65
47
|
version: 0.9.2.2
|
66
|
-
requirement: *
|
48
|
+
requirement: *id002
|
49
|
+
prerelease: false
|
50
|
+
name: rake
|
67
51
|
type: :development
|
68
52
|
description: tweak the default console behavior with better defaults
|
69
53
|
email:
|
@@ -83,7 +67,7 @@ files:
|
|
83
67
|
- README.md
|
84
68
|
- Rakefile
|
85
69
|
- lib/rails-console-tweaks.rb
|
86
|
-
- lib/rails-console-tweaks/
|
70
|
+
- lib/rails-console-tweaks/railtie.rb
|
87
71
|
- lib/rails-console-tweaks/version.rb
|
88
72
|
- rails-console-tweaks.gemspec
|
89
73
|
homepage: http://github.com/wireframe/rails-console-tweaks
|
@@ -115,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
99
|
requirements: []
|
116
100
|
|
117
101
|
rubyforge_project: rails-console-tweaks
|
118
|
-
rubygems_version: 1.8.
|
102
|
+
rubygems_version: 1.8.10
|
119
103
|
signing_key:
|
120
104
|
specification_version: 3
|
121
105
|
summary: customize rails console with more useful defaults
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'hirb'
|
2
|
-
|
3
|
-
module Rails
|
4
|
-
module ConsoleTweaks
|
5
|
-
class Engine < Rails::Engine
|
6
|
-
initializer "rails-console-tweaks.initializer" do |app|
|
7
|
-
if defined? ::Rails::Console
|
8
|
-
# log sql statements to stdout
|
9
|
-
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
10
|
-
|
11
|
-
# pretty print output of models
|
12
|
-
::Hirb.enable
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|