repo_timetracker 1.0.4 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7e7ae50ebcce64dcc5115b2c3b5995c2162a6ce
4
- data.tar.gz: a8aedc68c1c05472d6923454c4a4df02455371c4
3
+ metadata.gz: 579de5a5b5a30e03af28638c2796a2e86df55755
4
+ data.tar.gz: 1c4ed11dad1da1baba4d09ae8fa77f53e57b89bf
5
5
  SHA512:
6
- metadata.gz: 31bdc5c29994b4a60e56292940658dd7f7f75721bea29f7fb659793d816a3c851b80a387b2df2ce12361f5ea17786dd20a30345a4f0a3a0713ccc4cd909cd61f
7
- data.tar.gz: 23a8369f871457540c2126bc463f425cb0db45216f0dec1cdefacd12e6777a7cec63a8e3f2936ebe870b635504b469f26c2d95908ca0ac1769453a095f4f4b1e
6
+ metadata.gz: 54c45ee03eb58cb7412b3c9902d0134ff3aa332f1b2265865ab11b4e2ecd6180f59908c9e5bf02c9abd15e8b7266969257449590fbf163ac53060fe93495be7f
7
+ data.tar.gz: bc60c8f38493282854cc6d2ef6ffe0976d838a2dd7f81e087dae35e038cd005116b8cb1325d06d7fa4aef5b3719cbe847d90a0004080fde84348a8e1edcce6ca
@@ -92,7 +92,7 @@ class RepoTimeline
92
92
 
93
93
  def initialize_timeline_directory_for(repo_directory)
94
94
  timeline_directory = "#{repo_directory}/.repo_timeline"
95
- gitignore_path = "#{repo_directory}.gitignore"
95
+ gitignore_path = "#{repo_directory}/.gitignore"
96
96
 
97
97
  ensure_gitignored(timeline_directory)
98
98
  FileUtils.mkdir_p(timeline_directory) unless File.directory?(timeline_directory)
@@ -100,13 +100,11 @@ class RepoTimeline
100
100
  timeline_directory
101
101
  end
102
102
 
103
- def ensure_gitignored(timeline_directory)
104
- gitignore_path = timeline_directory.sub('.repo_timeline', '.gitignore')
105
-
103
+ def ensure_gitignored(gitignore_path)
106
104
  FileUtils.touch(gitignore_path)
107
105
 
108
- unless File.readlines(gitignore_path).grep(/\.repo_timeline/)
109
- open(gitignore_path, 'a') { |f| f.puts "\n.repo_timeline" }
106
+ unless File.readlines(gitignore_path).grep(/\.repo_timeline/).any?
107
+ `echo '\n.repo_timeline' >> #{gitignore_path}`
110
108
  end
111
109
  end
112
110
 
@@ -1,3 +1,3 @@
1
1
  module RepoTimetracker
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -7,7 +7,7 @@ module RepoTimetracker
7
7
  repo_timeline = RepoTimeline.load_or_initialize_for(directory)
8
8
 
9
9
  if repo_timeline.nil?
10
- 'Error: no repo found.'
10
+ 'no repo'
11
11
  else
12
12
  repo_timeline.add_event(event_string)
13
13
  repo_timeline.watch_for_file_change_events
@@ -18,7 +18,7 @@ module RepoTimetracker
18
18
  repo_timeline = RepoTimeline.load_or_initialize_for(directory)
19
19
 
20
20
  if repo_timeline.nil?
21
- 'Error: no repo found.'
21
+ 'no repo'
22
22
  else
23
23
  time = repo_timeline.current_commit_time
24
24
  Time.at(time).utc.strftime("%H:%M:%S")
@@ -29,7 +29,7 @@ module RepoTimetracker
29
29
  repo_timeline = RepoTimeline.load_or_initialize_for(directory)
30
30
 
31
31
  if repo_timeline.nil?
32
- 'Error: no repo found.'
32
+ 'no repo'
33
33
  else
34
34
  time = repo_timeline.project_time
35
35
  Time.at(time).utc.strftime("%H:%M:%S")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repo_timetracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - neurodynamic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler