devup 0.4.3.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96dfaf1740d9680c2a7060ac68cec0e442df06c459a802f96509429b19ff7ac7
4
- data.tar.gz: 01423f04ef9c067798d12d595421ba51ef75410ebfe42c55c66f16dbf265aef2
3
+ metadata.gz: 511e80ba2fee56f5436b039bed0a4971bd862d72b567212ce9d308c67ee8a1e2
4
+ data.tar.gz: d6ee87d4b3072ec10b9b5f4cba552e9c3227ff2541ac94ad8e2811a71b5d0f88
5
5
  SHA512:
6
- metadata.gz: d33c8f40d01c63d1c1d3738e095b7975d78cd7e08a5abecfdc6f5d2349f06216d993e382bf94ccafe117c4e750b5e5973723228ec028d4a86aa2b3212dd2bfad
7
- data.tar.gz: c43fb7fd47119bbfe821f26e06d6b081fcfcb93f31310a9e89bf0d7e61544822d5d5051db26b3574f3b42e02504464ef39733fedbc6f5f3eb8eb82cf73f1e990
6
+ metadata.gz: 43b8fef236dda464cd9264096534f997dce81a1b71f266a3892161008f036d77053345324ad7f2f936ce34fc58708f5b24f499ad9d0b9f19c2bbe10642f4eaf5
7
+ data.tar.gz: 1c54bc229b93496280b47bd81d2e8a900db0d08fd9acc7c774f857e19ddbf05fb73a38aad292b65b78fdb8bd855666e2ef26f28d34f4083b83d1212c8b8eb658
@@ -1 +1 @@
1
- ruby-2.7.1
1
+ ruby-2.5.8
data/Gemfile CHANGED
@@ -8,4 +8,3 @@ gem "rspec", "~> 3.0"
8
8
  gem "standard"
9
9
  gem "simplecov", require: false
10
10
  gem "byebug"
11
- gem "lefthook"
@@ -1,30 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devup (0.4.3.1)
4
+ devup (0.5.0)
5
5
  dotenv
6
6
  dry-cli
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- ast (2.4.0)
11
+ ast (2.4.1)
12
12
  byebug (11.1.3)
13
- concurrent-ruby (1.1.6)
14
- diff-lcs (1.3)
13
+ concurrent-ruby (1.1.7)
14
+ diff-lcs (1.4.4)
15
15
  docile (1.3.2)
16
- dotenv (2.7.5)
16
+ dotenv (2.7.6)
17
17
  dry-cli (0.6.0)
18
18
  concurrent-ruby (~> 1.0)
19
- jaro_winkler (1.5.4)
20
- json (2.3.0)
21
- lefthook (0.7.2)
22
- parallel (1.19.1)
23
- parser (2.7.1.0)
24
- ast (~> 2.4.0)
19
+ parallel (1.19.2)
20
+ parser (2.7.1.4)
21
+ ast (~> 2.4.1)
25
22
  rainbow (3.0.0)
26
23
  rake (12.3.3)
27
- rexml (3.1.9)
24
+ regexp_parser (1.7.1)
25
+ rexml (3.2.4)
28
26
  rspec (3.9.0)
29
27
  rspec-core (~> 3.9.0)
30
28
  rspec-expectations (~> 3.9.0)
@@ -38,26 +36,28 @@ GEM
38
36
  diff-lcs (>= 1.2.0, < 2.0)
39
37
  rspec-support (~> 3.9.0)
40
38
  rspec-support (3.9.3)
41
- rubocop (0.80.1)
42
- jaro_winkler (~> 1.5.1)
39
+ rubocop (0.85.1)
43
40
  parallel (~> 1.10)
44
41
  parser (>= 2.7.0.1)
45
42
  rainbow (>= 2.2.2, < 4.0)
43
+ regexp_parser (>= 1.7)
46
44
  rexml
45
+ rubocop-ast (>= 0.0.3)
47
46
  ruby-progressbar (~> 1.7)
