gitignores 0.1.0 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0edda6b894e24e50cafe41003380171ab0157e65
4
- data.tar.gz: 953d0f542005a7a3ca37dc0bb35f4892f83455d1
2
+ SHA256:
3
+ metadata.gz: 5a2c227bbcd01fc5db4de822d7fbb850c8d49427f0e09166f0e5a3578cd5db82
4
+ data.tar.gz: 8b62d2036dba2ec308cf162ef23fa6f1a0cbc9e862f9201f9a76162f0f60a3ee
5
5
  SHA512:
6
- metadata.gz: 7f6b60527d67e26f41e1160e8a6efa7c44b27fd89f5af17a8dbd0d41fa42e399174fde330785493cec9f2eabf1b71d4da4cfacce89ffbb332a54853ce80e816e
7
- data.tar.gz: 003054f16f0868964e2a8275339fc55acb3e011f3d9d85f87aff73f9cb2e8c5e77c58b13ffa33426e5427fa225f2d1d7cdd991e933c73f40be32f88dd40cebb4
6
+ metadata.gz: b352a098f1efe529bee8f45e99a9634e3b519581cfc96496ed07eec9e17914e7e6affaf04ea636df643d8f347a09af3405cd252dbd959a088037a26832859ab7
7
+ data.tar.gz: bbd5907f97d298cbfb8581554631c054144b088ef2f64639e69e395e51f5e6a68f184d6c4a7d1f89213dcee17a38abf2f7afce00fbbe92470d249f8ef95bbab5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## 0.1.2 (2025-07-11)
2
+
3
+ Compatibility:
4
+
5
+ - Add Ruby 3.x compatibility by replacing deprecated `Dir.exists?` and `File.exists?` methods
6
+ - Update GLI gem from 2.13.3 to 2.21.5 to fix ERB deprecation warnings
7
+ - Fix deprecated `Rake::RDocTask`, now uses `RDoc::Task`
8
+ - Add Ruby version requirement (>= 2.5.0) to gemspec
9
+
10
+ Security:
11
+
12
+ - Fix potential shell command injection vulnerability by using `system()` instead of backticks
13
+
14
+ Features:
15
+
16
+ - Update OS gitignore name from 'OSX' to 'macOS' to match current GitHub repository structure
17
+
18
+ Development:
19
+
20
+ - Update RSpec stubbing syntax to modern `allow().to receive()` pattern
21
+ - Add proper error handling for git operations with custom exception classes
22
+
1
23
  ## 0.0.3 (2015-05-25)
2
24
 
3
25
  Features:
data/Gemfile.lock CHANGED
@@ -1,26 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitignores (0.1.0)
5
- gli (= 2.13.3)
4
+ gitignores (0.1.2)
5
+ gli (= 2.21.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- diff-lcs (1.2.5)
11
- gli (2.13.3)
12
- json (1.8.3)
13
- rake (10.4.2)
14
- rdoc (4.2.0)
15
- json (~> 1.4)
16
- rspec (2.13.0)
17
- rspec-core (~> 2.13.0)
18
- rspec-expectations (~> 2.13.0)
19
- rspec-mocks (~> 2.13.0)
20
- rspec-core (2.13.1)
21
- rspec-expectations (2.13.0)
22
- diff-lcs (>= 1.1.3, < 2.0)
23
- rspec-mocks (2.13.1)
10
+ diff-lcs (1.4.4)
11
+ gli (2.21.5)
12
+ rake (13.0.3)
13
+ rdoc (6.3.0)
14
+ rspec (3.10.0)
15
+ rspec-core (~> 3.10.0)
16
+ rspec-expectations (~> 3.10.0)
17
+ rspec-mocks (~> 3.10.0)
18
+ rspec-core (3.10.1)
19
+ rspec-support (~> 3.10.0)
20
+ rspec-expectations (3.10.1)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.10.0)
23
+ rspec-mocks (3.10.2)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.10.0)
26
+ rspec-support (3.10.2)
24
27
 
25
28
  PLATFORMS
