awesome_rails_console 0.4.2 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +17 -3
- data/README.md +10 -42
- data/lib/awesome_rails_console/railtie.rb +27 -3
- data/lib/awesome_rails_console/version.rb +1 -1
- data/lib/generators/awesome_rails_console/install/install_generator.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2ed2b832c0b926ee0e34eb7ff8fb3e2f8fa48b560ae5d7b8881acaba343a9656
|
4
|
+
data.tar.gz: 0a3e3b435d6a20d61e48a1ca409d298c0d3a6e69175008a51bebb21b4b865972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3ea660d65b4e8fcd6a19ea06ffe96ce0f051753712027daa03e84d8da4ffa8a03bd3f498db2e54ac23c1a01d5175fbf0a291617352807a4d5deb8ad8c77ae07
|
7
|
+
data.tar.gz: 23c0fa721de1bf71f8171c718b72a804cea607e1ce3ed1f8877dbb258aa1ee8939469a467d4b89b2c957b9f1ae5e979de93d0a6325534544610457eb86bbd686
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## v0.4.
|
3
|
+
## v0.4.5
|
4
4
|
|
5
|
-
*
|
5
|
+
* Fix `undefined method [] for Pry::Prompt:Class (NoMethodError)` error when entering rails console
|
6
|
+
|
7
|
+
## v0.4.4
|
8
|
+
|
9
|
+
* Fix deprecation warning `Module#parent_name` in Rails 6.x
|
10
|
+
|
11
|
+
## v0.4.3
|
12
|
+
|
13
|
+
* Fix my stupid mistake on v0.4.2: Require hirb-unicode-steakknife as hirb-unicode
|
14
|
+
|
15
|
+
## v0.4.2 [DO NOT USE]
|
16
|
+
|
17
|
+
* Require hirb-unicode-steakknife as unicode-steakknife
|
18
|
+
* BUG: The require name was wrong
|
6
19
|
|
7
|
-
## v0.4.1
|
20
|
+
## v0.4.1 [DO NOT USE]
|
8
21
|
|
9
22
|
* Replace `hirb-unicode` with `hirb-unicode-steakknife` in optional enhancement. (Run `rails generate awesome_rails_console:install` to install them)
|
23
|
+
* BUG: It doesn't require properly
|
10
24
|
|
11
25
|
## v0.4.0
|
12
26
|
|
data/README.md
CHANGED
@@ -4,11 +4,11 @@ This gem was inspired by [Using pry in production](https://bugsnag.com/blog/prod
|
|
4
4
|
|
5
5
|
The pros of `awesome_rails_console` are:
|
6
6
|
|
7
|
-
* Less gem dependances (
|
8
|
-
* Simpler prompt modification (
|
9
|
-
* No need to worry about configuration (
|
7
|
+
* Less gem dependances (Only pry-rails and awesome_print other than rails. The rest are optional)
|
8
|
+
* Simpler prompt modification (Similar to the default prompt you're already familiar with)
|
9
|
+
* No need to worry about configuration (because there are not much options anyway)
|
10
10
|
|
11
|
-
##
|
11
|
+
## Installation
|
12
12
|
|
13
13
|
Gemfile:
|
14
14
|
|
@@ -20,9 +20,13 @@ In terminal:
|
|
20
20
|
|
21
21
|
``` sh
|
22
22
|
bundle
|
23
|
-
rails g awesome_rails_console:install
|
23
|
+
rails g awesome_rails_console:install # This will include dependency gems to the gemfile
|
24
|
+
# you should review your Gemfile at this point (and adjust if needed)
|
25
|
+
```
|
26
|
+
|
27
|
+
```sh
|
24
28
|
bundle
|
25
|
-
spring stop
|
29
|
+
spring stop # to restart spring, if you are using it
|
26
30
|
rails c
|
27
31
|
```
|
28
32
|
|
@@ -64,39 +68,3 @@ With pry-byebug (optional enhancement)
|
|
64
68
|
Insert `binding.pry` (break point) to start debugging. See [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) For detail.
|
65
69
|
|
66
70
|
![](http://i.imgur.com/mJbC24h.png)
|
67
|
-
|
68
|
-
## Installation
|
69
|
-
|
70
|
-
Add this line to your application's `Gemfile`:
|
71
|
-
|
72
|
-
```ruby
|
73
|
-
gem 'awesome_rails_console'
|
74
|
-
```
|
75
|
-
|
76
|
-
And then execute in terminal:
|
77
|
-
|
78
|
-
$ bundle
|
79
|
-
|
80
|
-
Install and config enhancement gems: (optinal)
|
81
|
-
|
82
|
-
$ rails generate awesome_rails_console:install
|
83
|
-
|
84
|
-
Finally, restart your rails console. (You may need to restart `spring` also)
|
85
|
-
|
86
|
-
## Changelog
|
87
|
-
|
88
|
-
See `CHANGELOG.md`.
|
89
|
-
|
90
|
-
## Development
|
91
|
-
|
92
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
93
|
-
|
94
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
95
|
-
|
96
|
-
## Contributing
|
97
|
-
|
98
|
-
1. Fork it ( https://github.com/ascendbruce/awesome_rails_console/fork )
|
99
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
100
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
101
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
102
|
-
5. Create a new Pull Request
|
@@ -7,7 +7,12 @@ module AwesomeRailsConsole
|
|
7
7
|
disables_pry_plugin_loading
|
8
8
|
use_awesome_print_for_formatting
|
9
9
|
set_prompt_name_to_project_name
|
10
|
-
|
10
|
+
|
11
|
+
if Pry::VERSION >= "0.13.0"
|
12
|
+
show_rails_env_name_before_prompt_for_pry_since_v0_13
|
13
|
+
else
|
14
|
+
show_rails_env_name_before_prompt_for_pry_before_v0_13
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
private
|
@@ -21,10 +26,29 @@ module AwesomeRailsConsole
|
|
21
26
|
end
|
22
27
|
|
23
28
|
def set_prompt_name_to_project_name
|
24
|
-
|
29
|
+
# ref from https://github.com/rweng/pry-rails/blob/035d5c8203521f5eaac0001300152281c765df88/lib/pry-rails/prompt.rb
|
30
|
+
Pry.config.prompt_name =
|
31
|
+
if Rails::VERSION::MAJOR >= 6
|
32
|
+
Rails.application.class.module_parent_name.underscore
|
33
|
+
else
|
34
|
+
Rails.application.class.parent_name.underscore
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def show_rails_env_name_before_prompt_for_pry_since_v0_13
|
39
|
+
old_prompt = Pry::Prompt[:default]
|
40
|
+
|
41
|
+
Pry.config.prompt = Pry::Prompt.new(
|
42
|
+
"awesome",
|
43
|
+
"awesome rails console",
|
44
|
+
[
|
45
|
+
proc { |*a| "#{Rails.env.classify} #{old_prompt.wait_proc.call(*a)}" },
|
46
|
+
proc { |*a| "#{Rails.env.classify} #{old_prompt.incomplete_proc.call(*a)}" },
|
47
|
+
],
|
48
|
+
)
|
25
49
|
end
|
26
50
|
|
27
|
-
def
|
51
|
+
def show_rails_env_name_before_prompt_for_pry_before_v0_13
|
28
52
|
old_prompt = Pry.config.prompt
|
29
53
|
|
30
54
|
Pry.config.prompt = [
|
@@ -6,7 +6,7 @@ class AwesomeRailsConsole::InstallGenerator < Rails::Generators::Base
|
|
6
6
|
def update_gemfile
|
7
7
|
gem_group :development, :test do
|
8
8
|
gem 'hirb'
|
9
|
-
gem 'hirb-unicode-steakknife', require: 'unicode
|
9
|
+
gem 'hirb-unicode-steakknife', require: 'hirb-unicode'
|
10
10
|
gem 'pry-byebug'
|
11
11
|
gem 'pry-stack_explorer'
|
12
12
|
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.
|
4
|
+
version: 0.4.5
|
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: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.7.3
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Simple and useful rails console enhancements
|