awesome_rails_console 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +7 -67
- data/awesome_rails_console.gemspec +0 -6
- data/lib/awesome_rails_console/railtie.rb +2 -19
- data/lib/awesome_rails_console/version.rb +1 -1
- metadata +2 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85dd83732a6ff6d243a291db31b8e1ef130d9457
|
4
|
+
data.tar.gz: 1a1e4ca8b6760e0c1d8bc59654f2fa418b1bb8b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 971dffe646a635ee12dd8a27906ce7fa1a1b66fd24571344a244fe4398bab4dde788e709af0c3e3b04320a71077cf8d4682b6c71bf0158765691032a8ffb5e88
|
7
|
+
data.tar.gz: 798c60f3704eb46c9ccae48ca41843a854bee2c4a3372ded6e5c525911a2ca9921da462aaa5b4e2544f7d955c72d34fb9033e71a92d34a3b932fc72df207eafe
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.3.0
|
4
|
+
|
5
|
+
* Remove `pry-byebug`, `pry-stack_explorer` and `hirb` dependency. Please add them into your application `Gemfile` if you still want to use.
|
6
|
+
* Remove color indicator from prompt.
|
7
|
+
|
3
8
|
## v0.2.1
|
4
9
|
|
5
10
|
* No changes in functionality. Release for updating information on rubygems.org.
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# Make Your Rails Console Awesome With One-line
|
2
2
|
|
3
3
|
This gem was inspired by [Using pry in production](https://bugsnag.com/blog/production-pry), [jazz_hands](https://github.com/nixme/jazz_hands) and [jazz_fingers](https://github.com/plribeiro3000/jazz_fingers).
|
4
4
|
|
5
|
-
The pros of AwesomeRailsConsole are:
|
5
|
+
The pros of `AwesomeRailsConsole` are:
|
6
6
|
|
7
7
|
* Less gem dependances (Require infrequent used gems only when you want it)
|
8
8
|
* Simpler prompt modification (More like the default pry prompt you're familiar with)
|
9
9
|
* No configurable options at all (You don't need to worry about configuration)
|
10
|
+
* No debugger or hirb dependancy. Which debugger to use is fully controlled by you.
|
10
11
|
|
11
12
|
> If you really want to do a lot of customization. You may consider just editing your `Gemfile`, `.pryrc` and `config/initializers/pry.rb`. Or fork this project.
|
12
13
|
|
@@ -16,7 +17,7 @@ The pros of AwesomeRailsConsole are:
|
|
16
17
|
|
17
18
|
Prevents you from accidentally changing production data to the wrong project.
|
18
19
|
|
19
|
-
![](http://i.imgur.com/
|
20
|
+
![](http://i.imgur.com/CKrJYqk.png)
|
20
21
|
|
21
22
|
### Beautiful formatting with pry and awesome_print
|
22
23
|
|
@@ -31,61 +32,7 @@ Make it easy to read. Reduce the pain while debugging.
|
|
31
32
|
ap (1..100).to_a, limit: 5
|
32
33
|
```
|
33
34
|
|
34
|
-
![](http://i.imgur.com/
|
35
|
-
|
36
|
-
### Print ascii table with Hirb
|
37
|
-
|
38
|
-
Helpful for exporting a set of records for documenting.
|
39
|
-
|
40
|
-
> This only works in development and test mode.
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
extend Hirb::Console # include the `table` statement
|
44
|
-
Hirb::View.resize # resize to your terminal window size
|
45
|
-
|
46
|
-
table [1, 2, 3]
|
47
|
-
table User.last(3), markdown: true
|
48
|
-
```
|
49
|
-
|
50
|
-
![](http://i.imgur.com/KRqvaBA.png)
|
51
|
-
|
52
|
-
### Debugging with pry-byebug
|
53
|
-
|
54
|
-
Put following statment (breakpoint) in your code. And execute it.
|
55
|
-
|
56
|
-
```ruby
|
57
|
-
binding.pry
|
58
|
-
```
|
59
|
-
|
60
|
-
After entering a pry debug session. Try:
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
next
|
64
|
-
step
|
65
|
-
whereami
|
66
|
-
continue
|
67
|
-
```
|
68
|
-
|
69
|
-
### Walk the stack with pry-stack_explorer
|
70
|
-
|
71
|
-
In a pry debug session. Try:
|
72
|
-
|
73
|
-
```ruby
|
74
|
-
show-stack
|
75
|
-
up
|
76
|
-
down
|
77
|
-
```
|
78
|
-
|
79
|
-
### More
|
80
|
-
|
81
|
-
awesome_rails_console depends on following gems. Thus you can use all functionalities they provide.
|
82
|
-
|
83
|
-
* [pry-rails](https://github.com/rweng/pry-rails)
|
84
|
-
* [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug)
|
85
|
-
* [pry-stack_explorer](https://github.com/pry/pry-stack_explorer)
|
86
|
-
* [awesome_print](https://github.com/michaeldv/awesome_print)
|
87
|
-
* [hirb](https://github.com/cldwalker/hirb)
|
88
|
-
* [hirb-unicode](https://github.com/miaout17/hirb-unicode)
|
35
|
+
![](http://i.imgur.com/I1iV8n9.png)
|
89
36
|
|
90
37
|
## Installation
|
91
38
|
|
@@ -99,18 +46,11 @@ And then execute:
|
|
99
46
|
|
100
47
|
$ bundle
|
101
48
|
|
102
|
-
And restart your rails console.
|
103
|
-
|
104
|
-
### For Ruby 1.9
|
105
|
-
|
106
|
-
```ruby
|
107
|
-
gem 'awesome_rails_console', github: 'ascendbruce/awesome_rails_console', branch: 'bring-your-own-debugger'
|
108
|
-
gem 'pry-debugger'
|
109
|
-
```
|
49
|
+
And restart your rails console. (You may need to restart spring also)
|
110
50
|
|
111
51
|
## Changelog
|
112
52
|
|
113
|
-
See CHANGELOG.md
|
53
|
+
See `CHANGELOG.md`.
|
114
54
|
|
115
55
|
## Development
|
116
56
|
|
@@ -26,12 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency "pry-rails"
|
27
27
|
spec.add_dependency "awesome_print"
|
28
28
|
|
29
|
-
# Following are only required in development and test mode (in lib/awesome_rails_console/railtie.rb)
|
30
|
-
spec.add_dependency "pry-byebug"
|
31
|
-
spec.add_dependency "pry-stack_explorer"
|
32
|
-
spec.add_dependency "hirb"
|
33
|
-
spec.add_dependency "hirb-unicode"
|
34
|
-
|
35
29
|
# gem development dependency
|
36
30
|
spec.add_development_dependency "bundler", "~> 1.9"
|
37
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -1,13 +1,6 @@
|
|
1
1
|
require "pry-rails"
|
2
2
|
require "awesome_print"
|
3
3
|
|
4
|
-
if Rails.env.development? || Rails.env.test?
|
5
|
-
require "pry-byebug"
|
6
|
-
require "pry-stack_explorer"
|
7
|
-
require "hirb"
|
8
|
-
require "hirb-unicode"
|
9
|
-
end
|
10
|
-
|
11
4
|
module AwesomeRailsConsole
|
12
5
|
class Railtie < Rails::Railtie
|
13
6
|
initializer "awesome_rails_console.initialize" do |app|
|
@@ -34,19 +27,9 @@ module AwesomeRailsConsole
|
|
34
27
|
def show_rails_env_name_before_prompt
|
35
28
|
old_prompt = Pry.config.prompt
|
36
29
|
|
37
|
-
# TODO: Change to Pry::Helpers::Text.red/red/yellow(...) someday.
|
38
|
-
# See https://github.com/pry/pry/issues/493 for detail.
|
39
|
-
env = if Rails.env.production?
|
40
|
-
"\001\e[0;31m\002#{Rails.env.upcase}\001\e[0m\002"
|
41
|
-
elsif Rails.env.development?
|
42
|
-
"\001\e[0;32m\002#{Rails.env.upcase}\001\e[0m\002"
|
43
|
-
else
|
44
|
-
"\001\e[0;33m\002#{Rails.env.upcase}\001\e[0m\002"
|
45
|
-
end
|
46
|
-
|
47
30
|
Pry.config.prompt = [
|
48
|
-
proc { |*a| "#{env} #{old_prompt.first.call(*a)}" },
|
49
|
-
proc { |*a| "#{env} #{old_prompt.second.call(*a)}" }
|
31
|
+
proc { |*a| "#{Rails.env.classify} #{old_prompt.first.call(*a)}" },
|
32
|
+
proc { |*a| "#{Rails.env.classify} #{old_prompt.second.call(*a)}" }
|
50
33
|
]
|
51
34
|
end
|
52
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_rails_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruce Li
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -52,62 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry-byebug
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry-stack_explorer
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: hirb
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: hirb-unicode
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
55
|
- !ruby/object:Gem::Dependency
|
112
56
|
name: bundler
|
113
57
|
requirement: !ruby/object:Gem::Requirement
|