shamazing 0.0.4 → 0.0.5

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.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "http://rubygems.org"
2
+ gemspec
data/Rakefile CHANGED
@@ -47,7 +47,7 @@ task :default => :test
47
47
 
48
48
  require 'rake/testtask'
49
49
  Rake::TestTask.new(:test) do |test|
50
- test.libs << 'lib' << 'test'
50
+ test.libs << 'lib' << 'test' << '.'
51
51
  test.pattern = 'test/**/test_*.rb'
52
52
  test.verbose = true
53
53
  end
@@ -21,6 +21,7 @@
21
21
  require 'optparse'
22
22
  require 'rubygems'
23
23
  require 'shamazing'
24
+ require 'rugged'
24
25
 
25
26
  options = {
26
27
  :string => false,
@@ -56,11 +57,11 @@ parser = OptionParser.new do |opts|
56
57
  end
57
58
 
58
59
  parser.parse!
59
- sha = *ARGV
60
60
 
61
- if !sha
61
+ if ARGV.empty?
62
62
  # Automatically parse this repository's shas.
63
- shas = `git log --format="%H"`.split("\n")
63
+ repo = Rugged::Repository.new('.')
64
+ shas = repo.walk(repo.head.target).map(&:oid)
64
65
 
65
66
  if options[:string] && !options[:integer]
66
67
  puts Shamazing.string_from_array(shas,options[:full])
@@ -71,6 +72,8 @@ if !sha
71
72
  puts "Longest integer: #{Shamazing.integer_from_array(shas,options[:full])}"
72
73
  end
73
74
  else
75
+ sha = ARGV.first
76
+
74
77
  if options[:string] && !options[:integer]
75
78
  puts Shamazing.string(sha)
76
79
  elsif options[:integer]
@@ -79,4 +82,4 @@ else
79
82
  puts "Longest string: #{Shamazing.string(sha)}"
80
83
  puts "Longest integer: #{Shamazing.integer(sha)}"
81
84
  end
82
- end
85
+ end
@@ -1,5 +1,5 @@
1
1
  class Shamazing
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
 
4
4
  # Finds the longest continuous String in a SHA.
5
5
  #
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'shamazing'
7
- s.version = '0.0.4'
8
- s.date = '2012-03-28'
7
+ s.version = '0.0.5'
8
+ s.date = '2012-04-24'
9
9
  s.rubyforge_project = 'shamazing'
10
10
 
11
11
  s.summary = "Short description used in Gem listings."
@@ -21,8 +21,11 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.executables = ["shamazing"]
23
23
 
24
+ s.add_dependency('rugged', "~> 0.16.0")
25
+
24
26
  # = MANIFEST =
25
27
  s.files = %w[
28
+ Gemfile
26
29
  README.md
27
30
  Rakefile
28
31
  bin/shamazing
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shamazing
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zach Holman
@@ -15,10 +15,25 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-28 00:00:00 -07:00
18
+ date: 2012-04-24 00:00:00 -07:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rugged
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 95
30
+ segments:
31
+ - 0
32
+ - 16
33
+ - 0
34
+ version: 0.16.0
35
+ type: :runtime
36
+ version_requirements: *id001
22
37
  description: A library to discover amazing things about a SHA1 hash (or MD5 or whatever). It's sha-mazing. Almost as shamazing as that pun.
23
38
  email: zach@zachholman.com
24
39
  executables:
@@ -28,6 +43,7 @@ extensions: []
28
43
  extra_rdoc_files: []
29
44
 
30
45
  files:
46
+ - Gemfile
31
47
  - README.md
32
48
  - Rakefile
33
49
  - bin/shamazing
@@ -64,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
80
  requirements: []
65
81
 
66
82
  rubyforge_project: shamazing
67
- rubygems_version: 1.5.2
83
+ rubygems_version: 1.6.2
68
84
  signing_key:
69
85
  specification_version: 2
70
86
  summary: Short description used in Gem listings.