marco-polo 0.1.1 → 1.0.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjhlMmIwZmY2Yzc4N2JiZTBmYTBlMDRmZDIzY2Q4YmM4ZmUyODJmMg==
4
+ OGY1Yjg3YTMxYjU1MmQxMTAzNGZlMGY4ZjRmZTkwNTY2Y2NiMjY5NA==
5
5
  data.tar.gz: !binary |-
6
- YTdiZjNiY2MwZTVhMGRjMjVhZTVhYWJiYWRmNWQxMDc5NDI4ZGI3Zg==
6
+ OTE3OWM2ZWY4YmNmZjVkYzU0MWM2OTAzMmFlOTBhZjZiOTg1ODk1Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTk5YmI5MjNjNjJhY2NhMTc2YmVjNzlkNjM4NjQzMzRiYzkxMDdjN2NlNmNl
10
- MzdmOGM3NmQ2YzE5ZTE3MWU3ZDliZGJlMmY0NjM1NGM2YjY2ZGIwMGJlYzUz
11
- YjRjNTRjZmFhMjQ5MzBiM2M2ODI2NjkzM2JlYmY3YWYzOWY4MDg=
9
+ ZTc1NGZiZTU5YmViOWUwNmNiMDE3NmMxODhlNzMzZmQ0NWVhYjY1NWJhMTEw
10
+ ODg0YjQxOTlhMDNkOGRlNzRhNmM5NTVjZTkwMTE1OGU2NDk3NGE3OGUyNjJk
11
+ ODA5NDYyNDhjNTI0ZDg0MTA5YzlhNTVhNGY3NjY1YmY0NjAwNGM=
12
12
  data.tar.gz: !binary |-
13
- NGRjNzYzMTdjODA1OTEwMGQxNDgwOGIzZmM2NmViNGY0MWEwODkwNTQ4YTcw
14
- NWI0YTIzNGNkYzE0NzBmNzRkMDUzODkxNThlMjhiZWJjMDU2NjkwMjQ2ZmYy
15
- MmI5YmFhYTRkMjg4ZDJjNGE4OTA1N2FhMzA0YzlhZWM3YTI1Mjg=
13
+ ODg1ZGU4MTUwYzc1YjY3YmE4NmI0YzMzNDM5ZWYzNWI5YmFiMWRhODdiMmEy
14
+ NjdhMTk0ZGJmZjczY2MxMDQ3YTUwZGYzNDg2YjE0YTIwZjkwMWE1MWIyYzVm
15
+ NTg2MzFlOThjYzA2YWU4N2I4ZmJkNTNhY2U2YzQxNDgxNjRmMDQ=
@@ -0,0 +1,64 @@
1
+ # marco-polo
2
+
3
+ MarcoPolo shows your app name and environment in your console prompt so you don't accidentally break production
4
+
5
+ ## Installation
6
+
7
+ In your Gemfile: gem "marco-polo", "~> 0.1.0"
8
+ $ bundle install
9
+
10
+ ## Usage
11
+
12
+ There's nothing to do! Just install the gem and bask in your newfound console security.
13
+
14
+ Before marco-polo:
15
+
16
+ ~/Sites/myapp$ rails c
17
+ >
18
+
19
+ ~/Sites/myapp$ heroku run console -a myapp
20
+ >
21
+
22
+ After marco-polo:
23
+
24
+ ~/Sites/myapp$ rails c
25
+ myapp(dev)>
26
+
27
+ ~/Sites/myapp$ heroku run console -a myapp
28
+ myapp(prod)>
29
+
30
+ ## Help!
31
+
32
+ So far this has been verified on:
33
+
34
+ Ruby Version | Rails Version
35
+ -------------|---------------
36
+ 1.9.3 | 3.2
37
+ | 4.0
38
+ 2.0.0 | 3.2
39
+ | 4.0
40
+
41
+ If you're using it with different versions please let me know so we can
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!
44
+
45
+ ## Secret Feature: custom .irbrc
46
+
47
+ The central mechanism of marco-polo is adding a `require` flag to the rails command that's starting IRB,
48
+ using it to require a file that changes the prompt. It will also let you load your own irbrc, to set up
49
+ any console tools you like! And since this file is required after your app is required, you can use all
50
+ your app objects inside it.
51
+
52
+ For example, one of my projects uses the sentient_user gem to help assign
53
+ actors to all our papertrail events. Papertrail works great in my app code, but I always forget
54
+ to set User.current when I'm in the console. Solution? Prompt myself to "log in" when my console
55
+ loads.
56
+
57
+ print "Who are you? "
58
+ email = gets.chomp.downcase
59
+ user = User.find_by_email(email)
60
+ user.make_current
61
+ PaperTrail.whodunnit = user
62
+
63
+ This code lives in a file called `.irbrc.rb` in my project root and is automatically loaded into my console
64
+ by marco-polo.
@@ -1,3 +1,3 @@
1
1
  module MarcoPolo
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
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: 0.1.1
4
+ version: 1.0.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: 2013-11-09 00:00:00.000000000 Z
11
+ date: 2013-11-15 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
@@ -17,7 +17,7 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - README.rdoc
20
+ - README.md
21
21
  - lib/marco-polo.rb
22
22
  - lib/marco-polo/marco-polo.irbrc.rb
23
23
  - lib/marco-polo/version.rb
@@ -1,29 +0,0 @@
1
- = marco-polo
2
-
3
- MarcoPolo shows your app name and environment in your console prompt so you don't accidentally break production
4
-
5
- == Installation
6
-
7
- In your Gemfile: gem "marco-polo", "~> 0.1.0"
8
- $ bundle install
9
-
10
- == Usage
11
-
12
- There's nothing to do! Just install the gem and bask in your newfound console security.
13
-
14
- Before marco-polo:
15
-
16
- ~/Sites/myapp$ rails c
17
- >
18
-
19
- ~/Sites/myapp$ heroku run console -a myapp
20
- >
21
-
22
- After marco-polo:
23
-
24
- ~/Sites/myapp$ rails c
25
- myapp(dev)>
26
-
27
- ~/Sites/myapp$ heroku run console -a myapp
28
- myapp(prod)>
29
-