tell_my_env 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +3 -0
- data/lib/tasks/tell_my_env_tasks.rake +4 -0
- data/lib/tell_my_env/railtie.rb +22 -0
- data/lib/tell_my_env/version.rb +3 -0
- data/lib/tell_my_env.rb +22 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1012bd36e1dfdfa4150d88df23b8ed1a4967b7d58f50de76feed848b92eaa27f
|
4
|
+
data.tar.gz: 47fb0f613a084244c78d3de36945851417fd943fdcc0f9dda61361cf4bffcbcd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1d06cea37f3a86e8d848754116caa3c4eb1e94525839ca0458b1f0ceb392c5d4703fc37ebff2bc124fd0ba6091c0879e9ff359cbde4d03c33f4ce53648008324
|
7
|
+
data.tar.gz: c6d2153bd161ecc36340a7951caf8f2acc386eaf5456e9be105626879db774c05488dba77fedf536fe5f1198728fe40ddf5d4ec6e5b83de4a30d37409f71ebe4
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2022 Igor Kasyanchuk
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# TellMyEnv
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem "tell_my_env"
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install tell_my_env
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module TellMyEnv
|
2
|
+
module X
|
3
|
+
def prompt(*args, &block)
|
4
|
+
color = case Rails.env.to_s
|
5
|
+
when 'staging'
|
6
|
+
TellMyEnv::Starter::YELLOW
|
7
|
+
when 'production'
|
8
|
+
TellMyEnv::Starter::RED
|
9
|
+
else
|
10
|
+
TellMyEnv::Starter::GREEN
|
11
|
+
end
|
12
|
+
args[0] = TellMyEnv::Starter.color_text("#{Rails.env}>", color)
|
13
|
+
super(*args, &block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class Railtie < ::Rails::Railtie
|
18
|
+
console do
|
19
|
+
IRB::Irb.send(:prepend, X) if defined?(IRB)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/tell_my_env.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "tell_my_env/version"
|
2
|
+
require "tell_my_env/railtie"
|
3
|
+
|
4
|
+
module TellMyEnv
|
5
|
+
class Starter
|
6
|
+
# for now
|
7
|
+
NONE = 0
|
8
|
+
BLACK = 30
|
9
|
+
RED = 31
|
10
|
+
GREEN = 32
|
11
|
+
YELLOW = 33
|
12
|
+
BLUE = 34
|
13
|
+
PINK = 35
|
14
|
+
CYAN = 36
|
15
|
+
WHITE = 37
|
16
|
+
|
17
|
+
def self.color_text(text, color_code)
|
18
|
+
"\e[#{color_code}m#{text}\e[0m"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tell_my_env
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Igor Kasyanchuk
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-02-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: See in rails console env in which you are working.
|
42
|
+
email:
|
43
|
+
- igorkasyanchuk@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- lib/tasks/tell_my_env_tasks.rake
|
52
|
+
- lib/tell_my_env.rb
|
53
|
+
- lib/tell_my_env/railtie.rb
|
54
|
+
- lib/tell_my_env/version.rb
|
55
|
+
homepage: https://github.com/igorkasyanchuk/tell_my_env
|
56
|
+
licenses:
|
57
|
+
- MIT
|
58
|
+
metadata:
|
59
|
+
homepage_uri: https://github.com/igorkasyanchuk/tell_my_env
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubygems_version: 3.3.3
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: See in rails console env in which you are working.
|
79
|
+
test_files: []
|