punched 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/bin/punched +1 -1
  4. data/lib/punchcard.rb +2 -2
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e32ecae020c60045001e02e54c491a9934bcbfa6
4
- data.tar.gz: bc7cde33f9c2a703dc63510d922a1ad5654473f9
3
+ metadata.gz: 9bed6547761121ad6c16979875ca50597e85489e
4
+ data.tar.gz: 07cf3d880ead444c6acdf5779796c526f3d87c47
5
5
  SHA512:
6
- metadata.gz: 9d01b3825d44a516a7912f14dca87d54fbf33a5bbb7861498848ee55b96eb6fb01350b0196fa49099f7d0885b0818da903fec12d93b7cdcc6bf2f60859e866b5
7
- data.tar.gz: 474e2d246554cc62e4bda9619410e7c565aa4f62dde1b7ea557c6728af7d651cdd3beb3b5bd328e6eda0780cf281e095321bf02a1045538f07bc19c8290768cd
6
+ metadata.gz: cb9309efb628b620ce7e3d4a0ea6baa71bc3328283675e5031677966d77b124a98a5e9660a50236a2fc137ecf32c75d8b39a331f8ce2723ec0b6c7f5af87b5c9
7
+ data.tar.gz: 353d7c5d5cdb0ce801f6025b80fe0657d80efcd7362e896ce9ab0aebcf7a0ee3f6cab5690a1716e4602006e3abde0f0a5c0d203a06e904ee9df481531843af7c
data/README.md CHANGED
@@ -6,7 +6,6 @@
6
6
  ### Requirements
7
7
 
8
8
  * ruby 2+
9
- * unix bash (maybe windows works as well?!?)
10
9
 
11
10
  ### Install
12
11
 
@@ -24,7 +23,7 @@
24
23
 
25
24
  #### Wildcard
26
25
 
27
- Save keystrokes by using wildcard. The last active project, which matches the pattern (case insensitive) will be selected:
26
+ Save keystrokes by using wildcard. The first last active project, which matches the pattern (case insensitive) will be selected:
28
27
 
29
28
  ```sh
30
29
  $ punched start "Punch*"
@@ -89,6 +88,14 @@ Toggle between start and stop:
89
88
  $ punched remove "Punchcard (programming)"
90
89
  ```
91
90
 
91
+ #### Help
92
+
93
+ List all available actions:
94
+
95
+ ```sh
96
+ $ punched help
97
+ Usage: punched csv|details|remove|rename|set|start|status|stop|toggle|total 'Name of my project'
98
+ ```
92
99
 
93
100
  #### List all projects with total time in CSV format
94
101
 
data/bin/punched CHANGED
@@ -7,7 +7,7 @@ require 'punchcard'
7
7
  #
8
8
 
9
9
  def available_actions
10
- PunchCard.new(nil).public_methods(false).reject { |item| item.to_s.end_with?('=') }.sort
10
+ PunchCard.new(nil).public_methods(false).reject { |item| item.to_s.end_with?('=') || item.to_s == 'project' }.sort
11
11
  end
12
12
 
13
13
  def action_available? action
data/lib/punchcard.rb CHANGED
@@ -9,7 +9,7 @@ class PunchCard
9
9
  HOURLY_RATE_PATTERN = /^\s*(\d+)([^\d]+)*\s*/i
10
10
  TIME_POINT_PATTERN = /^(\d+)((\-)(\d+))*$/
11
11
  META_KEY_PATTERN = /^([a-zA-Z0-9]+)\:\s*(.*)$/
12
- VERSION = '0.1.2'
12
+ VERSION = '0.1.3'
13
13
 
14
14
  attr_accessor :project
15
15
 
@@ -273,7 +273,7 @@ class PunchCard
273
273
  end
274
274
 
275
275
  def write_to_project_file!
276
- timestamps = project_data.select { |line| line.match(/^\d+/) }
276
+ timestamps = project_data.select { |line| line.match(TIME_POINT_PATTERN) }
277
277
  meta_data_lines = @meta_data.map { |key, value| "#{key}: #{value}" }
278
278
  write_string_to_project_file! [@project, meta_data_lines.join("\n"), timestamps].reject(&:empty?).join("\n")
279
279
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punched
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Staender
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-14 00:00:00.000000000 Z
11
+ date: 2017-05-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Minimal time tracking tool for cli
14
14
  email: