rails-env-switcher 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +30 -10
- data/lib/rails-env-switcher/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,10 +1,27 @@
|
|
1
1
|
Rails Env Switcher
|
2
2
|
===================
|
3
3
|
|
4
|
-
Rails Env Switcher allows your to switch from a rails environmemnt to another one.
|
4
|
+
Rails Env Switcher allows your to switch from a rails environmemnt to another one.
|
5
5
|
Best served chilled with [irb-config](https://github.com/nviennot/irb-config).
|
6
6
|
|
7
|
-
|
7
|
+
Why is it useful?
|
8
|
+
-----------------
|
9
|
+
|
10
|
+
We want to run tests from the rails console.
|
11
|
+
|
12
|
+
### Watch the screencast
|
13
|
+
|
14
|
+
[![Watch the screencast!](https://s3.amazonaws.com/velvetpulse/screencasts/irb-config-screencast.jpg)](http://velvetpulse.com/2012/11/19/improve-your-ruby-workflow-by-integrating-vim-tmux-pry/)
|
15
|
+
|
16
|
+
Usage
|
17
|
+
------
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'rails-env-switcher'
|
21
|
+
```
|
22
|
+
|
23
|
+
If you have [Pry](https://github.com/pry/pry) installed, you will have access to the `env` command:
|
24
|
+
|
8
25
|
|
9
26
|
```
|
10
27
|
pafy@bisou ~/prj/rails-prj [master●] % rails c
|
@@ -18,16 +35,19 @@ Loading development environment (Rails 3.2.8)
|
|
18
35
|
|
19
36
|
```
|
20
37
|
|
38
|
+
Programmatically:
|
21
39
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
[![Watch the screencast!](https://s3.amazonaws.com/velvetpulse/screencasts/irb-config-screencast.jpg)](http://velvetpulse.com/2012/11/19/improve-your-ruby-workflow-by-integrating-vim-tmux-pry/)
|
40
|
+
```ruby
|
41
|
+
RailsEnvSwitcher.with_env 'test', :reload => true do
|
42
|
+
# Do some stuff in the test environment
|
43
|
+
# reload => true means that we want to reload!
|
44
|
+
# Leaving the block returns in the original environment
|
45
|
+
# with_env is nestable
|
46
|
+
end
|
30
47
|
|
48
|
+
# You can also switch permantently with
|
49
|
+
RailsEnvSwitcher.switch_env 'staging'
|
50
|
+
```
|
31
51
|
|
32
52
|
TODO
|
33
53
|
----
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-env-switcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -40,9 +40,9 @@ files:
|
|
40
40
|
- lib/rails-env-switcher/switcher/mongoid.rb
|
41
41
|
- lib/rails-env-switcher/switcher/bundler.rb
|
42
42
|
- lib/rails-env-switcher/switcher/reloader.rb
|
43
|
-
- lib/rails-env-switcher/version.rb
|
44
43
|
- lib/rails-env-switcher/switcher.rb
|
45
44
|
- lib/rails-env-switcher/pry.rb
|
45
|
+
- lib/rails-env-switcher/version.rb
|
46
46
|
- lib/rails-env-switcher.rb
|
47
47
|
- README.md
|
48
48
|
homepage: http://github.com/nviennot/rails-env-switcher
|