producing 0.1.0 → 0.3.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 +4 -4
- data/exe/producing +5 -0
- data/lib/producing/version.rb +1 -1
- data/lib/producing.rb +36 -4
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72553fd76a012c7bb15a41de4b756551aef6ae80c3831c58f32bc95d929b5af0
|
4
|
+
data.tar.gz: f215e0733579d9f4cd1d8ed57bd6e0818329a86a2de0fb34eee1659caf8e9188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24f34c7c8643e21fede64f4986396ba985389fa1a87928e043145a34d6db6f8d7bcec98b9924de302996dbc8a9c83d4dc40881b508eea844a467445dbcabcae9
|
7
|
+
data.tar.gz: ee34e16639be558f9395c308c134820577d6e51885880ba34f9216ca69d3f0653785b76e801a416240cc5c0ab96b76f91ec70fb6f1674ccd6da44390815f7120
|
data/exe/producing
ADDED
data/lib/producing/version.rb
CHANGED
data/lib/producing.rb
CHANGED
@@ -4,10 +4,42 @@ require "git_on"
|
|
4
4
|
|
5
5
|
module Producing
|
6
6
|
def self.true?
|
7
|
-
|
8
|
-
|
7
|
+
environment == :production
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.production?
|
11
|
+
true?
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.development?
|
15
|
+
environment == :development
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.test?
|
19
|
+
environment == :test
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.environment
|
23
|
+
if ENV['ENVIRONMENT']
|
24
|
+
case ENV['ENVIRONMENT'].downcase
|
25
|
+
when 'production'
|
26
|
+
return :production
|
27
|
+
when 'development'
|
28
|
+
return :development
|
29
|
+
when 'test'
|
30
|
+
return :test
|
31
|
+
end
|
32
|
+
end
|
33
|
+
if ENV['RAILS_ENV']
|
34
|
+
return ENV['RAILS_ENV'].downcase.to_sym
|
35
|
+
end
|
36
|
+
if ENV['RACK_ENV']
|
37
|
+
return ENV['RACK_ENV'].downcase.to_sym
|
38
|
+
end
|
9
39
|
git_status = GitOn.status
|
10
|
-
|
11
|
-
|
40
|
+
if git_status[:git] == :active
|
41
|
+
return :production if git_status[:branch] == "master"
|
42
|
+
end
|
43
|
+
:development
|
12
44
|
end
|
13
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard LeBer
|
@@ -16,7 +16,8 @@ description: |2
|
|
16
16
|
- Failing the above, are we on the Git "master" branch?
|
17
17
|
email:
|
18
18
|
- richard.leber@gmail.com
|
19
|
-
executables:
|
19
|
+
executables:
|
20
|
+
- producing
|
20
21
|
extensions: []
|
21
22
|
extra_rdoc_files: []
|
22
23
|
files:
|
@@ -27,6 +28,7 @@ files:
|
|
27
28
|
- LICENSE.txt
|
28
29
|
- README.md
|
29
30
|
- Rakefile
|
31
|
+
- exe/producing
|
30
32
|
- lib/producing.rb
|
31
33
|
- lib/producing/version.rb
|
32
34
|
- sig/producing.rbs
|
@@ -50,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
52
|
- !ruby/object:Gem::Version
|
51
53
|
version: '0'
|
52
54
|
requirements: []
|
53
|
-
rubygems_version: 3.6.
|
55
|
+
rubygems_version: 3.6.9
|
54
56
|
specification_version: 4
|
55
57
|
summary: 'Check: Are we in production?'
|
56
58
|
test_files: []
|