ggem 1.8.4 → 1.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/Gemfile +5 -1
- data/README.md +2 -2
- data/bin/ggem +2 -1
- data/ggem.gemspec +9 -6
- data/lib/ggem.rb +4 -2
- data/lib/ggem/cli.rb +51 -54
- data/lib/ggem/cli/clirb.rb +46 -48
- data/lib/ggem/cli/commands.rb +21 -53
- data/lib/ggem/gem.rb +45 -43
- data/lib/ggem/gemspec.rb +62 -65
- data/lib/ggem/git_repo.rb +41 -44
- data/lib/ggem/template.rb +49 -49
- data/lib/ggem/template_file/Gemfile.erb +5 -1
- data/lib/ggem/template_file/README.md.erb +4 -4
- data/lib/ggem/template_file/gemspec.erb +12 -8
- data/lib/ggem/template_file/lib.rb.erb +4 -2
- data/lib/ggem/template_file/lib_version.rb.erb +3 -1
- data/lib/ggem/template_file/ruby-version.erb +1 -0
- data/lib/ggem/template_file/test_helper.rb.erb +8 -15
- data/lib/ggem/template_file/test_support_factory.rb.erb +3 -2
- data/lib/ggem/version.rb +3 -1
- data/log/.keep +0 -0
- data/test/helper.rb +12 -19
- data/test/support/cmd_tests_helpers.rb +36 -39
- data/test/support/factory.rb +3 -2
- data/test/support/gem1/gem1.gemspec +3 -1
- data/test/support/gem2/gem2.gemspec +4 -2
- data/test/support/name_set.rb +54 -52
- data/test/system/ggem_tests.rb +9 -12
- data/test/unit/cli_tests.rb +79 -108
- data/test/unit/gem_tests.rb +3 -5
- data/test/unit/gemspec_tests.rb +21 -26
- data/test/unit/git_repo_tests.rb +5 -14
- metadata +63 -56
- data/.gitignore +0 -19
data/test/unit/gem_tests.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "ggem/gem"
|
3
5
|
|
4
6
|
class GGem::Gem
|
5
|
-
|
6
7
|
class UnitTests < Assert::Context
|
7
8
|
desc "GGem::Gem"
|
8
9
|
setup do
|
9
10
|
@gem_class = GGem::Gem
|
10
11
|
end
|
11
|
-
|
12
12
|
end
|
13
13
|
|
14
14
|
class InitTests < UnitTests
|
@@ -29,12 +29,10 @@ class GGem::Gem
|
|
29
29
|
|
30
30
|
should "complain if no name is provided" do
|
31
31
|
assert_raises(NoNameError) do
|
32
|
-
@gem_class.new(TMP_PATH, [nil,
|
32
|
+
@gem_class.new(TMP_PATH, [nil, ""].sample)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
# most of the gem's behavior is covered in the system tests
|
37
|
-
|
38
37
|
end
|
39
|
-
|
40
38
|
end
|
data/test/unit/gemspec_tests.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "ggem/gemspec"
|
3
5
|
|
4
|
-
require
|
5
|
-
require
|
6
|
+
require "ggem/version"
|
7
|
+
require "test/support/cmd_tests_helpers"
|
6
8
|
|
7
9
|
class GGem::Gemspec
|
8
|
-
|
9
10
|
class UnitTests < Assert::Context
|
10
11
|
desc "GGem::Gemspec"
|
11
12
|
setup do
|
@@ -14,15 +15,15 @@ class GGem::Gemspec
|
|
14
15
|
subject{ @gemspec_class }
|
15
16
|
|
16
17
|
should "know the push host meta key" do
|
17
|
-
assert_equal
|
18
|
+
assert_equal "allowed_push_host", subject::PUSH_HOST_META_KEY
|
18
19
|
end
|
19
20
|
|
20
21
|
should "use Rubygems as its default push host" do
|
21
|
-
assert_equal
|
22
|
+
assert_equal "https://rubygems.org", subject::DEFAULT_PUSH_HOST
|
22
23
|
end
|
23
24
|
|
24
25
|
should "know which dir to build gems to" do
|
25
|
-
assert_equal
|
26
|
+
assert_equal "pkg", subject::BUILD_TO_DIRNAME
|
26
27
|
end
|
27
28
|
|
28
29
|
should "know its exceptions" do
|
@@ -30,13 +31,12 @@ class GGem::Gemspec
|
|
30
31
|
assert subject::LoadError < ArgumentError
|
31
32
|
assert subject::CmdError < RuntimeError
|
32
33
|
end
|
33
|
-
|
34
34
|
end
|
35
35
|
|
36
36
|
class InitTests < UnitTests
|
37
37
|
desc "when init"
|
38
38
|
setup do
|
39
|
-
@gem1_root_path = TEST_SUPPORT_PATH.join(
|
39
|
+
@gem1_root_path = TEST_SUPPORT_PATH.join("gem1")
|
40
40
|
@spec = @gemspec_class.new(@gem1_root_path)
|
41
41
|
end
|
42
42
|
subject{ @spec }
|
@@ -46,12 +46,12 @@ class GGem::Gemspec
|
|
46
46
|
should have_imeths :run_build_cmd, :run_install_cmd, :run_push_cmd
|
47
47
|
|
48
48
|
should "know its attrs" do
|
49
|
-
exp = @gem1_root_path.join(
|
49
|
+
exp = @gem1_root_path.join("gem1.gemspec")
|
50
50
|
assert_equal exp, subject.path
|
51
51
|
|
52
|
-
assert_equal
|
53
|
-
assert_equal
|
54
|
-
assert_equal
|
52
|
+
assert_equal "gem1", subject.name
|
53
|
+
assert_equal "0.1.0", subject.version.to_s
|
54
|
+
assert_equal "v0.1.0", subject.version_tag
|
55
55
|
|
56
56
|
exp = "#{subject.name}-#{subject.version}.gem"
|
57
57
|
assert_equal exp, subject.gem_file_name
|
@@ -65,20 +65,20 @@ class GGem::Gemspec
|
|
65
65
|
assert_equal @gemspec_class::DEFAULT_PUSH_HOST, subject.push_host
|
66
66
|
|
67
67
|
# gem2 has a meta host specified, so that is used over the default
|
68
|
-
gem2_spec = @gemspec_class.new(TEST_SUPPORT_PATH.join(
|
69
|
-
assert_equal
|
68
|
+
gem2_spec = @gemspec_class.new(TEST_SUPPORT_PATH.join("gem2"))
|
69
|
+
assert_equal "http://gems.example.com", gem2_spec.push_host
|
70
70
|
|
71
71
|
# prefer the env push hosts over configured and default hosts
|
72
|
-
prev_env_push_host = ENV[
|
73
|
-
ENV[
|
74
|
-
spec = @gemspec_class.new(TEST_SUPPORT_PATH.join([
|
75
|
-
assert_equal ENV[
|
76
|
-
ENV[
|
72
|
+
prev_env_push_host = ENV["GGEM_PUSH_HOST"]
|
73
|
+
ENV["GGEM_PUSH_HOST"] = Factory.string
|
74
|
+
spec = @gemspec_class.new(TEST_SUPPORT_PATH.join(["gem1", "gem2"].sample))
|
75
|
+
assert_equal ENV["GGEM_PUSH_HOST"], spec.push_host
|
76
|
+
ENV["GGEM_PUSH_HOST"] = prev_env_push_host
|
77
77
|
end
|
78
78
|
|
79
79
|
should "complain if the given gemspec root doesn't exist" do
|
80
80
|
assert_raises(NotFoundError) do
|
81
|
-
@gemspec_class.new(
|
81
|
+
@gemspec_class.new("path/that-is/not-found")
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -87,16 +87,15 @@ class GGem::Gemspec
|
|
87
87
|
@gemspec_class.new(TEST_SUPPORT_PATH)
|
88
88
|
end
|
89
89
|
end
|
90
|
-
|
91
90
|
end
|
92
91
|
|
93
92
|
class CmdTests < InitTests
|
94
93
|
include GGem::CmdTestsHelpers
|
94
|
+
|
95
95
|
setup do
|
96
96
|
@exp_build_path = @gem1_root_path.join(subject.gem_file_name)
|
97
97
|
@exp_pkg_path = @gem1_root_path.join(@gemspec_class::BUILD_TO_DIRNAME, subject.gem_file_name)
|
98
98
|
end
|
99
|
-
|
100
99
|
end
|
101
100
|
|
102
101
|
class RunBuildCmdTests < CmdTests
|
@@ -116,7 +115,6 @@ class GGem::Gemspec
|
|
116
115
|
should "complain if any system cmds are not successful" do
|
117
116
|
assert_exp_cmds_error(CmdError){ subject.run_build_cmd }
|
118
117
|
end
|
119
|
-
|
120
118
|
end
|
121
119
|
|
122
120
|
class RunInstallCmdTests < CmdTests
|
@@ -132,7 +130,6 @@ class GGem::Gemspec
|
|
132
130
|
should "complain if the system cmd is not successful" do
|
133
131
|
assert_exp_cmds_error(CmdError){ subject.run_install_cmd }
|
134
132
|
end
|
135
|
-
|
136
133
|
end
|
137
134
|
|
138
135
|
class RunPushCmdTests < CmdTests
|
@@ -148,7 +145,5 @@ class GGem::Gemspec
|
|
148
145
|
should "complain if the system cmd is not successful" do
|
149
146
|
assert_exp_cmds_error(CmdError){ subject.run_push_cmd }
|
150
147
|
end
|
151
|
-
|
152
148
|
end
|
153
|
-
|
154
149
|
end
|
data/test/unit/git_repo_tests.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "ggem/git_repo"
|
3
5
|
|
4
|
-
require
|
6
|
+
require "test/support/cmd_tests_helpers"
|
5
7
|
|
6
8
|
class GGem::GitRepo
|
7
|
-
|
8
9
|
class UnitTests < Assert::Context
|
9
10
|
desc "GGem::GitRepo"
|
10
11
|
setup do
|
@@ -16,13 +17,12 @@ class GGem::GitRepo
|
|
16
17
|
assert subject::NotFoundError < ArgumentError
|
17
18
|
assert subject::CmdError < RuntimeError
|
18
19
|
end
|
19
|
-
|
20
20
|
end
|
21
21
|
|
22
22
|
class InitTests < UnitTests
|
23
23
|
desc "when init"
|
24
24
|
setup do
|
25
|
-
@repo_path = TEST_SUPPORT_PATH.join(
|
25
|
+
@repo_path = TEST_SUPPORT_PATH.join("gem1")
|
26
26
|
@repo = @git_repo_class.new(@repo_path)
|
27
27
|
end
|
28
28
|
subject{ @repo }
|
@@ -36,12 +36,10 @@ class GGem::GitRepo
|
|
36
36
|
should "know its path" do
|
37
37
|
assert_equal @repo_path, subject.path
|
38
38
|
end
|
39
|
-
|
40
39
|
end
|
41
40
|
|
42
41
|
class CmdTests < InitTests
|
43
42
|
include GGem::CmdTestsHelpers
|
44
|
-
|
45
43
|
end
|
46
44
|
|
47
45
|
class RunInitCmdTests < CmdTests
|
@@ -49,7 +47,7 @@ class GGem::GitRepo
|
|
49
47
|
setup do
|
50
48
|
@exp_cmds_run = [
|
51
49
|
"cd #{@repo_path} && git init",
|
52
|
-
"cd #{@repo_path} && git add --all && git add -f *.
|
50
|
+
"cd #{@repo_path} && git add --all && git add -f *.keep"
|
53
51
|
]
|
54
52
|
end
|
55
53
|
|
@@ -60,7 +58,6 @@ class GGem::GitRepo
|
|
60
58
|
should "complain if any system cmds are not successful" do
|
61
59
|
assert_exp_cmds_error(CmdError){ subject.run_init_cmd }
|
62
60
|
end
|
63
|
-
|
64
61
|
end
|
65
62
|
|
66
63
|
class RunValidateCleanCmdTests < CmdTests
|
@@ -78,7 +75,6 @@ class GGem::GitRepo
|
|
78
75
|
should "complain if any system cmds are not successful" do
|
79
76
|
assert_exp_cmds_error(CmdError){ subject.run_validate_clean_cmd }
|
80
77
|
end
|
81
|
-
|
82
78
|
end
|
83
79
|
|
84
80
|
class RunValidateCommittedCmdTests < CmdTests
|
@@ -96,7 +92,6 @@ class GGem::GitRepo
|
|
96
92
|
should "complain if any system cmds are not successful" do
|
97
93
|
assert_exp_cmds_error(CmdError){ subject.run_validate_committed_cmd }
|
98
94
|
end
|
99
|
-
|
100
95
|
end
|
101
96
|
|
102
97
|
class RunPushCmdTests < CmdTests
|
@@ -115,7 +110,6 @@ class GGem::GitRepo
|
|
115
110
|
should "complain if any system cmds are not successful" do
|
116
111
|
assert_exp_cmds_error(CmdError){ subject.run_push_cmd }
|
117
112
|
end
|
118
|
-
|
119
113
|
end
|
120
114
|
|
121
115
|
class RunAddVersionTagCmdTests < CmdTests
|
@@ -136,7 +130,6 @@ class GGem::GitRepo
|
|
136
130
|
should "complain if any system cmds are not successful" do
|
137
131
|
assert_exp_cmds_error(CmdError){ subject.run_add_version_tag_cmd(@version, @tag) }
|
138
132
|
end
|
139
|
-
|
140
133
|
end
|
141
134
|
|
142
135
|
class RunRmTagCmdTests < CmdTests
|
@@ -156,7 +149,5 @@ class GGem::GitRepo
|
|
156
149
|
should "complain if any system cmds are not successful" do
|
157
150
|
assert_exp_cmds_error(CmdError){ subject.run_rm_tag_cmd(@tag) }
|
158
151
|
end
|
159
|
-
|
160
152
|
end
|
161
|
-
|
162
153
|
end
|
metadata
CHANGED
@@ -1,59 +1,67 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ggem
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.9.4
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Kelly Redding
|
8
8
|
- Collin Redding
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
prerelease: false
|
17
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 2.16.3
|
22
|
-
type: :development
|
12
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
23
15
|
name: assert
|
24
|
-
|
25
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 2.19.1
|
21
|
+
type: :development
|
26
22
|
prerelease: false
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version:
|
32
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.19.1
|
28
|
+
- !ruby/object:Gem::Dependency
|
33
29
|
name: much-plugin
|
34
|
-
|
35
|
-
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.2.3
|
35
|
+
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
39
|
-
- - ~>
|
40
|
-
- !ruby/object:Gem::Version
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.2.3
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: scmd
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
41
48
|
version: 3.0.3
|
42
49
|
type: :runtime
|
43
|
-
|
44
|
-
version_requirements:
|
45
|
-
|
46
|
-
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 3.0.3
|
56
|
+
description: '"Juh Gem", baby! (a gem utility CLI)'
|
57
|
+
email:
|
47
58
|
- kelly@kellyredding.com
|
48
59
|
- collin.redding@me.com
|
49
|
-
executables:
|
60
|
+
executables:
|
50
61
|
- ggem
|
51
62
|
extensions: []
|
52
|
-
|
53
63
|
extra_rdoc_files: []
|
54
|
-
|
55
|
-
files:
|
56
|
-
- .gitignore
|
64
|
+
files:
|
57
65
|
- Gemfile
|
58
66
|
- LICENSE
|
59
67
|
- README.md
|
@@ -74,9 +82,11 @@ files:
|
|
74
82
|
- lib/ggem/template_file/gitignore.erb
|
75
83
|
- lib/ggem/template_file/lib.rb.erb
|
76
84
|
- lib/ggem/template_file/lib_version.rb.erb
|
85
|
+
- lib/ggem/template_file/ruby-version.erb
|
77
86
|
- lib/ggem/template_file/test_helper.rb.erb
|
78
87
|
- lib/ggem/template_file/test_support_factory.rb.erb
|
79
88
|
- lib/ggem/version.rb
|
89
|
+
- log/.keep
|
80
90
|
- test/helper.rb
|
81
91
|
- test/support/cmd_tests_helpers.rb
|
82
92
|
- test/support/factory.rb
|
@@ -89,32 +99,29 @@ files:
|
|
89
99
|
- test/unit/gemspec_tests.rb
|
90
100
|
- test/unit/git_repo_tests.rb
|
91
101
|
homepage: http://github.com/redding/ggem
|
92
|
-
licenses:
|
102
|
+
licenses:
|
93
103
|
- MIT
|
94
104
|
metadata: {}
|
95
|
-
|
96
105
|
post_install_message:
|
97
106
|
rdoc_options: []
|
98
|
-
|
99
|
-
require_paths:
|
107
|
+
require_paths:
|
100
108
|
- lib
|
101
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
-
|
104
|
-
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '2.5'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
110
119
|
requirements: []
|
111
|
-
|
112
|
-
rubyforge_project:
|
113
|
-
rubygems_version: 2.6.4
|
120
|
+
rubygems_version: 3.1.2
|
114
121
|
signing_key:
|
115
122
|
specification_version: 4
|
116
|
-
summary: "
|
117
|
-
test_files:
|
123
|
+
summary: '"Juh Gem", baby! (a gem utility CLI)'
|
124
|
+
test_files:
|
118
125
|
- test/helper.rb
|
119
126
|
- test/support/cmd_tests_helpers.rb
|
120
127
|
- test/support/factory.rb
|