bundled_gems 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop-install-sample.yml +17 -0
- data/lib/bundled_gem/cli.rb +5 -3
- data/lib/bundled_gem/version.rb +1 -1
- data/lib/bundled_gems.rb +3 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5af07d56215b7a27658942feb8e9510015195d798a176f31048816b7c4240a1b
|
4
|
+
data.tar.gz: a3b5a389d425b7dcdff09b5d0dc44bc3b404f803308a4569092079bf30a89351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615ba65b81005554592c4ef91a727188e7f9abb82117f919b47e463c32f4cd55e996b74fa962828b2f0a593eaa94d461a75d8b2a4ec64c94e14a5b3357046eff
|
7
|
+
data.tar.gz: 8974fe218ec44e367dd6b240d40a18dfa3a372aa4ba8bfb1aa887317854597c4ba68682ab26e744c77b9e8d20bcd8815cc6c6461758db5c7684d268e8223d921
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Install RuboCop and Run
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
sample:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- uses: actions/checkout@v1
|
8
|
+
- name: Set up Ruby 2.6.x
|
9
|
+
uses: actions/setup-ruby@v1
|
10
|
+
with:
|
11
|
+
ruby-version: 2.6.x
|
12
|
+
- name: Install RuboCop and Run
|
13
|
+
run: |
|
14
|
+
bundle install --jobs 4 --retry 3
|
15
|
+
./bin/bgem list --lockfile test/fixture/Gemfile.sample.lock
|
16
|
+
./bin/bgem install rubocop --lockfile test/fixture/Gemfile.sample.lock
|
17
|
+
rubocop --version
|
data/lib/bundled_gem/cli.rb
CHANGED
@@ -5,8 +5,9 @@ require 'thor'
|
|
5
5
|
module BundledGem
|
6
6
|
class Cli < Thor
|
7
7
|
desc "install [BUNDLED_GEM]", "install [BUNDLED_GEM] from `Gemfile.lock`"
|
8
|
+
option "lockfile", type: :string, default: LOCKFILE, desc: "Use the specified gemfile.lock instead of Gemfile.lock"
|
8
9
|
def install(bundled_gem)
|
9
|
-
reader = LockfileReader.new
|
10
|
+
reader = LockfileReader.new(lockfile: options[:lockfile])
|
10
11
|
if reader.gem_listed?(bundled_gem)
|
11
12
|
version = reader.get_version(bundled_gem)
|
12
13
|
system "gem install #{bundled_gem} --version #{version}"
|
@@ -16,9 +17,10 @@ module BundledGem
|
|
16
17
|
end
|
17
18
|
|
18
19
|
desc "list", "bundle list without `bundle install`"
|
20
|
+
option "lockfile", type: :string, default: LOCKFILE, desc: "Use the specified gemfile.lock instead of Gemfile.lock"
|
19
21
|
def list
|
20
|
-
puts "Gems included in
|
21
|
-
LockfileReader.new.lockfile_specs.each do |s|
|
22
|
+
puts "Gems included in `#{options[:lockfile]}`:"
|
23
|
+
LockfileReader.new(lockfile: options[:lockfile]).lockfile_specs.each do |s|
|
22
24
|
puts " * #{s.name}, #{s.version}"
|
23
25
|
end
|
24
26
|
end
|
data/lib/bundled_gem/version.rb
CHANGED
data/lib/bundled_gems.rb
CHANGED
@@ -4,10 +4,11 @@ require 'bundler'
|
|
4
4
|
require "bundled_gem/version"
|
5
5
|
|
6
6
|
module BundledGem
|
7
|
-
|
8
|
-
LOCKFILE = "Gemfile.lock"
|
7
|
+
LOCKFILE = "Gemfile.lock"
|
9
8
|
|
9
|
+
class LockfileReader
|
10
10
|
def initialize(lockfile: LOCKFILE)
|
11
|
+
abort "No such file: #{lockfile}" unless File.exist?(lockfile)
|
11
12
|
@lockfile_content = File.read(lockfile)
|
12
13
|
end
|
13
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundled_gems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toshimaru
|
@@ -89,6 +89,7 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- ".github/workflows/ci.yml"
|
92
|
+
- ".github/workflows/rubocop-install-sample.yml"
|
92
93
|
- ".gitignore"
|
93
94
|
- CODE_OF_CONDUCT.md
|
94
95
|
- Gemfile
|