git_miner 0.2.1 → 0.2.2

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: 12c481503abcbd3c633ab3ed3712a97b1b2d88388c7db2daf1473aab5dd9d886
4
- data.tar.gz: 8a013d2c312f323b61e322d756884c4b7d4da2235ccdc5f55d0a87293a479952
3
+ metadata.gz: f0189bf9c342c04a3575700876f73dc9132eeab57ecd5127619ed591d4a9486a
4
+ data.tar.gz: 01db41129cc22cd8c4fd2ba3251603925613fe23ab028fa4b57cb88d05151b15
5
5
  SHA512:
6
- metadata.gz: 268ad9f06a85504d18bea84347e08b315e2c34f1d88ab4d8b2cd268accc3544a1ff36ec8afe17f4344dddc60d8b2aa6201230d4144511f873a2297da9a3be654
7
- data.tar.gz: 1439261df54c6c8235c8a6b47fd4dff175c962803083bf2ff02e711e6d405cb161a459113754a9cf0582cdbe8aaae1cf3052c838b838bca8f60bec3b1899435f
6
+ metadata.gz: a1d345cc49d44ef896a5875b7b4ab12679e72ed581301d9d5ef1500b84eb2a707af14e3d632da8d5e8a3b5654d54c2adc81e66a01b1454ffde2b16f2b8b3664d
7
+ data.tar.gz: f1ace38aefce766c9265269888b1c6f625461095ef5327a35723af392879d8c21e1c56a4c6d908b7f8eeda077bf5750e714b11477355b879449cce3d706aea13
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
 
13
13
  *.gem
14
+ lib/*.bundle
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_miner (0.1.0)
4
+ git_miner (0.2.1)
5
5
  concurrent-ruby (~> 1.1)
6
6
  parallel (~> 1.17)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- concurrent-ruby (1.1.5)
11
+ concurrent-ruby (1.1.9)
12
12
  diff-lcs (1.3)
13
- parallel (1.17.0)
14
- rake (10.5.0)
13
+ parallel (1.21.0)
14
+ rake (13.0.1)
15
15
  rake-compiler (1.0.7)
16
16
  rake
17
17
  rspec (3.8.0)
@@ -34,9 +34,9 @@ PLATFORMS
34
34
  DEPENDENCIES
35
35
  bundler (~> 2.0)
36
36
  git_miner!
37
- rake (~> 10.0)
37
+ rake (~> 13.0)
38
38
  rake-compiler (~> 1.0)
39
39
  rspec (~> 3.0)
40
40
 
41
41
  BUNDLED WITH
42
- 2.0.1
42
+ 2.2.32
data/README.md CHANGED
@@ -2,17 +2,24 @@
2
2
 
3
3
  Pet project I built to experiment with different concepts.
4
4
 
5
- GitMiner allow for "mining" of vanity Git sha1 prefixes.
5
+ GitMiner allow "mining" of vanity Git SHA1 prefixes.
6
6
 
7
7
  This gem is a work in progress (core functionality is working).
8
8
 
9
9
 
10
10
  ## Installation
11
11
 
12
+ Rubygem:
12
13
  ```ruby
13
14
  gem 'git_miner'
14
15
  ```
15
16
 
17
+ Development:
18
+ ```
19
+ gem build git_miner.gemspec
20
+ gem install --local git_miner-*.gem
21
+ ```
22
+
16
23
  The installation will add the `git-mine` binary which act as a Git custom command: `git mine`.
17
24
 
18
25
 
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ RSpec::Core::RakeTask.new(:spec)
7
7
  task :default => :spec
8
8
 
9
9
  Rake::ExtensionTask.new "git_miner_ext" do |ext|
10
- ext.lib_dir = "lib/git_miner"
10
+ ext.lib_dir = "lib"
11
11
  end
12
12
 
13
- Rake::Task[:test].prerequisites << :compile
13
+ Rake::Task[:spec].prerequisites << :compile
data/bin/git-mine CHANGED
@@ -4,7 +4,6 @@ STDOUT.sync = true
4
4
 
5
5
  require 'git_miner'
6
6
 
7
-
8
7
  require 'optparse'
9
8
 
10
9
  options = {
data/git_miner.gemspec CHANGED
@@ -33,13 +33,13 @@ Gem::Specification.new do |spec|
33
33
  spec.executables = ["git-mine"]
34
34
  spec.require_paths = ["lib"]
35
35
 
36
- spec.extensions = %w[ext/git_miner_ext/extconf.rb]
36
+ spec.extensions = Dir["ext/**/extconf.rb"]
37
37
 
38
38
  spec.add_runtime_dependency "parallel", "~> 1.17"
39
39
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.1"
40
40
 
41
41
  spec.add_development_dependency "bundler", "~> 2.0"
42
- spec.add_development_dependency "rake", "~> 10.0"
42
+ spec.add_development_dependency "rake", "~> 13.0"
43
43
  spec.add_development_dependency "rspec", "~> 3.0"
44
44
  spec.add_development_dependency "rake-compiler", "~> 1.0"
45
45
  end
@@ -1,7 +1,10 @@
1
1
  module GitMiner
2
2
  class Core
3
3
  def initialize(engine:, dispatch:, prefix:)
4
- GitMiner.logger.debug("Initializing with engine '#{engine}'. dispatch '#{dispatch}' and prefix '#{prefix}'")
4
+ GitMiner.logger.info("Initializing git miner.")
5
+ GitMiner.logger.info("Prefix: #{prefix}")
6
+ GitMiner.logger.debug("Engine: #{engine::IDENTIFIER}")
7
+ GitMiner.logger.debug("Dispatch: #{dispatch::IDENTIFIER}")
5
8
 
6
9
  @prefix = prefix
7
10
 
@@ -1,6 +1,8 @@
1
1
  module GitMiner
2
2
  module Dispatch
3
3
  class AbstractDispatch
4
+ IDENTIFIER = "N/A"
5
+
4
6
  BATCH_SIZE = 50_000
5
7
 
6
8
  def initialize(prefix:, engine:)
@@ -4,6 +4,8 @@ require 'concurrent'
4
4
  module GitMiner
5
5
  module Dispatch
6
6
  class ParallelDispatch < AbstractDispatch
7
+ IDENTIFIER = "Parallel"
8
+
7
9
  class ShaFound < StandardError
8
10
  attr_reader :result
9
11
 
@@ -1,6 +1,8 @@
1
1
  module GitMiner
2
2
  module Dispatch
3
3
  class SimpleDispatch < AbstractDispatch
4
+ IDENTIFIER = "Simple"
5
+
4
6
  def perform
5
7
  loop do
6
8
  result = @engine.mine(
@@ -1,6 +1,7 @@
1
1
  module GitMiner
2
2
  module Engine
3
3
  class AbstractEngine
4
+ IDENTIFIER = "N/A"
4
5
 
5
6
  def sha1(_str)
6
7
  raise NotImplementedError
@@ -1,10 +1,14 @@
1
- require 'git_miner_ext'
1
+ require 'openssl'
2
+
3
+ require File.join(__dir__, '..', '..', 'git_miner_ext')
2
4
 
3
5
  module GitMiner
4
6
  module Engine
5
7
  class CExtensionEngine < AbstractEngine
6
8
  include GitMinerExt
7
9
 
10
+ IDENTIFIER = "CExtension"
11
+
8
12
  def sha1(str)
9
13
  c_sha1_hexdigest(str)
10
14
  end
@@ -3,6 +3,8 @@ require 'digest'
3
3
  module GitMiner
4
4
  module Engine
5
5
  class RubyEngine < AbstractEngine
6
+ IDENTIFIER = "Ruby"
7
+
6
8
  def sha1(str)
7
9
  Digest::SHA1.hexdigest(str)
8
10
  end
@@ -26,7 +28,7 @@ module GitMiner
26
28
  end
27
29
  end
28
30
 
29
- return
31
+ nil
30
32
  end
31
33
 
32
34
  private
@@ -1,3 +1,3 @@
1
1
  module GitMiner
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_miner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thierry Joyal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-27 00:00:00.000000000 Z
11
+ date: 2021-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +134,7 @@ licenses: []
134
134
  metadata:
135
135
  homepage_uri: https://github.com/tjoyal/git_miner
136
136
  source_code_uri: https://github.com/tjoyal/git_miner
137
- post_install_message:
137
+ post_install_message:
138
138
  rdoc_options: []
139
139
  require_paths:
140
140
  - lib
@@ -149,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.0.3
153
- signing_key:
152
+ rubygems_version: 3.2.32
153
+ signing_key:
154
154
  specification_version: 4
155
155
  summary: git-mine shell executable
156
156
  test_files: []