env-switch 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 39fc4a0815bff0bed67921fc9f31722a8cb6923534dd2cc6c3e65aeae9a694d9
4
+ data.tar.gz: 85bf1e8317276571aae013331750e15b74593985579cd9c8ee41c73e208ad20d
5
+ SHA512:
6
+ metadata.gz: 7a6b20c7e6f79cb99bff6e460ff0851656d607966fadd1de986a8a2fabf00d6ad6aa83b833e84468af7c1a58fd2300c94dc8a08f913c9ede5c6efa90be20295e
7
+ data.tar.gz: b4e044ecce0cde184c14236c14f8590d8aca0ab9790bff59c997c214442d3e70ee32b9b1037bcc4041ec4eb6848bebd45de6e655fa8586d0317322bd8f8e2280
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'env_switch'
4
+ EnvSwitch.switch(ARGV[0])
@@ -0,0 +1,8 @@
1
+ require 'env_switch/switcher'
2
+
3
+ class EnvSwitch
4
+ def self.switch(env_filename)
5
+ switcher = Switcher.new(env_filename)
6
+ switcher.switch
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ class Switcher
2
+ def initialize(env_filename)
3
+ @env_filename = env_filename
4
+ end
5
+
6
+ def switch
7
+ files = Dir.glob("*.env")
8
+
9
+ result = files.select { |f| f == "#{@env_filename}.env" }
10
+
11
+ if !result.empty?
12
+ FileUtils.cp(result.first, '.env')
13
+ puts "Copied #{result.first} to .env"
14
+ else
15
+ puts "No env found for #{@env_filename}"
16
+ end
17
+
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: env-switch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Paul Daniel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple environment switcher
14
+ email: paulgdan@gmail.com
15
+ executables:
16
+ - env_switch
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/env_switch
21
+ - lib/env_switch.rb
22
+ - lib/env_switch/switcher.rb
23
+ homepage: https://rubygems.org/gems/env_switch
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubygems_version: 3.0.3
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Switch environments!
46
+ test_files: []