jefferies_tube 1.1.0 → 1.1.1
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 +4 -4
- data/lib/jefferies_tube/console.rb +26 -0
- data/lib/jefferies_tube/custom_prompts.irbrc.rb +9 -29
- data/lib/jefferies_tube/railtie.rb +7 -19
- data/lib/jefferies_tube/version.rb +3 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06d45e26cc3c3f6db3337acf9d656e02dd4afdad972aea8f1e298482805a1520
|
4
|
+
data.tar.gz: e8e8a23b284b5a03e65bc9c3a3d7df73fdee46573972353c1c34616b7d56dbd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b485c95ad3b92bf78a32c54e1b70b3a38b09dec3d4314ba5e6b3f45e2f691dbad4df4e864ba4a880fefbe0d4229c70a5480f13fbd39727e4544353d340802932
|
7
|
+
data.tar.gz: b1e7081ebbf93d900d471e9ffdc2bce83f91eb8a941430e0939586dded1095a0e128149231d51da169fa2157e9522d6fea7ce0b5d4bec0d5f14ad8f86ef093bc
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class JefferiesTube::Console
|
2
|
+
def self.prompt
|
3
|
+
rails_env = JefferiesTube.configuration.environment
|
4
|
+
if rails_env
|
5
|
+
color = "\e[0m" #Default to white text on no background
|
6
|
+
current_app = JefferiesTube.configuration.prompt_name
|
7
|
+
|
8
|
+
# shorten some common long environment names
|
9
|
+
if rails_env == "development"
|
10
|
+
elsif rails_env == "dev"
|
11
|
+
rails_env = "dev"
|
12
|
+
color = "\e[0;37m\e[1;44m" #White on blue
|
13
|
+
elsif ["test", "qa", "staging"].include? rails_env
|
14
|
+
color = "\e[0;37m\e[1;43m" #White on yellow
|
15
|
+
elsif rails_env == "production"
|
16
|
+
rails_env = "prod"
|
17
|
+
color = "\e[0;37m\e[1;41m" #White on red
|
18
|
+
end
|
19
|
+
|
20
|
+
base = "#{color}#{current_app}(#{rails_env})\e[0m"
|
21
|
+
return "#{base}> "
|
22
|
+
else
|
23
|
+
return "#{current_app}> "
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,31 +1,11 @@
|
|
1
|
-
|
1
|
+
prompt = JefferiesTube::Console.prompt
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
IRB.conf[:PROMPT][:RAILS_ENV] = {
|
4
|
+
:PROMPT_I => prompt,
|
5
|
+
:PROMPT_N => prompt,
|
6
|
+
:PROMPT_S => nil,
|
7
|
+
:PROMPT_C => prompt.sub('> ', '>* '),
|
8
|
+
:RETURN => "=> %s\n"
|
9
|
+
}
|
6
10
|
|
7
|
-
|
8
|
-
if ["development", "dev"].include? rails_env
|
9
|
-
rails_env = "dev"
|
10
|
-
color = "\e[0;37m\e[1;44m" #White on blue
|
11
|
-
elsif ["test", "qa", "staging"].include? rails_env
|
12
|
-
color = "\e[0;37m\e[1;43m" #White on yellow
|
13
|
-
elsif rails_env == "production"
|
14
|
-
rails_env = "prod"
|
15
|
-
color = "\e[0;37m\e[1;41m" #White on red
|
16
|
-
end
|
17
|
-
|
18
|
-
base = "#{color}#{current_app}(#{rails_env})\e[0m"
|
19
|
-
prompt = base + "> "
|
20
|
-
|
21
|
-
IRB.conf[:PROMPT][:RAILS_ENV] = {
|
22
|
-
:PROMPT_I => prompt,
|
23
|
-
:PROMPT_N => prompt,
|
24
|
-
:PROMPT_S => nil,
|
25
|
-
:PROMPT_C => base + ">* ",
|
26
|
-
:RETURN => "=> %s\n"
|
27
|
-
}
|
28
|
-
|
29
|
-
IRB.conf[:PROMPT_MODE] = :RAILS_ENV
|
30
|
-
|
31
|
-
end
|
11
|
+
IRB.conf[:PROMPT_MODE] = :RAILS_ENV
|
@@ -1,31 +1,20 @@
|
|
1
1
|
require 'jefferies_tube'
|
2
|
+
require 'jefferies_tube/console'
|
2
3
|
require 'rails'
|
3
4
|
|
4
5
|
module JefferiesTube
|
5
6
|
|
6
7
|
class Railtie < ::Rails::Railtie
|
7
8
|
railtie_name :jefferies_tube
|
8
|
-
|
9
|
+
|
9
10
|
console do
|
10
11
|
ActiveRecord::Base.connection
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
if defined? Pry
|
12
|
+
|
13
|
+
ARGV.push "-r", File.join(File.dirname(__FILE__),"custom_prompts.irbrc.rb")
|
14
|
+
|
15
|
+
if defined? Pry
|
16
16
|
Pry.config.prompt = proc {
|
17
|
-
|
18
|
-
rails_env = JefferiesTube.configuration.environment
|
19
|
-
|
20
|
-
# shorten some common long environment names
|
21
|
-
if rails_env == "development"
|
22
|
-
rails_env = "dev"
|
23
|
-
elsif rails_env == "production"
|
24
|
-
rails_env = "prod"
|
25
|
-
end
|
26
|
-
|
27
|
-
base = "#{current_app}(#{rails_env})"
|
28
|
-
prompt = base + "> "
|
17
|
+
JefferiesTube::Console.prompt
|
29
18
|
}
|
30
19
|
end
|
31
20
|
end
|
@@ -54,7 +43,6 @@ module JefferiesTube
|
|
54
43
|
ActionView::Base.send :include, JefferiesTube::ApplicationHelper
|
55
44
|
end
|
56
45
|
|
57
|
-
|
58
46
|
initializer "fix spring + figaro" do |config|
|
59
47
|
if defined?(Spring) && File.exists?("config/application.yml")
|
60
48
|
require 'spring/watcher'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jefferies_tube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Samson
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/jefferies_tube/capistrano/rails.rb
|
143
143
|
- lib/jefferies_tube/capistrano/s3_assets.rb
|
144
144
|
- lib/jefferies_tube/capistrano/ssh.rb
|
145
|
+
- lib/jefferies_tube/console.rb
|
145
146
|
- lib/jefferies_tube/custom_prompts.irbrc.rb
|
146
147
|
- lib/jefferies_tube/database_backup.rb
|
147
148
|
- lib/jefferies_tube/database_backup_adapter.rb
|