26
29
  ruby
@@ -30,3 +33,6 @@ DEPENDENCIES
30
33
  rake
31
34
  rdoc
32
35
  rspec
36
+
37
+ BUNDLED WITH
38
+ 2.6.9
data/README.md CHANGED
@@ -4,7 +4,7 @@ Tool for building a .gitignore from community templates at [github/gitignore](ht
4
4
 
5
5
  ## Installation
6
6
 
7
- $ gem install gitignores
7
+ gem install gitignores
8
8
 
9
9
  ## Usage
10
10
 
@@ -27,4 +27,3 @@ Prints gitignores for Java, JetBrains, Eclipse to standard out
27
27
  **update** updates the github/gitignore cache (by default `$HOME/.gitignores`)
28
28
 
29
29
  gitignores update
30
-
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = gitignores - .gitignore builder
2
2
 
3
3
  Author:: Johnathan Gilday (me@johnathangilday.com)
4
- Copyright:: Copyright (c) 2013 Johnathan Gilday
4
+ Copyright:: Copyright (c) 2021 Johnathan Gilday
5
5
 
6
6
 
7
7
  License:: apache, see LICENSE.txt
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'bundler/gem_tasks'
1
2
  require 'rake/clean'
2
3
  require 'rubygems'
3
4
  require 'rubygems/package_task'
@@ -6,7 +7,7 @@ require 'rspec/core/rake_task'
6
7
 
7
8
  CLEAN << 'tmp'
8
9
 
9
- Rake::RDocTask.new do |rd|
10
+ RDoc::Task.new do |rd|
10
11
  rd.main = "README.rdoc"
11
12
  rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
12
13
  rd.title = 'gitignores'
@@ -14,14 +15,9 @@ end
14
15
 
15
16
  include Rake::DSL
16
17
 
17
- Bundler::GemHelper.install_tasks
18
18
 
19
19
  RSpec::Core::RakeTask.new do |t|
20
20
  end
21
21
 
22
- spec = eval(File.read('gitignores.gemspec'))
23
-
24
- Gem::PackageTask.new(spec) do |pkg|
25
- end
26
22
 
27
23
  task :default => [:spec]
data/bin/gitignores CHANGED
@@ -33,11 +33,11 @@ Use the list command to show possible values for snippet names.
33
33
  )
34
34
  arg 'snippet', :multiple
35
35
  command :add do |c|
36
- c.desc 'include snippets for operating systems OSX, Windows, Linux'
36
+ c.desc 'include snippets for operating systems macOS, Windows, Linux'
37
37
  c.switch :os, :negatable => false
38
38
  c.action do |global_options,options,args|
39
39
  if (options[:os])
40
- args.concat ['OSX', 'Windows', 'Linux']
40
+ args.concat ['macOS', 'Windows', 'Linux']
41
41
  end
42
42
  args.uniq!
43
43
  $gitignores.add(args)
data/gitignores.gemspec CHANGED
@@ -9,16 +9,16 @@ Gem::Specification.new do |gem|
9
9
  gem.platform = Gem::Platform::RUBY
10
10
  gem.summary = Gitignores::SUMMARY
11
11
  gem.homepage = 'https://github.com/gilday/gitignore-builder'
12
+ gem.required_ruby_version = '>= 2.5.0'
12
13
 
