rjgit 5.7.0.0 → 5.7.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/actor.rb +10 -3
  3. data/lib/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c44778442b606fcefdcc05154037588f9cdbda66d37bf9885318815b4eb3799
4
- data.tar.gz: eab78cd321c6c45249c0768540f3d4ddcd06d6f04bc1dc6c097b86577341c481
3
+ metadata.gz: ee1618ecf4d5b33793cda5f7f2d4a83af873e48167ae426f144cbb21177beab0
4
+ data.tar.gz: 95b32d3cbf4b5b85117986d1daa088180390d327b6503b9b042aa1055a00d20a
5
5
  SHA512:
6
- metadata.gz: facb928fe049b87c9a50f9ae6151a4e0545990373bad18f66a95bf523ce9666b288f29338a98694a0e5f627b6a55ffe58c61dc6fa2b4b7293f293d96c729bf36
7
- data.tar.gz: 1fbf4acc0fce8f4a849a91f84d7a9bec7a19b1c8f11b306aea98b7c73970b8eabdcd03734b015dbacd057e747f0a6ca20f1c0a78499102801e791a134c9c56ce
6
+ metadata.gz: 268fecedf6964680fc7e94c8fa4b3f66333d556976c154a0db0bbbb8121ee9e23bae563c4493bab07ed798d09b7c57d677062d1a5d5561e56f0d4ab56a256eab
7
+ data.tar.gz: 00bfe427f864a3aa3854c5aac56b94d1067695dbd0bd6e2dcf8f7302ad6545bd6a55c0c656e6f897bd848a921be35545067ef328fcc577aa2010b7ff1c005c1f
@@ -2,6 +2,7 @@ module RJGit
2
2
 
3
3
  # PersonIdent in JGit
4
4
  import 'org.eclipse.jgit.lib.PersonIdent'
5
+ import 'java.util.TimeZone'
5
6
 
6
7
  class Actor
7
8
 
@@ -17,10 +18,11 @@ module RJGit
17
18
  return self.new(name, email)
18
19
  end
19
20
 
20
- def initialize(name, email)
21
+ def initialize(name, email, time = nil)
21
22
  @name = name
22
23
  @email = email
23
- @person_ident = PersonIdent.new(name, email)
24
+ @time = time
25
+ @person_ident = @time ? PersonIdent.new(name, email, time.to_java, TimeZone.getTimeZone(time.zone)) : PersonIdent.new(name, email)
24
26
  end
25
27
 
26
28
  # Create an Actor from a string.
@@ -43,7 +45,8 @@ module RJGit
43
45
  # time - The Time the commit was authored or committed.
44
46
  #
45
47
  # Returns a String.
46
- def output(time)
48
+ def output(time = nil)
49
+ time = time || self.time
47
50
  offset = time.utc_offset / 60
48
51
  "%s <%s> %d %+.2d%.2d" % [
49
52
  @name,
@@ -52,6 +55,10 @@ module RJGit
52
55
  offset / 60,
53
56
  offset.abs % 60]
54
57
  end
58
+
59
+ def time
60
+ Time.at(@person_ident.getWhen.getTime/1000)
61
+ end
55
62
 
56
63
  end
57
64
 
@@ -1,3 +1,3 @@
1
1
  module RJGit
2
- VERSION = "5.7.0.0"
2
+ VERSION = "5.7.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjgit
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.0.0
4
+ version: 5.7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Engelen
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-03-27 00:00:00.000000000 Z
15
+ date: 2020-04-29 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  requirement: !ruby/object:Gem::Requirement