48
- unicode-display_width (>= 1.4.0, < 1.7)
49
- rubocop-performance (1.5.2)
47
+ unicode-display_width (>= 1.4.0, < 2.0)
48
+ rubocop-ast (0.1.0)
49
+ parser (>= 2.7.0.1)
50
+ rubocop-performance (1.6.1)
50
51
  rubocop (>= 0.71.0)
51
52
  ruby-progressbar (1.10.1)
52
- simplecov (0.16.1)
53
+ simplecov (0.18.5)
53
54
  docile (~> 1.1)
54
- json (>= 1.8, < 3)
55
- simplecov-html (~> 0.10.0)
56
- simplecov-html (0.10.2)
57
- standard (0.2.4)
58
- rubocop (~> 0.80.1)
59
- rubocop-performance (~> 1.5.2)
60
- unicode-display_width (1.6.1)
55
+ simplecov-html (~> 0.11)
56
+ simplecov-html (0.12.2)
57
+ standard (0.4.7)
58
+ rubocop (~> 0.85.0)
59
+ rubocop-performance (~> 1.6.0)
60
+ unicode-display_width (1.7.0)
61
61
 
62
62
  PLATFORMS
63
63
  ruby
@@ -65,11 +65,10 @@ PLATFORMS
65
65
  DEPENDENCIES
66
66
  byebug
67
67
  devup!
68
- lefthook
69
68
  rake (~> 12.0)
70
69
  rspec (~> 3.0)
71
70
  simplecov
72
71
  standard
73
72
 
74
73
  BUNDLED WITH
75
- 2.1.4
74
+ 1.17.3
data/README.md CHANGED
@@ -38,12 +38,21 @@ and
38
38
  Update your database.yml to use ENV:
39
39
 
40
40
  ```yaml
41
- test:
42
- url: <%= ENV.fetch("DATABASE_URL") %>
41
+ default: &default
42
+ adapter: postgresql
43
+ encoding: unicode
44
+ host: <%= ENV.fetch("POSTGRES_HOST") %>
45
+ port: <%= ENV.fetch("POSTGRES_PORT") %>
46
+ username: postgres
47
+ password:
43
48
 
44
49
  development:
45
- url: <%= ENV.fetch("DATABASE_URL") %>
50
+ <<: *default
51
+ database: development
46
52
 
53
+ test:
54
+ <<: *default
55
+ database: test
47
56
  ```
48
57
 
49
58
 
@@ -53,7 +62,7 @@ You are ready to use rails with PostgreSQL configured
53
62
  DevUp! INFO starting up...
54
63
  DevUp! INFO up
55
64
 
56
- $ Created database 'dummy_rails_test'
65
+ $ Created database 'test'
57
66
 
58
67
 
59
68
  ## Without Rails
@@ -65,7 +74,7 @@ ENV vars from .env.services are loaded with dotenv automatically.
65
74
  require "devup"
66
75
  require "sequel"
67
76
 
