timetrap_toggl 0.2.2 → 0.3.0

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
  SHA1:
3
- metadata.gz: 8d311c621e6cfd456adc811e26308f0c295a32f4
4
- data.tar.gz: 563e7862307399e793b98510ed62e3593b024a3a
3
+ metadata.gz: adb0331f36f9285322c88cf43c20ae509394c179
4
+ data.tar.gz: dccae8c5d548308ff32eb4bf61c4bb564fea12dc
5
5
  SHA512:
6
- metadata.gz: 12a947e3500aba8b13a2ffad001c905dcdc3993215d454a14afe54aa7a037da9566f0c996d694d5dd2d6ee91e55ad8ec432b459fe9fab7dfa7b0fd46ac8e5f6f
7
- data.tar.gz: d6af84e3b3e0b97ea54ac0d940913cc6c8d9415b3b1d569da3277ca2fe7cd42931c358a7a9d1442ac86add1a875e9697e4fbfa5d9892ba663897ad347a320db9
6
+ metadata.gz: a90e69ec2cec4dc5fb9f15b18aeff0cc9f65c54041888bbc3c905ce8e83091aca7946eadd80c1002c3f5b74d78008024bfee593b23c39f6b5adc996845ad927f
7
+ data.tar.gz: 6c7bb6cf97697915f28e5335063815a11487bffc254735bc80e8311233796578d0db59908a213fdac92c427b9a38d35d7d671a468de6c052f3deb51f7b46fabf
@@ -34,6 +34,10 @@ class TimetrapToggl::Config
34
34
  @workspace ||= client.workspaces.find { |w| w["name"] == config["workspace"] }
35
35
  end
36
36
 
37
+ def aliases
38
+ config['aliases']
39
+ end
40
+
37
41
  def projects
38
42
  @projects ||= client.projects(workspace["id"])
39
43
  end
@@ -30,8 +30,14 @@ class TimetrapToggl::Formatter
30
30
  end
31
31
 
32
32
  def project
33
- config.projects.find do |p|
34
- code.downcase == p["name"].downcase.gsub(/[^a-zA-Z\d\s]/, '').gsub(/\s+/, '-')
33
+ if config.aliases[code]
34
+ config.projects.find do |p|
35
+ p["name"] == config.aliases[code]
36
+ end
37
+ else
38
+ config.projects.find do |p|
39
+ code == p["name"].downcase.gsub(/[^a-zA-Z\d\s]/, '').gsub(/\s+/, '-')
40
+ end
35
41
  end
36
42
  end
37
43
 
@@ -45,7 +51,7 @@ class TimetrapToggl::Formatter
45
51
 
46
52
  def code
47
53
  if match = TOGGABLE_REGEX.match(entry[:note])
48
- code = match[1]
54
+ code = match[1].downcase
49
55
  end
50
56
  end
51
57
 
@@ -1,3 +1,3 @@
1
1
  module TimetrapToggl
2
- VERSION = '0.2.2'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timetrap_toggl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Palhas
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.6.7
122
+ rubygems_version: 2.6.8
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: A toggl formatter for Timetrap