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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24f2012b3605f747912e40f1917bd1988f3092858e335414f29259340ce38bcb
4
- data.tar.gz: 66c100138ee68bf370d7f0769fb6660ef517467622b32cc766e060ef724a639c
3
+ metadata.gz: 5af07d56215b7a27658942feb8e9510015195d798a176f31048816b7c4240a1b
4
+ data.tar.gz: a3b5a389d425b7dcdff09b5d0dc44bc3b404f803308a4569092079bf30a89351
5
5
  SHA512:
6
- metadata.gz: c42de31111b0d4b73027a5f867272f56c24e25ec6d77227b113a18d7ed8f52570fa74730d3c5480812737c50bdc72b2f65433b86d2f28c8e61d179e435a65e5f
7
- data.tar.gz: 0b76ea04426b29d09f5e64c4b67052fc5b11219aef4103c37f6a476c2443892eddbe7acffccfb437a6e3cf640f8adf960510ce8df059ce148623bffc0e6f973b
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
@@ -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 `Gemfile.lock`:"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BundledGem
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
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
- class LockfileReader
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
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