marco-polo 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +18 -13
- data/lib/marco-polo.rb +1 -1
- data/lib/marco-polo/marco-polo.irbrc.rb +1 -1
- data/lib/marco-polo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NjViODc0MDY0YTg0YTBmYTJjNmZkNjkxZWYxYzIzNWZhNjgzZjVkMQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NDg3ZWUxZDcyODg2NDU0ZjIyZGU2MGMxNGRkN2E4NzViM2JjZDE1Zg==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MTE5ZTI1ZGEyZWQ4Yzc2YmMzNTZmNDYxZTljODI4MzNhZGFkOGYxNGRjNTg0
|
|
10
|
+
MDY5YmIxYmYxZTA1ODRiMzE3MDE1OWFlMDc5YmVkZWMxNTNhYjk0YjU3MGM5
|
|
11
|
+
NDA5ZTMyYjAwOTQ3YTVhNDZjNGUzZDUzZGM1MGQzMmQ5MGQ4MmY=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NGM0N2RiMGY4MTFiYmU0YzRiMWFhYmVkZjA3NmYwOWU3MDgxMWFjZDNiMTcx
|
|
14
|
+
MGY1MWExYTJiZmE0YTRiZGViM2ZkM2ZiY2E5NzFkNmZlZWQ4Yjk5NGIwYzFi
|
|
15
|
+
MDNiOWM1ODQzOGNiOTE1MGI1NWI1Y2Y3ZmUzZDhjYjk3N2M1OWU=
|
data/README.md
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
MarcoPolo shows your app name and environment in your console prompt so you don't accidentally break production
|
|
4
4
|
|
|
5
|
+
Officially supporting IRB (standard rails console) and pry (via pry-rails gem).
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
|
-
In your Gemfile: gem "marco-polo"
|
|
9
|
+
In your Gemfile: gem "marco-polo"
|
|
8
10
|
$ bundle install
|
|
9
11
|
|
|
12
|
+
**Note:** if you're using pry, make sure to list marco-polo AFTER pry-rails in your gemfile!
|
|
13
|
+
|
|
10
14
|
## Usage
|
|
11
15
|
|
|
12
16
|
There's nothing to do! Just install the gem and bask in your newfound console security.
|
|
@@ -27,22 +31,17 @@ After marco-polo:
|
|
|
27
31
|
~/Sites/myapp$ heroku run console -a myapp
|
|
28
32
|
myapp(prod)>
|
|
29
33
|
|
|
30
|
-
##
|
|
34
|
+
## Customize app name by ENV
|
|
35
|
+
|
|
36
|
+
You can customize app name by `MARCO_POLO_APP_NAME` environment variable. In order to customize app name, define this environment variable then run your application.
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
$ MARCO_POLO_APP_NAME=app_name rails c
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
-------------|---------------
|
|
36
|
-
1.9.3 | 3.2
|
|
37
|
-
| 4.0
|
|
38
|
-
2.0.0 | 3.2
|
|
39
|
-
| 4.0
|
|
40
|
+
If your application is running on Heroku, set this environment variable by `heroku config:set` command.
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
fill out this table. Tweet me @archslide or submit a PR to update this README.
|
|
43
|
-
If it doesn't work for you please file a bug instead. Thanks everyone!
|
|
42
|
+
$ heroku config:set MARCO_POLO_APP_NAME=app_name
|
|
44
43
|
|
|
45
|
-
## Secret Feature: custom .irbrc
|
|
44
|
+
## Secret Feature (IRB only): custom .irbrc
|
|
46
45
|
|
|
47
46
|
The central mechanism of marco-polo is adding a `require` flag to the rails command that's starting IRB,
|
|
48
47
|
using it to require a file that changes the prompt. It will also let you load your own irbrc, to set up
|
|
@@ -62,3 +61,9 @@ loads.
|
|
|
62
61
|
|
|
63
62
|
This code lives in a file called `.irbrc.rb` in my project root and is automatically loaded into my console
|
|
64
63
|
by marco-polo.
|
|
64
|
+
|
|
65
|
+
## Self Promotion
|
|
66
|
+
|
|
67
|
+
If you like MarcoPolo, help spread the word! Tell your friends, or at the very least star the repo on github.
|
|
68
|
+
|
|
69
|
+
For more console goodness, check out http://github.com/arches/table_print
|
data/lib/marco-polo.rb
CHANGED
|
@@ -19,7 +19,7 @@ end
|
|
|
19
19
|
if defined? Pry
|
|
20
20
|
Pry.config.prompt = [
|
|
21
21
|
proc {
|
|
22
|
-
current_app = Rails.application.class.parent_name.underscore.gsub("_", "-")
|
|
22
|
+
current_app = ENV["MARCO_POLO_APP_NAME"] || Rails.application.class.parent_name.underscore.gsub("_", "-")
|
|
23
23
|
rails_env = Rails.env.downcase
|
|
24
24
|
|
|
25
25
|
# shorten some common long environment names
|
|
@@ -5,7 +5,7 @@ elsif Rails and Rails.env
|
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
if rails_env
|
|
8
|
-
current_app = Rails.application.class.parent_name.underscore.gsub("_", "-")
|
|
8
|
+
current_app = ENV["MARCO_POLO_APP_NAME"] || Rails.application.class.parent_name.underscore.gsub("_", "-")
|
|
9
9
|
|
|
10
10
|
# shorten some common long environment names
|
|
11
11
|
rails_env = "dev" if rails_env == "development"
|
data/lib/marco-polo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: marco-polo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Doyle
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: MarcoPolo shows your app name and environment in your console prompt
|
|
14
14
|
so you don't accidentally break production
|