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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97f9426a4fb5fbdd2154e9665f91bb40dd4ee24b
4
- data.tar.gz: 2d6d1281631a0ccff9dfd97b55df63d862ec5ee5
3
+ metadata.gz: 4b0c647abfb691290a0514fe05e20692856eb1f4
4
+ data.tar.gz: e491723ff72bfff4107798a7d56419999e6892d5
5
5
  SHA512:
6
- metadata.gz: 52014bf04f27fb52ba1e59c8b5cb10729c3e1bd73df5fdaf11300a7b17a208cb1d58fce0048fd4e21b7cae419298fb427bc84a234302d71d2193a1dc63f9e25d
7
- data.tar.gz: fb1929f2dc97af83d17068ca746a9607b758925ad49dba82ee0d93a076b7f724823075ace0cabb5258818207bf0d65f51e02864184935317e5fefa42d93e0265
6
+ metadata.gz: d563a8db967d7a8345d6c6a68aefb1b9d828e491ee0f3807b2d76d9355c629817f55a4e638a7437398fdb00ba484f16b856af680707865f99a4915e603097e24
7
+ data.tar.gz: fd93711871843f788f3af554f1da91bcee31f3f14ca39ec7220a3f009e35830230272a3016bdca50ff0f53e882ceb249553cf406786366a64b6cec142ac14eb1
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative './specified_ruby'
3
+ SpecifiedRuby.ensure!
4
+ ENV["RAILS_ENV"] = "test"
5
+ load "Rakefile"
6
+ Rake::Task["ci"].invoke
7
+
@@ -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
+
@@ -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
 
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.27.1"
2
+ VERSION = "0.28.0"
3
3
  end
4
4
 
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.27.1
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-20 00:00:00.000000000 Z
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