68
- DB = Sequel.connect(ENV.fetch("DATABASE_URL"))
77
+ DB = Sequel.connect(adapter: "postgres", host: ENV.fetch("POSTGRES_HOST"), port: ENV.fetch("POSTGRES_PORT"), database: "blog", user: 'postgres')
69
78
  ```
70
79
 
71
80
 
@@ -103,6 +112,26 @@ Now you can run app
103
112
 
104
113
  If you don't want devup to setup your dev services, you can disable it by using `DEVUP_ENABLED=false`. Just add it to .env.local file.
105
114
 
115
+ ### Override some service
116
+
117
+ If you want to switch some service from DevUp! to another, you can override ENV in a local dotenv configs:
118
+
119
+ * .env.local
120
+ * .env.development.local
121
+ * .env.test.local
122
+
123
+ Just put to your .env.local:
124
+
125
+ export POSTGRES_HOST=0.0.0.0
126
+ export POSTGRES_PORT=5432
127
+
128
+ ### Get some DATABASE_URL working
129
+
130
+
131
+ Just put to your .env.test or .env.development something like:
132
+
133
+ DATABASE_URL=postgres://postgres@$POSTGRES_HOST:$POSTGRES_PORT/test_db
134
+
106
135
  ### Debug
107
136
 
108
137
  $ export DEVUP_LOG_LEVEL=debug
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ["Sergei O. Udalov"]
11
11
  spec.email = ["sergei@udalovs.ru"]
12
12
 
13
- spec.summary = "A tool to manage docker-compose for developmnet"
13
+ spec.summary = "A tool to manage docker-compose for development"
14
14
  # spec.description = %q{TODO: Write a longer description or delete this line.}
15
15
  spec.homepage = "https://github.com/sergio-fry/devup"
16
16
  spec.license = "MIT"
@@ -1,2 +1,16 @@
1
1
  require "dotenv"
2
- Dotenv.load ".env.services"
2
+ require "devup/dotenv_load_list"
3
+
4
+ begin
5
+ Dotenv.instrumenter = ActiveSupport::Notifications
6
+ ActiveSupport::Notifications.subscribe(/^dotenv/) do |*args|
7
+ event = ActiveSupport::Notifications::Event.new(*args)
8
+ Spring.watch event.payload[:env].filename # if Rails.application
9
+ end
10
+ rescue LoadError, ArgumentError
11
+ # Spring is not available
12
+ end
13
+
14
+ env = (ENV["RAILS_ENV"] || "development").to_sym
15
+ list = Devup::DotenvLoadList.new(env: env)
16
+ Dotenv.load(*list.to_a)
@@ -0,0 +1,35 @@
1
+ module Devup
2
+ class DotenvLoadList
3
+ def initialize(env: nil)
4
+ @env = env.to_sym unless env.nil?
5
+ end
6
+
7
+ def to_a
8
+ list = []
9
+
10
+ list << ".env.#{@env}.local" if env_defined?
11
+ list << ".env.local" unless test?
12
+ list << ".env.services"
13
+ list << ".env.#{@env}" if env_defined?
14
+ list << ".env"
15
+
16
+ list
17
+ end
18
+
19
+ def include?(val)
20
+ to_a.include? val
21
+ end
22
+
23
+ def index(val)
24
+ to_a.index val
25
+ end
26
+
27
+ def test?
28
+ @env == :test
29
+ end
30
+
31
+ def env_defined?
32
+ !@env.nil?
33
+ end
34
+ end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module Devup
2
- VERSION = "0.4.3.1"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei O. Udalov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-03 00:00:00.000000000 Z
11
+ date: 2020-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -63,7 +63,6 @@ files:
63
63
  - devup.gemspec
64
64
  - docker-compose.devup.yml
65
65
  - exe/devup
66
- - lefthook.yml
67
66
  - lib/devup.rb
68
67
  - lib/devup/boot.rb
69
68
  - lib/devup/cli.rb
@@ -73,6 +72,7 @@ files:
73
72
  - lib/devup/compose.rb
74
73
  - lib/devup/compose/ps.rb
75
74
  - lib/devup/dotenv.rb
75
+ - lib/devup/dotenv_load_list.rb
76
76
  - lib/devup/environment.rb
77
77
  - lib/devup/logger.rb
78
78
  - lib/devup/port_checker.rb
@@ -101,8 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.1.2
104
+ rubygems_version: 3.0.8
105
105
  signing_key:
106
106
  specification_version: 4
107
- summary: A tool to manage docker-compose for developmnet
107
+ summary: A tool to manage docker-compose for development
108
108
  test_files: []
@@ -1,7 +0,0 @@
1
- pre-commit:
2
- parallel: true
3
- commands:
4
- lint:
5
- files: git diff --name-only --staged
6
- glob: "*.rb"
7
- run: standardrb --force-exclusion {files}