ggem 1.8.4 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
5
+ ruby "~> 2.5"
6
+
3
7
  gemspec
4
8
 
5
- gem 'pry', "~> 0.9.0"
9
+ gem "pry"
@@ -1,4 +1,4 @@
1
- # <%= @gem.module_name %>
1
+ # <%= @ggem.module_name %>
2
2
 
3
3
  TODO: Write a gem description
4
4
 
@@ -10,7 +10,7 @@ TODO: Write code samples and usage instructions here
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
- gem '<%= @gem.name %>'
13
+ gem "<%= @ggem.name %>"
14
14
 
15
15
  And then execute:
16
16
 
@@ -18,12 +18,12 @@ And then execute:
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install <%= @gem.name %>
21
+ $ gem install <%= @ggem.name %>
22
22
 
23
23
  ## Contributing
24
24
 
25
25
  1. Fork it
26
26
  2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Added some feature'`)
27
+ 3. Commit your changes (`git commit -am "Added some feature"`)
28
28
  4. Push to the branch (`git push origin my-new-feature`)
29
29
  5. Create new Pull Request
@@ -1,24 +1,28 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
4
+ lib = File.expand_path("../lib", __FILE__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "<%= @gem.ruby_name %>/version"
6
+ require "<%= @ggem.ruby_name %>/version"
5
7
 
6
8
  Gem::Specification.new do |gem|
7
- gem.name = "<%= @gem.name %>"
8
- gem.version = <%= @gem.module_name %>::VERSION
9
+ gem.name = "<%= @ggem.name %>"
10
+ gem.version = <%= @ggem.module_name %>::VERSION
9
11
  gem.authors = ["TODO: authors"]
10
12
  gem.email = ["TODO: emails"]
11
13
  gem.summary = "TODO: Write a gem summary"
12
14
  gem.description = "TODO: Write a gem description"
13
15
  gem.homepage = "TODO: homepage"
14
- gem.license = 'MIT'
16
+ gem.license = "MIT"
15
17
 
16
- gem.files = `git ls-files`.split($/)
18
+ gem.files = `git ls-files | grep "^[^.]"`.split($/)
17
19
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
21
  gem.require_paths = ["lib"]
20
22
 
21
- gem.add_development_dependency("assert", ["~> 2.16.3"])
22
- # TODO: gem.add_dependency("gem-name", ["~> 0.0.0"])
23
+ gem.required_ruby_version = "~> 2.5"
23
24
 
25
+ gem.add_development_dependency("assert", ["~> 2.19.1"])
26
+
27
+ # TODO: gem.add_dependency("gem-name", ["~> 0.0.0"])
24
28
  end
@@ -1,5 +1,7 @@
1
- require "<%= @gem.ruby_name %>/version"
1
+ # frozen_string_literal: true
2
2
 
3
- module <%= @gem.module_name %>
3
+ require "<%= @ggem.ruby_name %>/version"
4
+
5
+ module <%= @ggem.module_name %>
4
6
  # TODO: your code goes here...
5
7
  end
@@ -1,3 +1,5 @@
1
- module <%= @gem.module_name %>
1
+ # frozen_string_literal: true
2
+
3
+ module <%= @ggem.module_name %>
2
4
  VERSION = "0.0.1"
3
5
  end
@@ -1,21 +1,14 @@
1
- # this file is automatically required when you run `assert`
2
- # put any test helpers here
1
+ # frozen_string_literal: true
3
2
 
4
- # add the root dir to the load path
5
- $LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
6
-
7
- # require pry for debugging (`binding.pry`)
8
- require 'pry'
3
+ # This file is automatically required when you run `assert`; put any test
4
+ # helpers here.
9
5
 
10
- require 'test/support/factory'
6
+ # Add the root dir to the load path.
7
+ $LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
11
8
 
12
- # 1.8.7 backfills
9
+ # Require pry for debugging (`binding.pry`).
10
+ require "pry"
13
11
 
14
- # Array#sample
15
- if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
16
- class Array
17
- alias_method :sample, :choice
18
- end
19
- end
12
+ require "test/support/factory"
20
13
 
21
14
  # TODO: put test helpers here...
@@ -1,6 +1,7 @@
1
- require 'assert/factory'
1
+ # frozen_string_literal: true
2
+
3
+ require "assert/factory"
2
4
 
3
5
  module Factory
4
6
  extend Assert::Factory
5
-
6
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GGem
2
- VERSION = "1.8.4"
4
+ VERSION = "1.9.4"
3
5
  end
File without changes
@@ -1,23 +1,16 @@
1
- # this file is automatically required when you run `assert`
2
- # put any test helpers here
1
+ # frozen_string_literal: true
3
2
 
4
- # add the root dir to the load path
5
- require 'pathname'
6
- ROOT_PATH = Pathname.new(File.expand_path('../..', __FILE__))
7
- $LOAD_PATH.unshift(ROOT_PATH.to_s)
8
- TMP_PATH = ROOT_PATH.join('tmp')
9
- TEST_SUPPORT_PATH = ROOT_PATH.join('test/support')
10
-
11
- # require pry for debugging (`binding.pry`)
12
- require 'pry'
3
+ # This file is automatically required when you run `assert`; put any test
4
+ # helpers here.
13
5
 
14
- require 'test/support/factory'
6
+ # Add the root dir to the load path.
7
+ require "pathname"
8
+ ROOT_PATH = Pathname.new(File.expand_path("../..", __FILE__))
9
+ $LOAD_PATH.unshift(ROOT_PATH.to_s)
10
+ TMP_PATH = ROOT_PATH.join("tmp")
11
+ TEST_SUPPORT_PATH = ROOT_PATH.join("test/support")
15
12
 
16
- # 1.8.7 backfills
13
+ # Require pry for debugging (`binding.pry`).
14
+ require "pry"
17
15
 
18
- # Array#sample
19
- if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
20
- class Array
21
- alias_method :sample, :choice
22
- end
23
- end
16
+ require "test/support/factory"
@@ -1,53 +1,50 @@
1
- require 'much-plugin'
2
- require 'scmd'
1
+ # frozen_string_literal: true
3
2
 
4
- module GGem
3
+ require "much-plugin"
4
+ require "scmd"
5
5
 
6
- module CmdTestsHelpers
7
- include MuchPlugin
6
+ module GGem; end
7
+ module GGem::CmdTestsHelpers
8
+ include MuchPlugin
8
9
 
9
- plugin_included do
10
- setup do
11
- ENV['SCMD_TEST_MODE'] = '1'
10
+ plugin_included do
11
+ setup do
12
+ ENV["SCMD_TEST_MODE"] = "1"
12
13
 
13
- @cmd_spy = nil
14
- Scmd.reset
14
+ @cmd_spy = nil
15
+ Scmd.reset
15
16
 
16
- @exp_cmds_run = []
17
- end
18
- teardown do
19
- Scmd.reset
20
- ENV.delete('SCMD_TEST_MODE')
21
- end
17
+ @exp_cmds_run = []
18
+ end
19
+ teardown do
20
+ Scmd.reset
21
+ ENV.delete("SCMD_TEST_MODE")
22
+ end
22
23
 
23
- private
24
+ private
24
25
 
25
- def assert_exp_cmds_run(&run_cmd_block)
26
- cmd_str, exitstatus, stdout = run_cmd_block.call
27
- assert_equal @exp_cmds_run, Scmd.calls.map(&:cmd_str)
26
+ def assert_exp_cmds_run(&run_cmd_block)
27
+ cmd_str, exitstatus, stdout = run_cmd_block.call
28
+ assert_equal @exp_cmds_run, Scmd.calls.map(&:cmd_str)
28
29
 
29
- assert_equal Scmd.calls.first.cmd_str, cmd_str
30
- assert_equal Scmd.calls.first.cmd.exitstatus, exitstatus
31
- assert_equal Scmd.calls.first.cmd.stdout, stdout
32
- end
30
+ assert_equal Scmd.calls.first.cmd_str, cmd_str
31
+ assert_equal Scmd.calls.first.cmd.exitstatus, exitstatus
32
+ assert_equal Scmd.calls.first.cmd.stdout, stdout
33
+ end
33
34
 
34
- def assert_exp_cmds_error(cmd_error_class, &run_cmd_block)
35
- err_cmd_str = @exp_cmds_run.sample
36
- Scmd.add_command(err_cmd_str) do |cmd|
37
- cmd.exitstatus = 1
38
- cmd.stderr = Factory.string
39
- @cmd_spy = cmd
40
- end
41
- err = nil
42
- begin; run_cmd_block.call; rescue StandardError => err; end
43
-
44
- assert_kind_of cmd_error_class, err
45
- exp = "#{@cmd_spy.cmd_str}\n#{@cmd_spy.stderr}"
46
- assert_equal exp, err.message
35
+ def assert_exp_cmds_error(cmd_error_class, &run_cmd_block)
36
+ err_cmd_str = @exp_cmds_run.sample
37
+ Scmd.add_command(err_cmd_str) do |cmd|
38
+ cmd.exitstatus = 1
39
+ cmd.stderr = Factory.string
40
+ @cmd_spy = cmd
47
41
  end
42
+ err = nil
43
+ begin; run_cmd_block.call; rescue StandardError => err; end
48
44
 
45
+ assert_kind_of cmd_error_class, err
46
+ exp = "#{@cmd_spy.cmd_str}\n#{@cmd_spy.stderr}"
47
+ assert_equal exp, err.message
49
48
  end
50
-
51
49
  end
52
-
53
50
  end
@@ -1,6 +1,7 @@
1
- require 'assert/factory'
1
+ # frozen_string_literal: true
2
+
3
+ require "assert/factory"
2
4
 
3
5
  module Factory
4
6
  extend Assert::Factory
5
-
6
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding: utf-8 -*-
2
4
  Gem::Specification.new do |gem|
3
5
  gem.name = "gem1"
@@ -6,7 +8,7 @@ Gem::Specification.new do |gem|
6
8
  gem.email = []
7
9
  gem.summary = %q{Gem 1 summary}
8
10
  gem.description = %q{Gem 1 description}
9
- gem.license = 'MIT'
11
+ gem.license = "MIT"
10
12
 
11
13
  gem.files = []
12
14
  gem.executables = []
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding: utf-8 -*-
2
4
  Gem::Specification.new do |gem|
3
5
  gem.name = "gem2"
@@ -6,9 +8,9 @@ Gem::Specification.new do |gem|
6
8
  gem.email = []
7
9
  gem.summary = %q{Gem 2 summary}
8
10
  gem.description = %q{Gem 2 description}
9
- gem.license = 'MIT'
11
+ gem.license = "MIT"
10
12
 
11
- gem.metadata['allowed_push_host'] = 'http://gems.example.com'
13
+ gem.metadata["allowed_push_host"] = "http://gems.example.com"
12
14
 
13
15
  gem.files = []
14
16
  gem.executables = []
@@ -1,67 +1,69 @@
1
- module GGem
2
- module NameSet
1
+ # frozen_string_literal: true
3
2
 
4
- class Base
5
- attr_reader :variations, :name, :module_name, :ruby_name
3
+ module GGem; end
4
+ module GGem::NameSet
5
+ class Base
6
+ attr_reader :variations, :name, :module_name, :ruby_name
6
7
 
7
- def expected_folders
8
- [ '',
9
- 'lib',
10
- "lib/#{@ruby_name}",
11
- 'test',
12
- 'test/support',
13
- 'test/system',
14
- 'test/unit',
15
- 'log',
16
- 'tmp'
17
- ]
18
- end
8
+ def expected_folders
9
+ [ "",
10
+ "lib",
11
+ "lib/#{@ruby_name}",
12
+ "test",
13
+ "test/support",
14
+ "test/system",
15
+ "test/unit",
16
+ "log",
17
+ "tmp"
18
+ ]
19
+ end
19
20
 
20
- def expected_files
21
- [ ".gitignore",
22
- "Gemfile",
23
- "#{@name}.gemspec",
24
- "README.md",
25
- "LICENSE",
21
+ def expected_files
22
+ [ ".ruby-version",
23
+ ".gitignore",
24
+ "Gemfile",
25
+ "#{@name}.gemspec",
26
+ "README.md",
27
+ "LICENSE",
26
28
 
27
- "lib/#{@ruby_name}.rb",
28
- "lib/#{@ruby_name}/version.rb",
29
+ "lib/#{@ruby_name}.rb",
30
+ "lib/#{@ruby_name}/version.rb",
29
31
 
30
- "test/helper.rb",
31
- "test/support/factory.rb",
32
+ "test/helper.rb",
33
+ "test/support/factory.rb",
32
34
 
33
- "log/.gitkeep",
34
- "tmp/.gitkeep",
35
- ]
36
- end
35
+ "log/.keep",
36
+ "test/system/.keep",
37
+ "test/unit/.keep",
38
+ "tmp/.keep",
39
+ ]
37
40
  end
41
+ end
38
42
 
39
- class Simple < Base
40
- def initialize
41
- @variations = ['simple']
42
- @name = 'simple'
43
- @module_name = 'Simple'
44
- @ruby_name = 'simple'
45
- end
43
+ class Simple < Base
44
+ def initialize
45
+ @variations = ["simple"]
46
+ @name = "simple"
47
+ @module_name = "Simple"
48
+ @ruby_name = "simple"
46
49
  end
50
+ end
47
51
 
48
- class Underscored < Base
49
- def initialize
50
- @variations = ['my_gem', 'my__gem', 'MyGem', 'myGem', 'My_Gem']
51
- @name = 'my_gem'
52
- @module_name = 'MyGem'
53
- @ruby_name = 'my_gem'
54
- end
52
+ class Underscored < Base
53
+ def initialize
54
+ @variations = ["my_gem", "my__gem", "MyGem", "myGem", "My_Gem"]
55
+ @name = "my_gem"
56
+ @module_name = "MyGem"
57
+ @ruby_name = "my_gem"
55
58
  end
59
+ end
56
60
 
57
- class HyphenatedOther < Base
58
- def initialize
59
- @variations = ['my-gem']
60
- @name = 'my-gem'
61
- @module_name = 'MyGem'
62
- @ruby_name = 'my-gem'
63
- end
61
+ class HyphenatedOther < Base
62
+ def initialize
63
+ @variations = ["my-gem"]
64
+ @name = "my-gem"
65
+ @module_name = "MyGem"
66
+ @ruby_name = "my-gem"
64
67
  end
65
-
66
68
  end
67
69
  end
@@ -1,10 +1,11 @@
1
- require 'assert'
2
- require 'ggem'
1
+ # frozen_string_literal: true
3
2
 
4
- require 'test/support/name_set'
3
+ require "assert"
4
+ require "ggem"
5
5
 
6
- module GGem
6
+ require "test/support/name_set"
7
7
 
8
+ module GGem
8
9
  class SystemTests < Assert::Context
9
10
 
10
11
  NS_SIMPLE = GGem::NameSet::Simple
@@ -12,7 +13,6 @@ module GGem
12
13
  NS_HYPHEN = GGem::NameSet::HyphenatedOther
13
14
 
14
15
  desc "GGem"
15
-
16
16
  end
17
17
 
18
18
  class GemTests < SystemTests
@@ -29,12 +29,11 @@ module GGem
29
29
  def assert_gem_name_set(name_set)
30
30
  name_set.variations.each do |variation|
31
31
  the_gem = GGem::Gem.new(TMP_PATH, variation)
32
- [:name, :module_name, :ruby_name].each do |name_type|
33
- assert_equal name_set.send(name_type), the_gem.send(name_type)
34
- end
32
+ assert_equal name_set.name, the_gem.name
33
+ assert_equal name_set.module_name, the_gem.module_name
34
+ assert_equal name_set.ruby_name, the_gem.ruby_name
35
35
  end
36
36
  end
37
-
38
37
  end
39
38
 
40
39
  class GemSaveTests < GemTests
@@ -64,10 +63,8 @@ module GGem
64
63
  paths = (folders + files).collect{ |p| File.join(TMP_PATH, name_set.name, p) }
65
64
 
66
65
  paths.flatten.each do |path|
67
- assert File.exists?(path), "'#{path}' does not exist"
66
+ assert File.exists?(path), "`#{path}` does not exist"
68
67
  end
69
68
  end
70
-
71
69
  end
72
-
73
70
  end