ddate-redux 1.1.0 → 2.0.0
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 +4 -4
- data/bin/ddate +0 -2
- data/bin/ddate2rem +32 -0
- data/lib/ddate/cli.rb +2 -2
- data/lib/ddate/version.rb +4 -4
- metadata +5 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6010e869e50739305f3d4fabeaf99c0e933afbab
|
4
|
+
data.tar.gz: 0d72f1ebd0eff999c612e07db8b578f1a84044b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e874ed05c740e448480766b22787731b11176822e1f3948ee1759349c6f13a2713fb96959c5fa039096c24a79cad49adbdd07e625a1f2b024ffcddedbd8a463a
|
7
|
+
data.tar.gz: d69a84bafd951cd9c2a419d3eb54036feda35d2e466a162367428b1eb006f8ee447301200cc4a09e462bd6999b0a2df79df7128a13e8d23b847725da2533c5e9
|
data/bin/ddate
CHANGED
data/bin/ddate2rem
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Convert ddate into form for remind program
|
4
|
+
|
5
|
+
# Usage: ddate2rem START END
|
6
|
+
#
|
7
|
+
# START: start date in ISO8601 format
|
8
|
+
# END: end date in ISO8601 format
|
9
|
+
|
10
|
+
require 'ddate'
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
start_date = Date.parse(ARGV[0])
|
14
|
+
end_date = Date.parse(ARGV[1])
|
15
|
+
|
16
|
+
current_date = start_date
|
17
|
+
|
18
|
+
ddates = []
|
19
|
+
|
20
|
+
while (current_date <= end_date) do
|
21
|
+
dd = Ddate::Converter.new(current_date.year, current_date.month, current_date.day)
|
22
|
+
ddates.push("REM %s MSG %s %%" % [
|
23
|
+
current_date.strftime("%b %d %Y"),
|
24
|
+
dd.to_s
|
25
|
+
])
|
26
|
+
current_date = current_date + 1
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
ddates.each do |dd|
|
31
|
+
puts dd
|
32
|
+
end
|
data/lib/ddate/cli.rb
CHANGED
@@ -32,7 +32,7 @@ module Ddate
|
|
32
32
|
today = Date.today
|
33
33
|
year, month, day = today.year, today.month, today.day
|
34
34
|
when 3
|
35
|
-
|
35
|
+
year, month, day = args.map { |i| Integer(i) }
|
36
36
|
when 4
|
37
37
|
fmt = args.shift.to_s
|
38
38
|
if (self.formatter = fmt.match(FORMAT_RE) {|m| Ddate::Formatter.new($1)})
|
@@ -40,7 +40,7 @@ module Ddate
|
|
40
40
|
else
|
41
41
|
raise DdateException.new "first argument when 4 given must be a format"
|
42
42
|
end
|
43
|
-
|
43
|
+
year, month, day = args.map { |i| Integer(i) }
|
44
44
|
else
|
45
45
|
raise DdateException.new "wrong number of arguments"
|
46
46
|
end
|
data/lib/ddate/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
module Ddate
|
3
|
-
VERSION = '
|
3
|
+
VERSION = '2.0.0'
|
4
4
|
|
5
5
|
AUTHORS = ['Tamara Temple']
|
6
6
|
EMAILS = ['tamouse@gmail.com']
|
@@ -10,7 +10,7 @@ module Ddate
|
|
10
10
|
PACKAGE = 'ddate-redux'
|
11
11
|
PROGNAME = File.basename($0)
|
12
12
|
VERSION_STRING = "#{PROGNAME}: #{PACKAGE} #{VERSION}"
|
13
|
-
USAGE = "Usage: #{PROGNAME} [ -h | -v ] [+format] [
|
13
|
+
USAGE = "Usage: #{PROGNAME} [ -h | -v ] [+format] [year month day]"
|
14
14
|
FORMATTER_USAGE = %q[
|
15
15
|
|
16
16
|
Format strings work just like the old ddate(1) program:
|
@@ -60,11 +60,11 @@ Examples:
|
|
60
60
|
% ddate +’Today is %{%A, the %e of %B%}, %Y. %N%nCelebrate %H’
|
61
61
|
Today is Sweetmorn, the 42nd of Bureaucracy, 3161.
|
62
62
|
|
63
|
-
% ddate +"It’s %{%A, the %e of %B%}, %Y. %N%nCelebrate %H"
|
63
|
+
% ddate +"It’s %{%A, the %e of %B%}, %Y. %N%nCelebrate %H" 1995 9 26
|
64
64
|
It’s Prickle-Prickle, the 50th of Bureaucracy, 3161.
|
65
65
|
Celebrate Bureflux
|
66
66
|
|
67
|
-
% ddate +"Today’s %{%A, the %e of %B%}, %Y. %N%nCelebrate %H"
|
67
|
+
% ddate +"Today’s %{%A, the %e of %B%}, %Y. %N%nCelebrate %H" 1996 2 29
|
68
68
|
Today’s St. Tib’s Day, 3162.
|
69
69
|
|
70
70
|
]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddate-redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tamara Temple
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -99,18 +99,19 @@ email:
|
|
99
99
|
- tamouse@gmail.com
|
100
100
|
executables:
|
101
101
|
- ddate
|
102
|
+
- ddate2rem
|
102
103
|
extensions: []
|
103
104
|
extra_rdoc_files: []
|
104
105
|
files:
|
105
106
|
- ".gitignore"
|
106
107
|
- ".rspec"
|
107
|
-
- ".ruby-version"
|
108
108
|
- Gemfile
|
109
109
|
- Guardfile
|
110
110
|
- LICENSE.txt
|
111
111
|
- README.md
|
112
112
|
- Rakefile
|
113
113
|
- bin/ddate
|
114
|
+
- bin/ddate2rem
|
114
115
|
- ddate.gemspec
|
115
116
|
- lib/ddate.rb
|
116
117
|
- lib/ddate/cli.rb
|
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
143
|
version: '0'
|
143
144
|
requirements: []
|
144
145
|
rubyforge_project:
|
145
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.5.1
|
146
147
|
signing_key:
|
147
148
|
specification_version: 4
|
148
149
|
summary: discordian date, in ruby
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-2.1.1
|