worque 0.2.0 → 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: fcaba8f8f67002bfdd2c6b8eb49961deda41186f
4
- data.tar.gz: bcc471deff6aa73ab3481819b6396a0e13e214d8
3
+ metadata.gz: 60562e0093e4654d851b4a146635ca10bb1f2e83
4
+ data.tar.gz: a4abe01f360163aa79eb65ba6f9121b3e75cbd40
5
5
  SHA512:
6
- metadata.gz: 4e7143b95c2d5a40c92290189ae9c62c45442c265ceb8807dd54519216a2d5184544df2c9e9f96b422280b3b8df0340fe8165fc3f373fae50cc8e9257a8c7124
7
- data.tar.gz: 2a3b41249ac41cec06aeea39a10f58b7d4234c5c773083d04dca0a85d757d354aeafac7106ac9fbc8e7962e9dc3238e26271f0e707cd02cfa4c11e99b50c94ef
6
+ metadata.gz: abf92f4bf7c691efc18a48f581d14d8ddec88b8fcce0df37ddd74cd7ccf8bae9fcc0c7a0bf618dd85ea666a93886d3866b0dd8b9428e9bd89ba91da25ce66405
7
+ data.tar.gz: c2a90283eb97d211cd01e991e7ffc21d6261612f30178aa081270d81caa5ee01a0c1780c55197c8b7ac54e42cb7f0c5ac66a5b668fa4891e3caded9bd3d21efd
File without changes
data/README.md CHANGED
@@ -26,11 +26,6 @@ Install it by
26
26
 
27
27
  $ gem install worque
28
28
 
29
- Or, if you're using RVM and want the command available system-wide while keeping it in its own gemset
30
-
31
- $ rvm default@worque --create do gem install worque
32
- $ rvm wrapper default@worque --no-prefix worque
33
-
34
29
  ## Quick start guide
35
30
 
36
31
  ### CLI
@@ -75,13 +70,36 @@ worque todo --for=yesterday
75
70
  # This will jump back to Friday's note if it's Monday today!
76
71
  ```
77
72
 
78
- Lastly, jump ahead and start to plan for tomorrow.
73
+ If you live in the future
79
74
 
80
75
  ```sh
81
76
  worque todo --for=tomorrow
82
77
  # ~/notes/checklist-2016-07-20.md
83
78
  ```
84
79
 
80
+ If you want to start from a default template
81
+
82
+ ```sh
83
+ echo <<-EOF
84
+ List of things I need to do
85
+
86
+ * ......
87
+ * ...
88
+
89
+ Happy hacking
90
+ EOF >> /path/to/my/template
91
+
92
+ worque todo --template-path=/path/to/my/template
93
+ # ~/notes/checklist-2016-07-18.md
94
+ cat ~/notes/checklist-2016-07-18.md
95
+ > List of things I need to do
96
+ >
97
+ > * ......
98
+ > * ...
99
+ >
100
+ > Happy hacking
101
+ ```
102
+
85
103
  If you're kind of nerd and you have no life. You would rather work over the weekend than hanging out with folks, so you should enable the **hardcore** mode which will stop skipping weekend for you.
86
104
 
87
105
  ```sh
@@ -101,20 +119,21 @@ vim $(worque todo --for yesterday)
101
119
  cat $(worque todo --for=yesterday) | grep pending
102
120
  ```
103
121
 
104
- Personally I alias it like `today` like this, so vim will automatically open the
105
- file when I type `today`
122
+ Personally I like to create a shell function `today` like this, so vim will automatically open the file when I type `today`
106
123
 
107
124
  ```sh
108
- alias today="vim $(worque todo)"
109
- alias ytd="vim $(worque todo --for=yesterday)"
125
+ today () { vim $(worque todo); }
126
+ ytd () { vim $(worque todo --for=yesterday); }
110
127
  ```
111
128
 
112
129
  #### `worque push`
113
130
 
114
- Please remember to add `SLACK_API_TOKEN` in your `.bash_profile`
131
+ Please remember to add your [slack api token](https://api.slack.com/docs/oauth-test-tokens) to your `~/.worquerc`
115
132
 
116
- ```sh
117
- export SLACK_API_TOKEN=very-$3Cr3T
133
+ ```json
134
+ {
135
+ "token": "very-$3Cr3T"
136
+ }
118
137
  ```
119
138
 
120
139
  Then the note for today will be automatically posted to the channel specified.
@@ -15,6 +15,7 @@ module Worque
15
15
  method_option :skip_weekend, type: :boolean, default: true
16
16
  method_option :path, type: :string
17
17
  method_option :append_task, type: :string
18
+ method_option :template_path, type: :string
18
19
 
19
20
  def todo
20
21
  begin
@@ -20,6 +20,11 @@ module Worque
20
20
  Worque::Utils::Command.touch f
21
21
  end
22
22
 
23
+ if options.template_path && File.read(notes_file_path) == ""
24
+ template = File.read(File.expand_path(options.template_path))
25
+ Worque::Utils::Command.append_text(notes_file_path, template)
26
+ end
27
+
23
28
  if options.append_task
24
29
  Worque::Utils::Command.append_text(notes_file_path, options.append_task)
25
30
  end
@@ -8,12 +8,14 @@ module Worque
8
8
  attr_accessor :for
9
9
  attr_accessor :append_task
10
10
  attr_writer :skip_weekend
11
+ attr_reader :template_path
11
12
 
12
13
  def initialize(opts)
13
14
  @path = opts[:path]
14
15
  @skip_weekend = opts[:skip_weekend]
15
16
  @for = opts[:for]
16
17
  @append_task = opts[:append_task]
18
+ @template_path = opts.fetch(:template_path, nil)
17
19
  end
18
20
 
19
21
  def skip_weekend?
@@ -14,9 +14,9 @@ module Worque
14
14
  end
15
15
 
16
16
  def append_text(path, text)
17
- File.open(path, 'a') { |f|
17
+ File.open(path, 'a') do |f|
18
18
  f.puts "#{text}\n"
19
- }
19
+ end
20
20
  end
21
21
  end
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module Worque
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cam Huynh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-29 00:00:00.000000000 Z
11
+ date: 2017-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -102,7 +102,7 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - LICENSE.txt
105
+ - LICENSE
106
106
  - README.md
107
107
  - bin/console
108
108
  - bin/worque
@@ -117,7 +117,7 @@ files:
117
117
  - lib/worque/utils/command.rb
118
118
  - lib/worque/utils/slack.rb
119
119
  - lib/worque/version.rb
120
- homepage: https://github.com/huynhquancam/worque
120
+ homepage: https://github.com/qcam/worque
121
121
  licenses:
122
122
  - MIT
123
123
  metadata:
@@ -128,9 +128,9 @@ require_paths:
128
128
  - lib
129
129
  required_ruby_version: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ">="
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: '0'
133
+ version: '2.0'
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.6.6
141
+ rubygems_version: 2.5.2
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Manage your daily working list