sifttter-redux 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +58 -18
- data/bin/srd +3 -3
- data/lib/sifttter-redux/constants.rb +1 -1
- data/lib/sifttter-redux/sifttter.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59e71f8476272d582e3ece798a23f42c60595e68
|
4
|
+
data.tar.gz: b7b746fdc048acee90bb2902f4a0c559c6eaf8df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40b87a62aba139e09d778f2d5f93b97b3eb79925accf45c12e861dc46ce1cb41870194074ebba1b8d945011c99618eb3f05de1317fbff463549938fef33c0853
|
7
|
+
data.tar.gz: 5510997199d38138920a50eb32fc2b0536c96addcd2bbb33f9e34c39c13dbbe8d63bac3bad5553e43e6d8793850e9c622b0f040986d8dd6a311da2d7af08f005
|
data/README.md
CHANGED
@@ -5,23 +5,7 @@ Sifttter Redux
|
|
5
5
|
|
6
6
|
# Upgrading From 0.x.x to 1.0.0?
|
7
7
|
|
8
|
-
|
9
|
-
version 1.0.0, Sifttter files need to follow this format:
|
10
|
-
|
11
|
-
```
|
12
|
-
@begin
|
13
|
-
@date April 21, 2014
|
14
|
-
**Any** sort of *Markdown* goes here...
|
15
|
-
@end
|
16
|
-
```
|
17
|
-
|
18
|
-
Note that a new command has been introduced that attempts to upgrade to this
|
19
|
-
new format. **Although the command backs up your current Sifttter files, you
|
20
|
-
are strongly encouraged to make a separate, manual backup.**
|
21
|
-
|
22
|
-
```Bash
|
23
|
-
$ srd upgrade
|
24
|
-
```
|
8
|
+
Make sure you read the [IFTTT Template](#ifttt-template) section.
|
25
9
|
|
26
10
|
# Intro
|
27
11
|
|
@@ -65,7 +49,7 @@ SYNOPSIS
|
|
65
49
|
srd [global options] command [command options] [arguments...]
|
66
50
|
|
67
51
|
VERSION
|
68
|
-
|
52
|
+
1.0.5
|
69
53
|
|
70
54
|
GLOBAL OPTIONS
|
71
55
|
--help - Show this message
|
@@ -100,6 +84,46 @@ COMMAND OPTIONS
|
|
100
84
|
-y - Run catch-up mode for yesterday
|
101
85
|
```
|
102
86
|
|
87
|
+
## IFTTT Template
|
88
|
+
|
89
|
+
Version 1.0.0+ uses a new schema that allows for any type of Markdown. Thus, Sifttter
|
90
|
+
files from IFTTT need to follow this format:
|
91
|
+
|
92
|
+
```
|
93
|
+
@begin
|
94
|
+
@date April 21, 2014 at 12:34PM
|
95
|
+
**Any** sort of *Markdown* goes here...
|
96
|
+
@end
|
97
|
+
```
|
98
|
+
|
99
|
+
Whereas the previous Sifttter Redux only allowed output of bulleted lists, this new
|
100
|
+
template style allows you to include *any* Markdown, making output like tables possibe.
|
101
|
+
|
102
|
+
### Upgrade Command
|
103
|
+
|
104
|
+
Note that a new command has been introduced that attempts to upgrade to this
|
105
|
+
new format. **Although the command backs up your current Sifttter files, you
|
106
|
+
are strongly encouraged to make a separate, manual backup.**
|
107
|
+
|
108
|
+
```Bash
|
109
|
+
$ srd upgrade
|
110
|
+
```
|
111
|
+
|
112
|
+
### Template Tokens
|
113
|
+
|
114
|
+
IFTTT templates can make use of the following tokens:
|
115
|
+
|
116
|
+
* `%time%`: the time the entry was created
|
117
|
+
|
118
|
+
As an example, to include the entry time in a template:
|
119
|
+
|
120
|
+
```
|
121
|
+
@begin
|
122
|
+
@date April 21, 2014 at 12:34PM
|
123
|
+
- %time%: My text goes here...
|
124
|
+
@end
|
125
|
+
```
|
126
|
+
|
103
127
|
## Initialization
|
104
128
|
|
105
129
|
```
|
@@ -177,6 +201,22 @@ $ srd exec -y
|
|
177
201
|
#### EXECUTION COMPLETE!
|
178
202
|
```
|
179
203
|
|
204
|
+
### Catch-up for a Specific Date
|
205
|
+
|
206
|
+
To create an entry for specific date:
|
207
|
+
|
208
|
+
```
|
209
|
+
$ srd exec -d 2014-02-14
|
210
|
+
#### EXECUTING...
|
211
|
+
---> INFO: Creating entry for February 14, 2014...
|
212
|
+
---> INFO: Downloading Sifttter files...DONE.
|
213
|
+
---> SUCCESS: Entry logged for February 14, 2014...
|
214
|
+
---> INFO: Uploading Day One entries to Dropbox...DONE.
|
215
|
+
---> INFO: Removing downloaded Day One files...DONE.
|
216
|
+
---> INFO: Removing downloaded Sifttter files...DONE.
|
217
|
+
#### EXECUTION COMPLETE!
|
218
|
+
```
|
219
|
+
|
180
220
|
### Last "N" Days Catch-up
|
181
221
|
|
182
222
|
Sifttter Redux allows you to specify the number of days back it should look for
|
data/bin/srd
CHANGED
@@ -90,9 +90,9 @@ post do |global,command,options,args|
|
|
90
90
|
end
|
91
91
|
|
92
92
|
on_error do |exception|
|
93
|
-
|
94
|
-
|
95
|
-
|
93
|
+
messenger.error(exception.to_s)
|
94
|
+
exit!(1)
|
95
|
+
true
|
96
96
|
end
|
97
97
|
|
98
98
|
# ======================================================
|
@@ -49,9 +49,9 @@ module SifttterRedux
|
|
49
49
|
def parse_sifttter_file(filepath, date)
|
50
50
|
title = File.basename(filepath).gsub(/^.*?\/([^\/]+)$/, "\\1") + "\n"
|
51
51
|
|
52
|
-
date_regex =
|
53
|
-
time_regex =
|
54
|
-
entry_regex = /@begin\n@date\s#{ date_regex }(?: at (#{ time_regex }?)\n)?(.*?)@end/m
|
52
|
+
date_regex = /(?:#{ date.strftime("%B") } 0?#{ date.strftime("%-d") }, #{ date.strftime("%Y") })/
|
53
|
+
time_regex = /(?:\d{1,2}:\d{1,2}\s?[AaPpMm]{2})/
|
54
|
+
entry_regex = /@begin\n@date\s#{ date_regex }(?: at (#{ time_regex }?)\n)?(.*?)\n@end/m
|
55
55
|
|
56
56
|
contents = File.read(filepath)
|
57
57
|
cur_entries = contents.scan(entry_regex)
|
@@ -96,7 +96,7 @@ module SifttterRedux
|
|
96
96
|
@entries.each do |key, value|
|
97
97
|
coder = HTMLEntities.new
|
98
98
|
entrytext += '### ' + key.gsub(/.txt/, '').gsub(/_/, ' ').upcase + "\n\n"
|
99
|
-
value.each { |v| entrytext += "#{ coder.encode(v[1]) }\n" }
|
99
|
+
value.each { |v| entrytext += "#{ coder.encode(v[1].gsub(/%time%/, v[0])) }\n" }
|
100
100
|
entrytext += "\n"
|
101
101
|
end
|
102
102
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sifttter-redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Bach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|