prebundle 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/Rakefile +4 -0
- data/lib/prebundle/cli.rb +8 -55
- data/lib/prebundle/os.rb +56 -0
- data/lib/prebundle/version.rb +1 -1
- data/lib/prebundle.rb +12 -1
- data/prebundle.gemspec +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89047b1caf754eb6776a931447cdf5dbbe4dcaa4724a144eb5af0a7fa3d7b791
|
4
|
+
data.tar.gz: 1d070d1da62227064cf62ac1bb19001c7f88f94865ffc6ed640c728005cc4f31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21f5bafdd57cbb300642ad9f08222d09e3400df2ef52826a75833951631166c3fade181d6616e05b46c8f87bc22a3f9bb41fb3a0b76ce510d1288f592b7d73d0
|
7
|
+
data.tar.gz: 7e5e2947ad4529b84464b137cb9820945fa028a887378dc100bf92b83d241fb16bde1632a39f455651826abc3af4ef0b113d2c3ec99a3eb7540e4d89b8e48865
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
prebundle (0.1.
|
4
|
+
prebundle (0.1.1)
|
5
5
|
thor
|
6
6
|
|
7
7
|
GEM
|
@@ -37,6 +37,7 @@ GEM
|
|
37
37
|
cucumber-wire (0.0.1)
|
38
38
|
diff-lcs (1.3)
|
39
39
|
ffi (1.10.0)
|
40
|
+
gem-release (2.1.1)
|
40
41
|
gherkin (5.1.0)
|
41
42
|
multi_json (1.13.1)
|
42
43
|
multi_test (0.1.2)
|
@@ -63,6 +64,7 @@ DEPENDENCIES
|
|
63
64
|
aruba
|
64
65
|
bundler (~> 1.17)
|
65
66
|
cucumber
|
67
|
+
gem-release
|
66
68
|
prebundle!
|
67
69
|
rake (~> 10.0)
|
68
70
|
rspec (~> 3.0)
|
data/Rakefile
CHANGED
data/lib/prebundle/cli.rb
CHANGED
@@ -1,61 +1,6 @@
|
|
1
1
|
require "thor"
|
2
2
|
|
3
|
-
|
4
|
-
class OS
|
5
|
-
def initialize(gems)
|
6
|
-
@gems = gems
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
class Linux < OS; end
|
11
|
-
class Ubuntu < Linux
|
12
|
-
def packages
|
13
|
-
@gems.map do |gem|
|
14
|
-
case gem
|
15
|
-
when 'mysql2'; "libmysqlclient-dev"
|
16
|
-
when 'nokogiri'; %w[build-essential patch ruby-dev zlib1g-dev liblzma-dev]
|
17
|
-
end
|
18
|
-
end.flatten.uniq
|
19
|
-
end
|
20
|
-
|
21
|
-
def command
|
22
|
-
"apt install -y #{packages.join(' ')}"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class CentOS < Linux; end
|
27
|
-
class AmazonLinux < CentOS
|
28
|
-
#yum install mysql-devel
|
29
|
-
end
|
30
|
-
|
31
|
-
class BSD < OS; end
|
32
|
-
class OpenBSD < BSD
|
33
|
-
def packages
|
34
|
-
@gems.map do |gem|
|
35
|
-
case gem
|
36
|
-
when 'nokogiri'; 'gcc' # OpenBSD<6.2
|
37
|
-
end
|
38
|
-
end.flatten.uniq
|
39
|
-
end
|
40
|
-
def command
|
41
|
-
"pkg_add -v #{packages.join(' ')}"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
3
|
module Prebundle
|
48
|
-
def self.distribution_class(hint = `lsb_release -sd`)
|
49
|
-
case hint
|
50
|
-
when /\AUbuntu/; Ubuntu
|
51
|
-
else raise "Unknown distribution"
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def self.list_all_gems_in_Gemfile
|
56
|
-
["mysql2"]
|
57
|
-
end
|
58
|
-
|
59
4
|
class CLI < Thor
|
60
5
|
desc "all", "Reads Gemfile on current dir and outputs required setup commands."
|
61
6
|
def all
|
@@ -68,6 +13,14 @@ module Prebundle
|
|
68
13
|
|
69
14
|
desc "gem [gemname]", "outputs required setup commands for the gem"
|
70
15
|
def gem(gemname)
|
16
|
+
puts Prebundle::distribution_class.new([gemname]).command
|
17
|
+
puts "# prebundle gem #{gemname} | sudo sh"
|
18
|
+
STDERR.puts "# Unless it helped you, please report the issue https://github.com/kuboon/prebundle/issues/new?assignees=kuboon&labels=&template=add-gem-package-info.md&title=[add]"
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "gem version", "outputs version"
|
22
|
+
def version
|
23
|
+
puts VERSION
|
71
24
|
end
|
72
25
|
end
|
73
26
|
end
|
data/lib/prebundle/os.rb
ADDED
@@ -0,0 +1,56 @@
|
|
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
|
+
end
|
20
|
+
end.flatten.uniq
|
21
|
+
end
|
22
|
+
def command
|
23
|
+
"apt install -y #{packages.join(' ')}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Ubuntu < Debian; end
|
28
|
+
|
29
|
+
class CentOS < Linux
|
30
|
+
def packages
|
31
|
+
@gems.map do |gem|
|
32
|
+
case gem
|
33
|
+
when 'mysql2'; "mysql-devel"
|
34
|
+
end
|
35
|
+
end.flatten.uniq
|
36
|
+
end
|
37
|
+
def command
|
38
|
+
"yum install mysql-devel"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class AmazonLinux < CentOS
|
43
|
+
end
|
44
|
+
|
45
|
+
class Fedora < Linux
|
46
|
+
def command
|
47
|
+
"dnf"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class FreeBSD < Base
|
52
|
+
def command
|
53
|
+
"pkg"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/prebundle/version.rb
CHANGED
data/lib/prebundle.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
require "prebundle/version"
|
2
|
+
require "prebundle/cli"
|
2
3
|
|
3
4
|
module Prebundle
|
4
5
|
class Error < StandardError; end
|
5
|
-
|
6
|
+
|
7
|
+
def self.distribution_class(hint = `lsb_release -sd`)
|
8
|
+
case hint
|
9
|
+
when /\AUbuntu/; 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
|
data/prebundle.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
lib = File.expand_path("../lib", __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require "prebundle/version"
|
@@ -43,4 +42,5 @@ Gem::Specification.new do |spec|
|
|
43
42
|
spec.add_development_dependency "rspec", "~> 3.0"
|
44
43
|
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.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kuboon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: gem-release
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: 'I will output required actions like "yum install hogehoge", "apt install
|
98
112
|
fugafuga" etc '
|
99
113
|
email:
|
@@ -118,6 +132,7 @@ files:
|
|
118
132
|
- exe/prebundle
|
119
133
|
- lib/prebundle.rb
|
120
134
|
- lib/prebundle/cli.rb
|
135
|
+
- lib/prebundle/os.rb
|
121
136
|
- lib/prebundle/version.rb
|
122
137
|
- prebundle.gemspec
|
123
138
|
homepage: https://github.com/kuboon/prebundle
|