bard 0.27.1 → 0.28.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/install_files/ci +7 -0
- data/install_files/setup +10 -0
- data/install_files/specified_bundler.rb +14 -0
- data/install_files/specified_ruby.rb +41 -0
- data/lib/bard.rb +11 -0
- data/lib/bard/capistrano.rb +6 -0
- data/lib/bard/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b0c647abfb691290a0514fe05e20692856eb1f4
|
4
|
+
data.tar.gz: e491723ff72bfff4107798a7d56419999e6892d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d563a8db967d7a8345d6c6a68aefb1b9d828e491ee0f3807b2d76d9355c629817f55a4e638a7437398fdb00ba484f16b856af680707865f99a4915e603097e24
|
7
|
+
data.tar.gz: fd93711871843f788f3af554f1da91bcee31f3f14ca39ec7220a3f009e35830230272a3016bdca50ff0f53e882ceb249553cf406786366a64b6cec142ac14eb1
|
data/install_files/ci
ADDED
data/install_files/setup
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require_relative './specified_ruby'
|
3
|
+
require_relative './specified_bundler'
|
4
|
+
|
5
|
+
Dir.chdir File.expand_path("..", __dir__) do
|
6
|
+
SpecifiedRuby.ensure!
|
7
|
+
SpecifiedBundler.ensure!
|
8
|
+
exec "bundle check || bundle install && bundle exec rake bootstrap"
|
9
|
+
end
|
10
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module SpecifiedBundler
|
2
|
+
extend self
|
3
|
+
|
4
|
+
def ensure!
|
5
|
+
system("gem install bundler --conservative --version=#{bundler_version}") or raise "Cannot install bundler!"
|
6
|
+
end
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def bundler_version
|
11
|
+
lines = File.readlines("Gemfile.lock")
|
12
|
+
lines.last.strip if lines[-2] == "BUNDLED WITH\n"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rvm'
|
2
|
+
|
3
|
+
module SpecifiedRuby
|
4
|
+
extend self
|
5
|
+
|
6
|
+
def ensure!
|
7
|
+
install unless installed?
|
8
|
+
restart unless current?
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def version
|
14
|
+
File.read(".ruby-version").chomp
|
15
|
+
end
|
16
|
+
|
17
|
+
def gemset
|
18
|
+
File.read(".ruby-gemset").chomp
|
19
|
+
end
|
20
|
+
|
21
|
+
def installed?
|
22
|
+
installed_rubies = `rvm list strings`.split("\n")
|
23
|
+
installed_rubies.include?(version)
|
24
|
+
end
|
25
|
+
|
26
|
+
def install
|
27
|
+
system("rvm install #{version}") or exit 1
|
28
|
+
end
|
29
|
+
|
30
|
+
def current?
|
31
|
+
RVM.use_from_path!(".")
|
32
|
+
RVM.current.environment_name == [version, gemset].join("@")
|
33
|
+
rescue RVM::IncompatibleRubyError
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
def restart
|
38
|
+
exec "rvm-exec #{$0} && rvm-exec $SHELL"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
data/lib/bard.rb
CHANGED
@@ -125,5 +125,16 @@ class Bard::CLI < Thor
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
128
|
+
|
129
|
+
desc "ssh [TO=production]", "logs into the specified server via SSH"
|
130
|
+
def ssh to="production"
|
131
|
+
exec "cap _2.5.10_ ssh ROLES=#{to}"
|
132
|
+
end
|
133
|
+
|
134
|
+
desc "install", "copies bin/setup and bin/ci scripts into current project."
|
135
|
+
def install
|
136
|
+
install_files_path = File.expand_path(File.join(__dir__, "../install_files/*"))
|
137
|
+
system "cp #{install_files_path} bin/"
|
138
|
+
end
|
128
139
|
end
|
129
140
|
|
data/lib/bard/capistrano.rb
CHANGED
@@ -86,4 +86,10 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
86
86
|
def heroku? role
|
87
87
|
`git remote -v`.include? "#{role}\tgit@heroku.com:"
|
88
88
|
end
|
89
|
+
|
90
|
+
desc "log in via ssh"
|
91
|
+
task :ssh do
|
92
|
+
uri = URI.parse("ssh://#{roles[ENV['ROLES'].to_sym].first.to_s}")
|
93
|
+
exec "ssh -t #{"-p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} 'cd #{application} && exec $SHELL'"
|
94
|
+
end
|
89
95
|
end
|
data/lib/bard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -194,6 +194,10 @@ files:
|
|
194
194
|
- features/support/env.rb
|
195
195
|
- features/support/grit_ext.rb
|
196
196
|
- features/support/io.rb
|
197
|
+
- install_files/ci
|
198
|
+
- install_files/setup
|
199
|
+
- install_files/specified_bundler.rb
|
200
|
+
- install_files/specified_ruby.rb
|
197
201
|
- lib/bard.rb
|
198
202
|
- lib/bard/base.rb
|
199
203
|
- lib/bard/capistrano.rb
|