dockrails 1.0.7 → 1.1.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
  SHA1:
3
- metadata.gz: 1b388588e6268d3318b8b8a6a913d07557547af4
4
- data.tar.gz: c28ccebfa601db4179777d8f6975629b6078d26a
3
+ metadata.gz: cdbea4bbf0a49789e2faf5eb0957d3b77bce3ac0
4
+ data.tar.gz: f8d24bfba83e098298263b9c65db4866062621da
5
5
  SHA512:
6
- metadata.gz: 81fb98e8078e304c3585236ab83b3ce7ac7515dfeadb8336cbd7c1cac9db0440f6616b133afef79caee8fdc01bb906fdb57da16801e4fac305ebbd2cef04ba09
7
- data.tar.gz: fefc1901c4a8d36a3a94413b651cb5e5820621949430b525d11a3431451d2df9566dfce78c6ff5f1841ced1665a051b67dfa60ccb46151244ae9e3e92d06547c
6
+ metadata.gz: a7288f85592341137a5d4d85a80e8c18380dd0eb370195e6f16ce7e5e75d336c4e4f9d4e51763577d811e8d08489b083c2acb6731705611158b17f83941a56f2
7
+ data.tar.gz: f5cfe88d1137e774b8537994577ab2da633ab7daf6be0de0a1abdda64f3e5adf87a438ca5349ddc9d6d7e7b5fbe357be2f96ef4acdd1cd30f2460ac6a0b95823
data/bin/dockrails CHANGED
@@ -9,6 +9,8 @@ program :version, Dockrails::VERSION
9
9
  program :description, 'CLI to Generate and Run a Rails environment with Docker'
10
10
  program :help_formatter, Commander::HelpFormatter::TerminalCompact
11
11
 
12
+ default_command :help
13
+
12
14
  command :init do |c|
13
15
  c.syntax = 'dockrails init'
14
16
  c.summary = 'Initialize your Rails Docker environment'
@@ -71,24 +73,24 @@ command :start do |c|
71
73
  c.description = ''
72
74
  c.example 'description', 'dockrails start'
73
75
  c.action do |args, options|
74
- system("docker-sync-stack start")
76
+ system("docker-sync start && docker-compose up")
75
77
  end
76
78
  end
77
79
 
78
80
  command :clean do |c|
79
81
  c.syntax = 'dockrails clean'
80
- c.summary = 'Clean the docker containers'
82
+ c.summary = 'Stop the containers'
81
83
  c.description = ''
82
84
  c.example 'description', 'dockrails clean'
83
85
  c.action do |args, options|
84
- system("docker-sync-stack clean")
86
+ system("docker-compose stop && docker-sync clean")
85
87
  end
86
88
  end
87
89
  alias_command :stop, :'clean'
88
90
 
89
91
  command :build do |c|
90
92
  c.syntax = 'dockrails build'
91
- c.summary = 'Build or rebuild the docker image'
93
+ c.summary = 'Build or rebuild the services'
92
94
  c.description = ''
93
95
  c.example 'description', 'dockrails build'
94
96
  c.action do |args, options|
@@ -96,6 +98,20 @@ command :build do |c|
96
98
  end
97
99
  end
98
100
 
101
+ command :logs do |c|
102
+ c.syntax = 'dockrails logs [container]'
103
+ c.summary = 'Access containers logs'
104
+ c.description = ''
105
+ c.example 'description', 'dockrails logs web'
106
+ c.action do |args, options|
107
+ if args.size < 1
108
+ system("docker-compose logs --tail=20 -f")
109
+ else
110
+ system("docker-compose logs --tail=20 -f #{args.join(" ")}")
111
+ end
112
+ end
113
+ end
114
+
99
115
  command :run do |c|
100
116
  c.syntax = 'dockrails run [container] [command]'
101
117
  c.summary = 'Run a command on a specific container'
@@ -133,7 +149,7 @@ command :attach do |c|
133
149
  if args.size < 1
134
150
  say "\n<%= color 'Please specify a container, ex: dockrails attach web', RED%>"
135
151
  else
136
- system("docker attach $(docker-compose ps -q #{args[0]})")
152
+ system("docker attach --detach-keys ctrl-c $(docker-compose ps -q #{args[0]})")
137
153
  end
138
154
  end
139
155
  end
@@ -1,3 +1,3 @@
1
1
  module Dockrails
2
- VERSION = "1.0.7"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Montard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2017-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander