prebundle 0.1.0 → 0.2.4

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: 553e1af26ee0f12dfca559d7c2427d16e8bc5f8af4791d65ca0a75f9e6f4f537
4
- data.tar.gz: dadf0399d71d263a7b68be909cf2603083dbb875a28a36bf2aadd33eda963fd2
3
+ metadata.gz: 6a4919ff3b31daef44065736867b787ac8f3bb89a17453a8af6e2d082daffa04
4
+ data.tar.gz: a5d89b85a80b12fd1522a21dbe98ad619000d94c3040799baa80f6a519ada810
5
5
  SHA512:
6
- metadata.gz: 65f8c8321f4c8dd8d4aed0a5fe965f350449356a7c708820e98d918cd24a544593712ab0255100f3822626062217219179cb46736e75add1f441474af3addade
7
- data.tar.gz: d5624a071df5d13f3a9599184dc8bb3fd816c4dddb12fe15245c3b156989ea40a646208096324b441f4616c54e4b0d109c6b51f17d8e37fdbff4bb153fdf81d2
6
+ metadata.gz: 706a47ff36ac37a4f0b4c371f1d36be17288aeedf00943f17fff08248f5dff0bddfe48a5c1301750cf115d256604c99221d7ae09817307ffd148b79d316b3a3e
7
+ data.tar.gz: 4a5f4a6b82db7a27797f711df0bfb9df3ef23154b7932bc6780546f048c40975b0bd28eb5374189ec051edc5053bc793e02180b3e905f3b46253aa8c6490b630
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: add gem-package-info
3
+ about: Which gem requires which package on which os?
4
+ title: "[add]"
5
+ labels: ''
6
+ assignees: kuboon
7
+
8
+ ---
9
+
10
+ **Which os/distribution?**
11
+ paste the result of `lsb_release -sd`
12
+
13
+ **Which gem has error on install?**
14
+ mysql2, etc.
15
+
16
+ **Which command solved the error? Or what the error messages you can't solve yet?**
17
+
18
+ **Additional context**
19
+ Add any other context or screenshots about the feature request here.
@@ -1,71 +1,105 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prebundle (0.1.0)
4
+ prebundle (0.2.4)
5
5
  thor
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- aruba (0.14.8)
11
- childprocess (>= 0.6.3, < 1.1.0)
12
- contracts (~> 0.9)
13
- cucumber (>= 1.3.19)
10
+ activesupport (6.0.3.4)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (>= 0.7, < 2)
13
+ minitest (~> 5.1)
14
+ tzinfo (~> 1.1)
15
+ zeitwerk (~> 2.2, >= 2.2.2)
16
+ aruba (1.0.3)
17
+ childprocess (>= 2.0, < 5.0)
18
+ contracts (~> 0.16.0)
19
+ cucumber (>= 2.4, < 6.0)
14
20
  ffi (~> 1.9)
15
- rspec-expectations (>= 2.99)
16
- thor (~> 0.19)
17
- backports (3.12.0)
18
- builder (3.2.3)
19
- childprocess (1.0.1)
20
- rake (< 13.0)
21
+ rspec-expectations (~> 3.4)
22
+ thor (~> 1.0)
23
+ builder (3.2.4)
24
+ childprocess (4.0.0)
25
+ concurrent-ruby (1.1.7)
21
26
  contracts (0.16.0)
22
- cucumber (3.1.2)
23
- builder (>= 2.1.2)
24
- cucumber-core (~> 3.2.0)
25
- cucumber-expressions (~> 6.0.1)
26
- cucumber-wire (~> 0.0.1)
27
- diff-lcs (~> 1.3)
28
- gherkin (~> 5.1.0)
29
- multi_json (>= 1.7.5, < 2.0)
30
- multi_test (>= 0.1.2)
31
- cucumber-core (3.2.1)
32
- backports (>= 3.8.0)
33
- cucumber-tag_expressions (~> 1.1.0)
34
- gherkin (~> 5.0)
35
- cucumber-expressions (6.0.1)
36
- cucumber-tag_expressions (1.1.1)
37
- cucumber-wire (0.0.1)
38
- diff-lcs (1.3)
39
- ffi (1.10.0)
40
- gherkin (5.1.0)
41
- multi_json (1.13.1)
27
+ cucumber (5.1.3)
28
+ builder (~> 3.2, >= 3.2.4)
29
+ cucumber-core (~> 8.0, >= 8.0.1)
30
+ cucumber-create-meta (~> 2.0, >= 2.0.2)
31
+ cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
32
+ cucumber-gherkin (~> 15.0, >= 15.0.2)
33
+ cucumber-html-formatter (~> 9.0, >= 9.0.0)
34
+ cucumber-messages (~> 13.1, >= 13.1.0)
35
+ cucumber-wire (~> 4.0, >= 4.0.1)
36
+ diff-lcs (~> 1.4, >= 1.4.4)
37
+ multi_test (~> 0.1, >= 0.1.2)
38
+ sys-uname (~> 1.2, >= 1.2.1)
39
+ cucumber-core (8.0.1)
40
+ cucumber-gherkin (~> 15.0, >= 15.0.2)
41
+ cucumber-messages (~> 13.0, >= 13.0.1)
42
+ cucumber-tag-expressions (~> 2.0, >= 2.0.4)
43
+ cucumber-create-meta (2.0.2)
44
+ cucumber-messages (~> 13.0, >= 13.0.1)
45
+ sys-uname (~> 1.2, >= 1.2.1)
46
+ cucumber-cucumber-expressions (10.3.0)
47
+ cucumber-gherkin (15.0.2)
48
+ cucumber-messages (~> 13.0, >= 13.0.1)
49
+ cucumber-html-formatter (9.0.0)
50
+ cucumber-messages (~> 13.0, >= 13.0.1)
51
+ cucumber-messages (13.1.0)
52
+ protobuf-cucumber (~> 3.10, >= 3.10.8)
53
+ cucumber-tag-expressions (2.0.4)
54
+ cucumber-wire (4.0.1)
55
+ cucumber-core (~> 8.0, >= 8.0.1)
56
+ cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
57
+ cucumber-messages (~> 13.0, >= 13.0.1)
58
+ diff-lcs (1.4.4)
59
+ ffi (1.13.1)
60
+ gem-release (2.2.0)
61
+ i18n (1.8.5)
62
+ concurrent-ruby (~> 1.0)
63
+ middleware (0.1.0)
64
+ minitest (5.14.2)
42
65
  multi_test (0.1.2)
43
- rake (10.5.0)
44
- rspec (3.8.0)
45
- rspec-core (~> 3.8.0)
46
- rspec-expectations (~> 3.8.0)
47
- rspec-mocks (~> 3.8.0)
48
- rspec-core (3.8.0)
49
- rspec-support (~> 3.8.0)
50
- rspec-expectations (3.8.2)
66
+ protobuf-cucumber (3.10.8)
67
+ activesupport (>= 3.2)
68
+ middleware
69
+ thor
70
+ thread_safe
71
+ rake (13.0.1)
72
+ rspec (3.9.0)
73
+ rspec-core (~> 3.9.0)
74
+ rspec-expectations (~> 3.9.0)
75
+ rspec-mocks (~> 3.9.0)
76
+ rspec-core (3.9.3)
77
+ rspec-support (~> 3.9.3)
78
+ rspec-expectations (3.9.2)
51
79
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.8.0)
53
- rspec-mocks (3.8.0)
80
+ rspec-support (~> 3.9.0)
81
+ rspec-mocks (3.9.1)
54
82
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.8.0)
56
- rspec-support (3.8.0)
57
- thor (0.20.3)
83
+ rspec-support (~> 3.9.0)
84
+ rspec-support (3.9.3)
85
+ sys-uname (1.2.1)
86
+ ffi (>= 1.0.0)
87
+ thor (1.0.1)
88
+ thread_safe (0.3.6)
89
+ tzinfo (1.2.7)
90
+ thread_safe (~> 0.1)
91
+ zeitwerk (2.4.0)
58
92
 
59
93
  PLATFORMS
60
94
  ruby
61
95
 
62
96
  DEPENDENCIES
63
97
  aruba
64
- bundler (~> 1.17)
65
- cucumber
98
+ bundler (~> 2)
99
+ gem-release
66
100
  prebundle!
67
- rake (~> 10.0)
101
+ rake (~> 13.0)
68
102
  rspec (~> 3.0)
69
103
 
70
104
  BUNDLED WITH