13
14
  gem.files = `git ls-files`.split("
14
15
  ")
15
16
  gem.require_paths << 'lib'
16
- gem.has_rdoc = true
17
17
  gem.bindir = 'bin'
18
18
  gem.executables << 'gitignores'
19
19
  gem.add_development_dependency('rake')
20
20
  gem.add_development_dependency('rdoc')
21
21
  gem.add_development_dependency('rspec')
22
- gem.add_runtime_dependency('gli','2.13.3')
22
+ gem.add_runtime_dependency('gli','2.21.5')
23
23
  end
24
24
 
@@ -15,8 +15,8 @@ module Gitignores
15
15
 
16
16
  def find_gitignores_by_name(ignores)
17
17
  ignores.collect { |x|
18
- path = File.exists?("#{@local_repository}/#{x}.gitignore") ? "#{@local_repository}/#{x}.gitignore" : "#{@local_repository}/Global/#{x}.gitignore"
19
- unless File.exists? path
18
+ path = File.exist?("#{@local_repository}/#{x}.gitignore") ? "#{@local_repository}/#{x}.gitignore" : "#{@local_repository}/Global/#{x}.gitignore"
19
+ unless File.exist? path
20
20
  raise GitignoreNotFoundException.new(x), "File #{path} does not exist"
21
21
  end
22
22
  File.expand_path(path)
@@ -5,4 +5,7 @@ module Gitignores
5
5
  @ignore_name = ignore_name
6
6
  end
7
7
  end
8
+
9
+ class GitCloneError < RuntimeError; end
10
+ class GitPullError < RuntimeError; end
8
11
  end
@@ -1,4 +1,5 @@
1
1
  require 'gitignores'
2
+ require 'shellwords'
2
3
 
3
4
  module Gitignores
4
5
  class GitignoreFetcher
@@ -16,7 +17,7 @@ module Gitignores
16
17
  # If @update_ignores? is set, will try to update the latest gitignores
17
18
  # Will store all gitignores in the @local_repository
18
19
  def fetch_gitignores()
19
- unless (Dir.exists?(@local_repository))
20
+ unless (Dir.exist?(@local_repository))
20
21
  @git.clone @remote_repository, @local_repository
21
22
  end
22
23
  if @update_ignores
@@ -37,12 +38,14 @@ module Gitignores
37
38
  class Git
38
39
 
39
40
  def clone(repository, directory)
40
- `git clone #{repository} #{directory}`
41
+ system('git', 'clone', repository, directory)
42
+ raise GitCloneError, "Failed to clone #{repository}" unless $?.success?
41
43
  end
42
44
 
43
45
  def pull(directory)
44
46
  Dir.chdir(directory) {
45
- `git pull`
47
+ system('git', 'pull')
48
+ raise GitPullError, "Failed to pull in #{directory}" unless $?.success?
46
49
  }
47
50
  end
48
51
  end
@@ -1,5 +1,5 @@
1
1
  module Gitignores
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
 
4
4
  SUMMARY = "Generates .gitignore"
5
5
 
@@ -11,7 +11,7 @@ describe GitignoreBuilder do
11
11
  # Really simple test because I'm a Ruby newb
12
12
  describe "#new" do
13
13
  it "creates a new GitignoreBuilder" do
14
- @builder.should be_an_instance_of GitignoreBuilder
14
+ expect(@builder).to be_an_instance_of GitignoreBuilder
15
15
  end
16
16
  end
17
17
 
@@ -21,8 +21,8 @@ describe GitignoreBuilder do
21
21
  paths = @builder.find_gitignores_by_name ["foo", "bar"]
22
22
 
23
23
  fake_ignores_root = File.expand_path(FAKE_IGNORES)
24
- paths.should include("#{fake_ignores_root}/foo.gitignore")
25
- paths.should include("#{fake_ignores_root}/Global/bar.gitignore")
24
+ expect(paths).to include("#{fake_ignores_root}/foo.gitignore")
25
+ expect(paths).to include("#{fake_ignores_root}/Global/bar.gitignore")
26
26
  end
27
27
 
28
28
  it "raises GitignoreNotFound exception if it cannot find a Gitignore" do
@@ -37,7 +37,7 @@ describe GitignoreBuilder do
37
37
  out = StringIO.new
38
38
  @builder.concatenate_files(["#{FAKE_IGNORES}/foo.gitignore", "#{FAKE_IGNORES}/Global/bar.gitignore"], out)
39
39
 
40
- out.string.should eq(
40
+ expect(out.string).to eq(
41
41
  "
42
42
  \# foo
43
43
 
@@ -11,8 +11,8 @@ describe Git do
11
11
  FileUtils.rm_rf(test_repository)
12
12
  @git.clone '.', test_repository
13
13
 
14
- File.exists?(test_repository).should be_true
15
- Dir[test_repository].empty?.should be_false
14
+ expect(File.exist?(test_repository)).to be true
15
+ expect(Dir[test_repository].empty?).to be false
16
16
  end
17
17
  end
18
18
 
@@ -27,15 +27,15 @@ describe GitignoreFetcher do
27
27
  describe "#fetch_gitignores" do
28
28
 
29
29
  it "downloads the github/gitignore repository" do
30
- @mockGit.should_receive(:clone)
30
+ expect(@mockGit).to receive(:clone)
31
31
 
32
32
  @fetcher.fetch_gitignores
33
33
  end
34
34
 
35
35
  it "updates the repository when given update flag" do
36
36
  @fetcher.update_ignores = true
37
- @mockGit.stub(:clone)
38
- @mockGit.should_receive(:pull).with(anything())
37
+ allow(@mockGit).to receive(:clone)
38
+ expect(@mockGit).to receive(:pull).with(anything())
39
39
 
40
40
  @fetcher.fetch_gitignores
41
41
  end
@@ -44,11 +44,11 @@ describe GitignoreFetcher do
44
44
  describe "#list_gitignores" do
45
45
 
46
46
  it "finds all gitignores in the directory and returns their names in a list" do
47
- @mockGit.stub(:clone)
47
+ allow(@mockGit).to receive(:clone)
48
48
  @fetcher.local_repository = FAKE_IGNORES
49
49
  ignores = @fetcher.list_gitignores
50
50
 
51
- ignores.should include("foo", "bar")
51
+ expect(ignores).to include("foo", "bar")
52
52
  end
53
53
  end
54
54
 
metadata CHANGED
@@ -1,55 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitignores
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnathan Gilday
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2015-11-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - '>='
16
+ - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: '0'
20
19
  type: :development
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - '>='
23
+ - - ">="
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: rdoc
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - '>='
30
+ - - ">="
32
31
  - !ruby/object:Gem::Version
33
32
  version: '0'
34
33
  type: :development
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
- - - '>='
37
+ - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: rspec
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - '>='
44
+ - - ">="
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - '>='
51
+ - - ">="
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0'
55
54
  - !ruby/object:Gem::Dependency
@@ -58,22 +57,21 @@ dependencies:
58
57
  requirements:
59
58
  - - '='
60
59
  - !ruby/object:Gem::Version
61
- version: 2.13.3
60
+ version: 2.21.5
62
61
  type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - '='
67
66
  - !ruby/object:Gem::Version
68
- version: 2.13.3
69
- description:
67
+ version: 2.21.5
70
68
  email: me@johnathangilday.com
71
69
  executables:
72
70
  - gitignores
73
71
  extensions: []
74
72
  extra_rdoc_files: []
75
73
  files:
76
- - .gitignore
74
+ - ".gitignore"
77
75
  - CHANGELOG.md
78
76
  - Gemfile
79
77
  - Gemfile.lock
@@ -96,25 +94,22 @@ files:
96
94
  homepage: https://github.com/gilday/gitignore-builder
97
95
  licenses: []
98
96
  metadata: {}
99
- post_install_message:
100
97
  rdoc_options: []
101
98
  require_paths:
102
99
  - lib
103
100
  - lib
104
101
  required_ruby_version: !ruby/object:Gem::Requirement
105
102
  requirements:
106
- - - '>='
103
+ - - ">="
107
104
  - !ruby/object:Gem::Version
108
- version: '0'
105
+ version: 2.5.0
109
106
  required_rubygems_version: !ruby/object:Gem::Requirement
110
107
  requirements:
111
- - - '>='
108
+ - - ">="
112
109
  - !ruby/object:Gem::Version
113
110
  version: '0'
114
111
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.2.2
117
- signing_key:
112
+ rubygems_version: 3.6.9
118
113
  specification_version: 4
119
114
  summary: Generates .gitignore
120
115
  test_files: []