nib 1.3.0 → 1.4.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/VERSION +1 -1
- data/bin/nib +5 -2
- data/config/commands.json +1 -1
- data/lib/nib.rb +1 -0
- data/lib/nib/console.rb +2 -34
- data/lib/nib/exec.rb +4 -3
- data/lib/nib/history.rb +32 -0
- data/lib/nib/run.rb +1 -0
- data/lib/nib/shell.rb +2 -17
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2d0d457ee0bdd2654793fd043122a1e2dfebce5
|
4
|
+
data.tar.gz: 086c7ac0a6e0bbf12cbd6b6abdc0e866a46fb80d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79e0312ce728a86b455be93175cb2918f4bdb725e17391d1dac273b19ac3e58b9c667fe88f7be6f662cf70f8b193d9b4bc70850eef580aede59754116227d2b
|
7
|
+
data.tar.gz: 6e6c6345b2dd972350005ec6a935dd31c95e08f651e2872c502d54e10b780bf9b181652e7b48116f82c765555e23f613e830075e154dcbf8af075c5e812ca37f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/bin/nib
CHANGED
@@ -150,7 +150,7 @@ arg :service
|
|
150
150
|
arg :command, %i(optional multiple)
|
151
151
|
command :rubocop do |c|
|
152
152
|
c.action do |global, options, args|
|
153
|
-
Nib::Run.execute(args.insert(1, :rubocop), '--no-deps')
|
153
|
+
Nib::Run.execute(args.insert(1, :"rubocop -D"), '--no-deps')
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
@@ -161,12 +161,15 @@ command :run do |c|
|
|
161
161
|
Nib::Options::Augmenter.augment(c)
|
162
162
|
|
163
163
|
c.action do |global, options, args|
|
164
|
+
# work around an `OptionParser` limitation: https://git.io/vDKrh
|
165
|
+
options[:'no-deps'] = options['no-deps'] = ARGV.include?('--no-deps')
|
166
|
+
|
164
167
|
Nib::Run.execute(args, Nib::Options::Parser.parse(options))
|
165
168
|
end
|
166
169
|
end
|
167
170
|
|
168
171
|
desc 'Runs application specific setup for the given service'
|
169
|
-
long_desc 'By default the setup command will execute \'
|
172
|
+
long_desc 'By default the setup command will execute \'gem install bundler && bundle install\'.
|
170
173
|
|
171
174
|
This behavior can be overriden by providing an executable file in the project at $pwd/bin/setup.
|
172
175
|
Additionally the setup process can be augmented by providing either $pwd/bin/setup.before or
|
data/config/commands.json
CHANGED
@@ -91,7 +91,7 @@
|
|
91
91
|
"name": "setup",
|
92
92
|
"type": "custom",
|
93
93
|
"short_description": "Runs application specific setup for the given service",
|
94
|
-
"long_description": "By default the setup command will execute '
|
94
|
+
"long_description": "By default the setup command will execute 'gem install bundler && bundle install'.\n\nThis behavior can be overriden by providing an executable file in the project at $pwd/bin/setup.\nAdditionally the setup process can be augmented by providing either $pwd/bin/setup.before or\n$pwd/bin/setup.after. This allows for extending the default behavior without having to redefine it.",
|
95
95
|
"options": []
|
96
96
|
},
|
97
97
|
{
|
data/lib/nib.rb
CHANGED
data/lib/nib/console.rb
CHANGED
@@ -1,24 +1,8 @@
|
|
1
1
|
class Nib::Console
|
2
2
|
include Nib::Command
|
3
|
-
|
4
|
-
IRBRC = <<~'IRB'.freeze
|
5
|
-
require \"rubygems\"
|
6
|
-
require \"irb/completion\"
|
7
|
-
require \"irb/ext/save-history\"
|
8
|
-
# irb configuration
|
9
|
-
IRB.conf[:PROMPT_MODE] = :SIMPLE
|
10
|
-
IRB.conf[:AUTO_INDENT] = true
|
11
|
-
# irb history
|
12
|
-
IRB.conf[:EVAL_HISTORY] = 10
|
13
|
-
IRB.conf[:SAVE_HISTORY] = 1000
|
14
|
-
IRB.conf[:HISTORY_FILE] = \"#{Dir.pwd}/tmp/irb_history\"
|
15
|
-
IRB
|
16
|
-
|
17
|
-
PRYRC = 'Pry.config.history.file = \"#{Dir.pwd}/tmp/irb_history\"'.freeze
|
3
|
+
prepend Nib::History
|
18
4
|
|
19
5
|
SCRIPT = <<~SH.freeze
|
20
|
-
echo '#{IRBRC}' > /root/.irbrc
|
21
|
-
echo '#{PRYRC}' > /root/.pryrc
|
22
6
|
has_pry=false
|
23
7
|
has_boot=false
|
24
8
|
if hash pry 2>/dev/null ; then
|
@@ -43,25 +27,9 @@ class Nib::Console
|
|
43
27
|
fi
|
44
28
|
SH
|
45
29
|
|
46
|
-
def execute
|
47
|
-
system('mkdir', '-p', './tmp')
|
48
|
-
super
|
49
|
-
end
|
50
|
-
|
51
|
-
def script
|
52
|
-
@script ||= <<~SCRIPT
|
53
|
-
docker-compose \
|
54
|
-
run \
|
55
|
-
--rm \
|
56
|
-
-e HISTFILE=./tmp/shell_history \
|
57
|
-
#{service} \
|
58
|
-
#{command}
|
59
|
-
SCRIPT
|
60
|
-
end
|
61
|
-
|
62
30
|
private
|
63
31
|
|
64
32
|
def command
|
65
|
-
|
33
|
+
SCRIPT
|
66
34
|
end
|
67
35
|
end
|
data/lib/nib/exec.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
class Nib::Exec
|
2
2
|
include Nib::Command
|
3
|
+
prepend Nib::History
|
3
4
|
|
4
5
|
def script
|
5
6
|
@script ||= <<~SCRIPT
|
@@ -7,15 +8,15 @@ class Nib::Exec
|
|
7
8
|
exec \
|
8
9
|
#{options} \
|
9
10
|
#{service} \
|
10
|
-
|
11
|
+
#{command}
|
11
12
|
SCRIPT
|
12
13
|
end
|
13
14
|
|
14
15
|
def action
|
15
|
-
command.to_s.empty? ? '' : "-c '#{command}'"
|
16
|
+
@command.to_s.empty? ? '' : "-c '#{@command}'"
|
16
17
|
end
|
17
18
|
|
18
|
-
def
|
19
|
+
def command
|
19
20
|
"
|
20
21
|
if hash bash 2>/dev/null ; then
|
21
22
|
bash #{action}
|
data/lib/nib/history.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Nib::History
|
2
|
+
IRBRC = <<~'IRB'.freeze
|
3
|
+
require \"rubygems\"
|
4
|
+
require \"irb/completion\"
|
5
|
+
require \"irb/ext/save-history\"
|
6
|
+
# irb configuration
|
7
|
+
IRB.conf[:PROMPT_MODE] = :SIMPLE
|
8
|
+
IRB.conf[:AUTO_INDENT] = true
|
9
|
+
# irb history
|
10
|
+
IRB.conf[:EVAL_HISTORY] = 10
|
11
|
+
IRB.conf[:SAVE_HISTORY] = 1000
|
12
|
+
IRB.conf[:HISTORY_FILE] = \"#{Dir.pwd}/tmp/irb_history\"
|
13
|
+
IRB
|
14
|
+
|
15
|
+
PRYRC = 'Pry.config.history.file = \"#{Dir.pwd}/tmp/irb_history\"'.freeze
|
16
|
+
|
17
|
+
def execute
|
18
|
+
system('mkdir', '-p', './tmp')
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
def command
|
23
|
+
<<~COMMAND
|
24
|
+
/bin/sh -c \"
|
25
|
+
export HISTFILE=./tmp/shell_history
|
26
|
+
echo '#{IRBRC}' > /root/.irbrc
|
27
|
+
echo '#{PRYRC}' > /root/.pryrc
|
28
|
+
#{super}
|
29
|
+
\"
|
30
|
+
COMMAND
|
31
|
+
end
|
32
|
+
end
|
data/lib/nib/run.rb
CHANGED
data/lib/nib/shell.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
class Nib::Shell
|
2
2
|
include Nib::Command
|
3
|
+
prepend Nib::History
|
3
4
|
|
4
5
|
SCRIPT = <<~SH.freeze
|
5
6
|
if hash bash 2>/dev/null ; then
|
@@ -11,25 +12,9 @@ class Nib::Shell
|
|
11
12
|
fi
|
12
13
|
SH
|
13
14
|
|
14
|
-
def execute
|
15
|
-
system('mkdir', '-p', './tmp')
|
16
|
-
super
|
17
|
-
end
|
18
|
-
|
19
|
-
def script
|
20
|
-
@script ||= <<~SCRIPT
|
21
|
-
docker-compose \
|
22
|
-
run \
|
23
|
-
--rm \
|
24
|
-
-e HISTFILE=./tmp/shell_history \
|
25
|
-
#{service} \
|
26
|
-
#{command}
|
27
|
-
SCRIPT
|
28
|
-
end
|
29
|
-
|
30
15
|
private
|
31
16
|
|
32
17
|
def command
|
33
|
-
|
18
|
+
SCRIPT
|
34
19
|
end
|
35
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Allen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
113
|
+
name: simplecov
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - ">="
|
@@ -123,6 +123,20 @@ dependencies:
|
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: codeclimate-test-reporter
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.0.5
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 1.0.5
|
126
140
|
description: 'nib is a docker-compose wrapper geared towards Ruby/Rails development.
|
127
141
|
|
128
142
|
'
|
@@ -146,6 +160,7 @@ files:
|
|
146
160
|
- lib/nib/console.rb
|
147
161
|
- lib/nib/debug.rb
|
148
162
|
- lib/nib/exec.rb
|
163
|
+
- lib/nib/history.rb
|
149
164
|
- lib/nib/options.rb
|
150
165
|
- lib/nib/options/augmenter.rb
|
151
166
|
- lib/nib/options/parser.rb
|
@@ -174,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
189
|
version: '0'
|
175
190
|
requirements: []
|
176
191
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.6.
|
192
|
+
rubygems_version: 2.6.10
|
178
193
|
signing_key:
|
179
194
|
specification_version: 4
|
180
195
|
summary: The tip of the pen (compose)
|