71
- 1.17.2
105
+ 2.1.4
data/README.md CHANGED
@@ -1,38 +1,43 @@
1
1
  # Prebundle
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/prebundle`. To experiment with that code, run `bin/console` for an interactive prompt.
4
3
 
5
- TODO: Delete this and the text above, and describe your gem
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ Run this line on your shell:
10
8
 
11
- ```ruby
12
- gem 'prebundle'
9
+ ```sh
10
+ gem install prebundle
13
11
  ```
14
12
 
15
- And then execute:
16
-
17
- $ bundle
13
+ ## Usage
18
14
 
19
- Or install it yourself as:
15
+ prebundle is a CLI tool.
20
16
 
21
- $ gem install prebundle
17
+ Execute at the same directory of Gemfile like this:
22
18
 
23
- ## Usage
19
+ $ prebundle all
24
20
 
25
- TODO: Write usage instructions here
21
+ Or specify gem name:
26
22
 
27
- ## Development
23
+ $ prebundle gem mysql2
28
24
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
25
+ Both simply shows shell command and do nothing (for security reason).
26
+ After checking the output, you pipe to sh like this:
30
27
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+ $ prebundle all | sudo sh
32
29
 
33
30
  ## Contributing
34
31
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/prebundle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
32
+ If your problem did not solved by prebundle, please [create new issue](https://github.com/kuboon/prebundle/issues/new?assignees=kuboon&labels=&template=add-gem-package-info.md&title=[add]).
33
+
34
+ Other bug reports and pull requests are welcome on GitHub at https://github.com/kuboon/prebundle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
35
+
36
+ ## Development
37
+
38
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
+
40
+ To install this gem onto your local machine, run `bundle exec rake install`.
36
41
 
37
42
  ## License
38
43
 
@@ -40,4 +45,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
45
 
41
46
  ## Code of Conduct
42
47
 
43
- Everyone interacting in the Prebundle project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/prebundle/blob/master/CODE_OF_CONDUCT.md).
48
+ Everyone interacting in the Prebundle project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kuboon/prebundle/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -4,3 +4,11 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+ task :build do
8
+ puts "gem build prebundle.gemspec"
9
+ end
10
+ namespace :deploy do
11
+ task :github do
12
+ puts "gem push --key github --host https://rubygems.pkg.github.com/kuboon prebundle-0.2.4.gem"
13
+ end
14
+ end
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
- require 'prebundle/cli'
2
+ require 'prebundle'
3
+ require "prebundle/cli"
4
+
3
5
  Prebundle::CLI.start
4
6
 
@@ -1,6 +1,17 @@
1
1
  require "prebundle/version"
2
+ require "prebundle/os"
2
3
 
3
4
  module Prebundle
4
5
  class Error < StandardError; end
5
- # Your code goes here...
6
+
7
+ def self.distribution_class(hint = `lsb_release -sd`)
8
+ case hint
9
+ when /\AUbuntu/; OS::Ubuntu
10
+ else raise "Unknown distribution"
11
+ end
12
+ end
13
+
14
+ def self.list_all_gems_in_Gemfile
15
+ %w[mysql2 curses]
16
+ end
6
17
  end
@@ -1,38 +1,32 @@
1
1
  require "thor"
2
- class Ubuntu
3
- def initialize(gems)
4
- @gems = gems
5
- end
6
-
7
- def packages
8
- @gems.map do |gem|
9
- case gem
10
- when 'mysql2'; "libmysqlclient-dev"
11
- end
12
- end.flatten.uniq
13
- end
14
-
15
- def command
16
- "apt install -y #{packages.join(' ')}"
17
- end
18
- end
19
2
 
20
3
  module Prebundle
21
4
  class CLI < Thor
22
- desc "show", "Reads Gemfile on current dir and outputs required setup commands."
23
- def show
24
- # load Gemfile
25
- # get list of gems
26
- gems = ['mysql2']
5
+ def self.exit_on_failure?
6
+ true
7
+ end
27
8
 
28
- # get os/distribution
29
- klass = Ubuntu
30
- # get list of required packages
31
- # get install command
32
- # show result
33
- puts klass.new(gems).command # yum install mysql-devel
34
- puts "# prebundle show | sudo sh"
9
+ desc "all", "Reads Gemfile on current dir and outputs required setup commands."
10
+ def all
11
+ gems = ::Prebundle::list_all_gems_in_Gemfile
12
+
13
+ STDERR.puts "# Unless this helped you, please report the issue https://github.com/kuboon/prebundle/issues/new?assignees=kuboon&labels=&template=add-gem-package-info.md&title=[add]"
14
+ puts Prebundle::distribution_class.new(gems).command
15
+ puts "# prebundle all | sudo sh"
16
+ end
17
+
18
+ desc "gem [gemname]", "outputs required setup commands for the gem"
19
+ def gem(gemname)
20
+ STDERR.puts "# Unless this helped you, please report the issue https://github.com/kuboon/prebundle/issues/new?assignees=kuboon&labels=&template=add-gem-package-info.md&title=[add]"
21
+ puts Prebundle::distribution_class.new([gemname]).command
22
+ puts "# prebundle gem #{gemname} | sudo sh"
35
23
  end
24
+
25
+ desc "version", "outputs version"
26
+ def version
27
+ puts ::Prebundle::VERSION
28
+ end
29
+
36
30
  end
37
31
  end
38
32
 
@@ -0,0 +1,57 @@
1
+ module OS
2
+ class Base
3
+ def initialize(gems)
4
+ @gems = gems
5
+ end
6
+ def command
7
+ raise "not impl"
8
+ end
9
+ end
10
+
11
+ class Linux < Base; end
12
+
13
+ class Debian < Linux
14
+ def packages
15
+ @gems.map do |gem|
16
+ case gem
17
+ when 'curses'; "libncursesw5-dev"
18
+ when 'mysql2'; "libmysqlclient-dev"
19
+ when 'pg'; 'libpq-dev'
20
+ end
21
+ end.flatten.uniq
22
+ end
23
+ def command
24
+ "apt install -y #{packages.join(' ')}"
25
+ end
26
+ end
27
+
28
+ class Ubuntu < Debian; end
29
+
30
+ class CentOS < Linux
31
+ def packages
32
+ @gems.map do |gem|
33
+ case gem
34
+ when 'mysql2'; "mysql-devel"
35
+ end
36
+ end.flatten.uniq
37
+ end
38
+ def command
39
+ "yum install mysql-devel"
40
+ end
41
+ end
42
+
43
+ class AmazonLinux < CentOS
44
+ end
45
+
46
+ class Fedora < Linux
47
+ def command
48
+ "dnf"
49
+ end
50
+ end
51
+
52
+ class FreeBSD < Base
53
+ def command
54
+ "pkg"
55
+ end
56
+ end
57
+ end
@@ -1,3 +1,3 @@
1
1
  module Prebundle
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ #spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
21
 
22
22
  #spec.metadata["homepage_uri"] = spec.homepage
23
23
  spec.metadata["source_code_uri"] = spec.homepage
@@ -38,9 +38,9 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_dependency "thor"
40
40
 
41
- spec.add_development_dependency "bundler", "~> 1.17"
42
- spec.add_development_dependency "rake", "~> 10.0"
41
+ spec.add_development_dependency "bundler", "~> 2"
42
+ spec.add_development_dependency "rake", "~> 13.0"
43
43
  spec.add_development_dependency "rspec", "~> 3.0"
44
- spec.add_development_dependency "cucumber"
45
44
  spec.add_development_dependency "aruba"
45
+ spec.add_development_dependency "gem-release"
46
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prebundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kuboon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.17'
33
+ version: '2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.17'
40
+ version: '2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: cucumber
70
+ name: aruba
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: aruba
84
+ name: gem-release
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -103,6 +103,7 @@ executables:
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - ".github/ISSUE_TEMPLATE/add-gem-package-info.md"
106
107
  - ".gitignore"
107
108
  - ".rspec"
108
109
  - ".travis.yml"
@@ -117,13 +118,13 @@ files:
117
118
  - exe/prebundle
118
119
  - lib/prebundle.rb
119
120
  - lib/prebundle/cli.rb
121
+ - lib/prebundle/os.rb
120
122
  - lib/prebundle/version.rb
121
123
  - prebundle.gemspec
122
124
  homepage: https://github.com/kuboon/prebundle
123
125
  licenses:
124
126
  - MIT
125
127
  metadata:
126
- allowed_push_host: https://rubygems.org
127
128
  source_code_uri: https://github.com/kuboon/prebundle
128
129
  post_install_message:
129
130
  rdoc_options: []
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  - !ruby/object:Gem::Version
141
142
  version: '0'
142
143
  requirements: []
143
- rubygems_version: 3.0.1
144
+ rubygems_version: 3.1.4
144
145
  signing_key:
145
146
  specification_version: 4
146
147
  summary: Run prebundle before bundle install