wlog 1.1.7 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +100 -39
- data/lib/wlog/commands/bootstrap_templates.rb +5 -0
- data/lib/wlog/commands/delete_attachment.rb +17 -0
- data/lib/wlog/commands/fetch_git_commits.rb +45 -0
- data/lib/wlog/commands/fetch_git_commits_standard.rb +29 -0
- data/lib/wlog/commands/innit_db.rb +3 -2
- data/lib/wlog/commands/write_template.rb +22 -0
- data/lib/wlog/domain/attachment.rb +26 -54
- data/lib/wlog/domain/git_commit.rb +11 -0
- data/lib/wlog/domain/issue.rb +14 -1
- data/lib/wlog/domain/key_value.rb +1 -1
- data/lib/wlog/domain/template_helper.rb +21 -0
- data/lib/wlog/migrations/fix_attachments_polymorphic_table.rb +15 -0
- data/lib/wlog/migrations/make_standard_tables.rb +0 -13
- data/lib/wlog/tech/git_commit_parser.rb +48 -0
- data/lib/wlog/tech/git_commit_printer.rb +19 -0
- data/lib/wlog/tech/uncolored_string.rb +1 -1
- data/lib/wlog/ui/bootstrap.rb +1 -0
- data/lib/wlog/ui/cli_interface.rb +2 -58
- data/lib/wlog/ui/edit_handler.rb +7 -0
- data/lib/wlog/ui/git_ui.rb +47 -0
- data/lib/wlog/ui/invoice_ui.rb +53 -36
- data/lib/wlog/ui/issue_ui.rb +57 -5
- data/lib/wlog/ui/template_ui.rb +2 -2
- data/lib/wlog/version.rb +1 -1
- data/spec/domain/attachment_spec.rb +49 -55
- data/spec/domain/commands/concat_desc_spec.rb +1 -0
- data/spec/domain/commands/new_entry_spec.rb +1 -0
- data/spec/domain/commands/replace_pattern_spec.rb +1 -0
- data/spec/domain/git_commits_spec.rb +85 -0
- data/spec/domain/invoice_spec.rb +35 -0
- data/spec/domain/issue_spec.rb +1 -0
- data/spec/domain/key_value_spec.rb +1 -0
- data/spec/domain/log_entry_spec.rb +1 -0
- data/spec/domain/sys_config_spec.rb +1 -0
- data/spec/spec_helper.rb +31 -0
- data/wlog.gemspec +3 -1
- metadata +40 -18
- data/lib/wlog/domain/session.rb +0 -17
- data/lib/wlog/domain/sql_modules/polymorphic_attachments_sql.rb +0 -24
- data/lib/wlog/domain/template_engine.rb +0 -55
- data/lib/wlog/sql/mono/1.sql +0 -50
- data/lib/wlog/sql/seq/.gitkeep +0 -0
- data/lib/wlog/sql/seq/2.sql +0 -4
- data/lib/wlog/sql/seq/3.sql +0 -3
- data/lib/wlog/ui/commands/ui_command.rb +0 -9
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- psyomn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,33 +67,47 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: coveralls
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
76
|
-
type: :
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: redcarpet
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: sqlite3
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - '>='
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 1.3.7
|
90
104
|
type: :runtime
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - '>='
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 1.3.7
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: activerecord
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,38 +144,40 @@ files:
|
|
130
144
|
- lib/wlog/commands/commandable.rb
|
131
145
|
- lib/wlog/commands/concat_description.rb
|
132
146
|
- lib/wlog/commands/create_issue.rb
|
147
|
+
- lib/wlog/commands/delete_attachment.rb
|
133
148
|
- lib/wlog/commands/delete_issue.rb
|
149
|
+
- lib/wlog/commands/fetch_git_commits.rb
|
150
|
+
- lib/wlog/commands/fetch_git_commits_standard.rb
|
134
151
|
- lib/wlog/commands/innit_db.rb
|
135
152
|
- lib/wlog/commands/make_csv.rb
|
136
153
|
- lib/wlog/commands/new_entry.rb
|
137
154
|
- lib/wlog/commands/replace_pattern.rb
|
138
155
|
- lib/wlog/commands/taint_setup.rb
|
156
|
+
- lib/wlog/commands/write_template.rb
|
139
157
|
- lib/wlog/domain.rb
|
140
158
|
- lib/wlog/domain/attachment.rb
|
159
|
+
- lib/wlog/domain/git_commit.rb
|
141
160
|
- lib/wlog/domain/helpers.rb
|
142
161
|
- lib/wlog/domain/invoice.rb
|
143
162
|
- lib/wlog/domain/issue.rb
|
144
163
|
- lib/wlog/domain/key_value.rb
|
145
164
|
- lib/wlog/domain/log_entry.rb
|
146
|
-
- lib/wlog/domain/session.rb
|
147
|
-
- lib/wlog/domain/sql_modules/polymorphic_attachments_sql.rb
|
148
165
|
- lib/wlog/domain/static_configurations.rb
|
149
166
|
- lib/wlog/domain/sys_config.rb
|
150
|
-
- lib/wlog/domain/
|
167
|
+
- lib/wlog/domain/template_helper.rb
|
151
168
|
- lib/wlog/domain/timelog_helper.rb
|
169
|
+
- lib/wlog/migrations/fix_attachments_polymorphic_table.rb
|
152
170
|
- lib/wlog/migrations/make_standard_tables.rb
|
153
|
-
- lib/wlog/sql/mono/1.sql
|
154
|
-
- lib/wlog/sql/seq/.gitkeep
|
155
|
-
- lib/wlog/sql/seq/2.sql
|
156
|
-
- lib/wlog/sql/seq/3.sql
|
157
171
|
- lib/wlog/tech/ansi_colors.rb
|
172
|
+
- lib/wlog/tech/git_commit_parser.rb
|
173
|
+
- lib/wlog/tech/git_commit_printer.rb
|
158
174
|
- lib/wlog/tech/uncolored_string.rb
|
159
175
|
- lib/wlog/tech/wlog_string.rb
|
160
176
|
- lib/wlog/ui/bootstrap.rb
|
161
177
|
- lib/wlog/ui/cli_interface.rb
|
162
|
-
- lib/wlog/ui/commands/ui_command.rb
|
163
178
|
- lib/wlog/ui/configuration_ui.rb
|
164
179
|
- lib/wlog/ui/edit_handler.rb
|
180
|
+
- lib/wlog/ui/git_ui.rb
|
165
181
|
- lib/wlog/ui/invoice_ui.rb
|
166
182
|
- lib/wlog/ui/issue_ui.rb
|
167
183
|
- lib/wlog/ui/setup_wizard.rb
|
@@ -171,6 +187,8 @@ files:
|
|
171
187
|
- spec/domain/commands/concat_desc_spec.rb
|
172
188
|
- spec/domain/commands/new_entry_spec.rb
|
173
189
|
- spec/domain/commands/replace_pattern_spec.rb
|
190
|
+
- spec/domain/git_commits_spec.rb
|
191
|
+
- spec/domain/invoice_spec.rb
|
174
192
|
- spec/domain/issue_spec.rb
|
175
193
|
- spec/domain/key_value_spec.rb
|
176
194
|
- spec/domain/log_entry_spec.rb
|
@@ -178,6 +196,7 @@ files:
|
|
178
196
|
- spec/make_db.rb
|
179
197
|
- spec/old-databases/README.md
|
180
198
|
- spec/old-databases/default
|
199
|
+
- spec/spec_helper.rb
|
181
200
|
- spec/tech/uncolored_string.rb
|
182
201
|
- spec/tech/wlog_string_spec.rb
|
183
202
|
- wlog.gemspec
|
@@ -204,12 +223,14 @@ rubyforge_project:
|
|
204
223
|
rubygems_version: 2.0.14
|
205
224
|
signing_key:
|
206
225
|
specification_version: 4
|
207
|
-
summary: 'A light ruby script to help track tasks and time commit:
|
226
|
+
summary: 'A light ruby script to help track tasks and time commit: 83fbf5f'
|
208
227
|
test_files:
|
209
228
|
- spec/domain/attachment_spec.rb
|
210
229
|
- spec/domain/commands/concat_desc_spec.rb
|
211
230
|
- spec/domain/commands/new_entry_spec.rb
|
212
231
|
- spec/domain/commands/replace_pattern_spec.rb
|
232
|
+
- spec/domain/git_commits_spec.rb
|
233
|
+
- spec/domain/invoice_spec.rb
|
213
234
|
- spec/domain/issue_spec.rb
|
214
235
|
- spec/domain/key_value_spec.rb
|
215
236
|
- spec/domain/log_entry_spec.rb
|
@@ -217,6 +238,7 @@ test_files:
|
|
217
238
|
- spec/make_db.rb
|
218
239
|
- spec/old-databases/README.md
|
219
240
|
- spec/old-databases/default
|
241
|
+
- spec/spec_helper.rb
|
220
242
|
- spec/tech/uncolored_string.rb
|
221
243
|
- spec/tech/wlog_string_spec.rb
|
222
244
|
has_rdoc:
|
data/lib/wlog/domain/session.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module Wlog
|
2
|
-
# This is the session that contains data about a particular run (for example
|
3
|
-
# what kind of database to use, etc). NOTE: this is a placeholder for now.
|
4
|
-
# Eventually this should be the object passed on sessions (for example, the
|
5
|
-
# active records should get the session object, and extract what they need from
|
6
|
-
# it - the db reference).
|
7
|
-
# @author Simon Symeonidis
|
8
|
-
class Session
|
9
|
-
|
10
|
-
def initialize(dbhandle)
|
11
|
-
@db = dbhandle
|
12
|
-
end
|
13
|
-
|
14
|
-
attr_accessor :db
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Wlog
|
2
|
-
# Sql for polymorphic attachments
|
3
|
-
# @author Simon Symeonidis
|
4
|
-
module PolymorphicAttachmentsSql
|
5
|
-
|
6
|
-
# The table name
|
7
|
-
TableName = "polymorphic_attachments"
|
8
|
-
|
9
|
-
# Select entries by discriminator name, and id
|
10
|
-
SelectSql = "SELECT * FROM #{TableName} WHERE "\
|
11
|
-
"discriminator = ? AND discriminator_id = ? "
|
12
|
-
|
13
|
-
# Insert an attachment given the current thing in hand
|
14
|
-
InsertSql = "INSERT INTO #{TableName} "\
|
15
|
-
"(discriminator, discriminator_id, attachment_id) values "\
|
16
|
-
"(? , ? , ?)"
|
17
|
-
|
18
|
-
# Delete an attachment from the attached thing
|
19
|
-
DeleteSql = "DELETE FROM #{TableName} WHERE "\
|
20
|
-
"discriminator = ? AND discriminator_id = ?"
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
@@ -1,55 +0,0 @@
|
|
1
|
-
module Wlog
|
2
|
-
# A very simple templating engine that supports generating text files in order
|
3
|
-
# for them to be, in turn parsed by some other tool in order to generate nice
|
4
|
-
# invoices. The 'other' tool I have in mind is pandoc; this somewhat defeats
|
5
|
-
# the purpose of 'lightweight' in the sense that we indirectly need that tool,
|
6
|
-
# but on the other hand writing a more complex templating engine might prove
|
7
|
-
# too costly for now.
|
8
|
-
#
|
9
|
-
# @author Simon Symeonidis
|
10
|
-
class TemplateEngine
|
11
|
-
|
12
|
-
# These can either be atomic elements, or arrays of two. In the former, they
|
13
|
-
# just join entries by adding the separator. The latter makes the two a
|
14
|
-
# prefix, and postfix.
|
15
|
-
# @param issue_sep is what to separate issues with
|
16
|
-
# @param log_entry_sep is what to separate log entries with
|
17
|
-
def initialize(issue_sep, log_entry_sep, issues, invoice_id)
|
18
|
-
@issue_sep, @log_entry_sep, @issues, @invoice_id = \
|
19
|
-
issue_sep, log_entry_sep, issues, invoice_id
|
20
|
-
end
|
21
|
-
|
22
|
-
def generate(filename)
|
23
|
-
contents = File.open(filename).read
|
24
|
-
contens.gsub(InvoiceId, @invoice_id)
|
25
|
-
end
|
26
|
-
|
27
|
-
# What to separate issues with
|
28
|
-
attr_accessor :issue_sep
|
29
|
-
|
30
|
-
# What to separate log entries with
|
31
|
-
attr_accessor :log_entry_sep
|
32
|
-
|
33
|
-
# An issue list
|
34
|
-
attr_accessor :issues
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
# The tag to look for in order to add the issue info
|
39
|
-
IssueTag = '<issue-sep>'
|
40
|
-
|
41
|
-
# The log entry tag to add the log entries
|
42
|
-
LogEntrySep = '<log-entry-sep>'
|
43
|
-
|
44
|
-
InvoiceId = '<id>'
|
45
|
-
|
46
|
-
DateFrom = '<date-from>'
|
47
|
-
|
48
|
-
DateTo = '<date-to>'
|
49
|
-
|
50
|
-
StartSegment = '[segment]'
|
51
|
-
EndSegment = '[/segment]'
|
52
|
-
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
data/lib/wlog/sql/mono/1.sql
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
--$ Migration to turntables. This is the initial configuration of the database
|
2
|
-
--$ for this application.
|
3
|
-
|
4
|
-
-- author: Simon Symeonidis
|
5
|
-
--
|
6
|
-
-- Please follow plurals like this:
|
7
|
-
-- class Issue -> issues;
|
8
|
-
-- class Person -> people;
|
9
|
-
--
|
10
|
-
|
11
|
-
-- An issue has many log entries
|
12
|
-
CREATE TABLE issues (
|
13
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
14
|
-
description TEXT,
|
15
|
-
reported_date INTEGER,
|
16
|
-
due_date INTEGER,
|
17
|
-
status INTEGER
|
18
|
-
);
|
19
|
-
|
20
|
-
-- Where to store the log entries.
|
21
|
-
CREATE TABLE log_entries (
|
22
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
23
|
-
description TEXT,
|
24
|
-
date DATETIME,
|
25
|
-
issue_id INTEGER
|
26
|
-
);
|
27
|
-
|
28
|
-
-- We can add attachments to stuff.
|
29
|
-
CREATE TABLE attachments (
|
30
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
31
|
-
filename TEXT,
|
32
|
-
given_name TEXT,
|
33
|
-
data BLOB
|
34
|
-
);
|
35
|
-
|
36
|
-
-- Create the key value table
|
37
|
-
CREATE TABLE key_values (
|
38
|
-
key TEXT,
|
39
|
-
value TEXT
|
40
|
-
);
|
41
|
-
|
42
|
-
-- A polymorphic relationship for attachments. So pretty much anything that
|
43
|
-
-- wants to have something attached, uses the discriminator in order to
|
44
|
-
-- specify itself, as well as its id.
|
45
|
-
CREATE TABLE polymorphic_attachments (
|
46
|
-
discriminator TEXT,
|
47
|
-
discriminator_id INTEGER,
|
48
|
-
attachment_id INTEGER
|
49
|
-
);
|
50
|
-
|
data/lib/wlog/sql/seq/.gitkeep
DELETED
File without changes
|
data/lib/wlog/sql/seq/2.sql
DELETED
data/lib/wlog/sql/seq/3.sql
DELETED