wlog 1.0.0 → 1.0.5
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/.rspec +1 -0
- data/README.md +57 -9
- data/Rakefile +24 -0
- data/bin/wlog +10 -0
- data/lib/wlog/commands/archive_finished_issues.rb +20 -0
- data/lib/wlog/commands/archive_issues.rb +22 -0
- data/lib/wlog/commands/concat_description.rb +8 -2
- data/lib/wlog/commands/delete_issue.rb +31 -0
- data/lib/wlog/commands/innit_db.rb +0 -2
- data/lib/wlog/commands/make_csv.rb +7 -1
- data/lib/wlog/commands/new_entry.rb +7 -2
- data/lib/wlog/commands/replace_pattern.rb +4 -6
- data/lib/wlog/commands/taint_setup.rb +18 -0
- data/lib/wlog/db_registry.rb +3 -5
- data/lib/wlog/domain.rb +13 -0
- data/lib/wlog/domain/attachment.rb +25 -17
- data/lib/wlog/domain/helpers.rb +4 -0
- data/lib/wlog/domain/issue.rb +77 -23
- data/lib/wlog/domain/key_value.rb +21 -17
- data/lib/wlog/domain/log_entry.rb +35 -21
- data/lib/wlog/domain/session.rb +17 -0
- data/lib/wlog/domain/sql_modules/issue_sql.rb +13 -5
- data/lib/wlog/domain/static_configurations.rb +9 -0
- data/lib/wlog/domain/sys_config.rb +76 -6
- data/lib/wlog/domain/template_engine.rb +55 -0
- data/lib/wlog/domain/timelog_helper.rb +53 -0
- data/lib/wlog/sql/seq/2.sql +4 -0
- data/lib/wlog/{domain → tech}/ansi_colors.rb +7 -6
- data/lib/wlog/tech/uncolored_string.rb +14 -0
- data/lib/wlog/tech/wlog_string.rb +23 -0
- data/lib/wlog/ui/bootstrap.rb +18 -0
- data/lib/wlog/ui/cli_interface.rb +94 -34
- data/lib/wlog/ui/commands/create_issue.rb +8 -4
- data/lib/wlog/ui/issue_ui.rb +47 -41
- data/lib/wlog/ui/setup_wizard.rb +34 -0
- data/lib/wlog/version.rb +1 -1
- data/spec/domain/attachment_spec.rb +59 -0
- data/spec/domain/commands/concat_desc_spec.rb +51 -0
- data/spec/domain/commands/new_entry_spec.rb +41 -0
- data/spec/domain/commands/replace_pattern_spec.rb +46 -0
- data/spec/domain/issue_spec.rb +127 -0
- data/spec/domain/key_value_spec.rb +42 -0
- data/spec/domain/log_entry_spec.rb +85 -0
- data/spec/domain/sys_config_spec.rb +38 -0
- data/spec/make_db.rb +8 -0
- data/spec/old-databases/README.md +6 -0
- data/spec/old-databases/default +0 -0
- data/spec/tech/uncolored_string.rb +20 -0
- data/spec/tech/wlog_string_spec.rb +46 -0
- data/wlog.gemspec +5 -3
- metadata +44 -6
- data/spec/key_vale_spec.rb +0 -9
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative '../make_db'
|
2
|
+
require 'wlog/db_registry'
|
3
|
+
require 'wlog/domain/sys_config'
|
4
|
+
|
5
|
+
require 'turntables/turntable'
|
6
|
+
|
7
|
+
include Wlog
|
8
|
+
|
9
|
+
describe SysConfig do
|
10
|
+
|
11
|
+
db_name = "./default"
|
12
|
+
|
13
|
+
before(:all) do
|
14
|
+
make_testing_db(db_name)
|
15
|
+
@db = DbRegistry.new(db_name)
|
16
|
+
@sys = SysConfig.new(@db)
|
17
|
+
end
|
18
|
+
|
19
|
+
after(:all) do
|
20
|
+
FileUtils.rm db_name
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should store last focus" do
|
24
|
+
@sys.last_focus = "something_there"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should load last focus" do
|
28
|
+
expect(@sys.last_focus).to eq("something_there")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should store once, and on next store overwrite last focus" do
|
32
|
+
@sys.last_focus = "something_now"
|
33
|
+
@sys.last_focus = "something_then"
|
34
|
+
expect(@sys.last_focus).to eq("something_then")
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
end
|
data/spec/make_db.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# make the testing database in the relative path
|
2
|
+
def make_testing_db(dbname)
|
3
|
+
current_dir = "#{File.expand_path File.dirname(__FILE__)}/../lib/wlog/sql"
|
4
|
+
turntable = Turntables::Turntable.new
|
5
|
+
turntable.register(current_dir)
|
6
|
+
turntable.make_at!(dbname)
|
7
|
+
end
|
8
|
+
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'wlog/tech/uncolored_string'
|
2
|
+
|
3
|
+
include Wlog
|
4
|
+
|
5
|
+
describe UncoloredString do
|
6
|
+
|
7
|
+
ucs = UncoloredString
|
8
|
+
|
9
|
+
it "should not color anything" do
|
10
|
+
expect(ucs.red("a")).to eq("a")
|
11
|
+
expect(ucs.yellow("a")).to eq("a")
|
12
|
+
expect(ucs.magenta("a")).to eq("a")
|
13
|
+
expect(ucs.green("a")).to eq("a")
|
14
|
+
expect(ucs.blue("a")).to eq("a")
|
15
|
+
expect(ucs.white("a")).to eq("a")
|
16
|
+
expect(ucs.black("a")).to eq("a")
|
17
|
+
expect(ucs.cyan("a")).to eq("a")
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'wlog/tech/wlog_string'
|
2
|
+
require 'wlog/tech/ansi_colors'
|
3
|
+
|
4
|
+
include Wlog
|
5
|
+
include AnsiColors
|
6
|
+
|
7
|
+
describe WlogString do
|
8
|
+
before(:all) do
|
9
|
+
@str = WlogString
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should write in red' do
|
13
|
+
@str.red('').should match(/^\x1b\[#{Red}/)
|
14
|
+
@str.red('').should match(/\x1b\[0m$/)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should write in green' do
|
18
|
+
@str.green('').should match(/^\x1b\[#{Green}/)
|
19
|
+
@str.green('').should match(/\x1b\[0m$/)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should write in blue' do
|
23
|
+
@str.blue('').should match(/^\x1b\[#{Blue}/)
|
24
|
+
@str.blue('').should match(/\x1b\[0m$/)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should write in yellow' do
|
28
|
+
@str.yellow('').should match(/^\x1b\[#{Yellow}/)
|
29
|
+
@str.yellow('').should match(/\x1b\[0m$/)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should write in white' do
|
33
|
+
@str.white('').should match(/^\x1b\[#{White}/)
|
34
|
+
@str.white('').should match(/\x1b\[0m$/)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should write in cyan' do
|
38
|
+
@str.cyan('').should match(/^\x1b\[#{Cyan}/)
|
39
|
+
@str.cyan('').should match(/\x1b\[0m$/)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should write in magenta' do
|
43
|
+
@str.magenta('').should match(/^\x1b\[#{Magenta}/)
|
44
|
+
@str.magenta('').should match(/\x1b\[0m$/)
|
45
|
+
end
|
46
|
+
end
|
data/wlog.gemspec
CHANGED
@@ -9,9 +9,11 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["psyomn"]
|
10
10
|
spec.email = ["lethaljellybean@gmail.com"]
|
11
11
|
spec.description = %q{Track tasks and time on the command line.}
|
12
|
-
spec.summary =
|
13
|
-
|
14
|
-
|
12
|
+
spec.summary = \
|
13
|
+
"A light ruby script to help track tasks and time"\
|
14
|
+
"#{$/}#{$/}"\
|
15
|
+
"commit: #{`git log -n1 | head -1 | awk '{print $2}' | cut -b 1-7`}"
|
16
|
+
|
15
17
|
spec.homepage = "http://github.com/psyomn/wlog"
|
16
18
|
spec.license = "GPL v3.0"
|
17
19
|
|
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.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- psyomn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,24 +89,30 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- .gitignore
|
92
|
+
- .rspec
|
92
93
|
- Gemfile
|
93
94
|
- README.md
|
94
95
|
- Rakefile
|
95
96
|
- bin/wlog
|
96
97
|
- lib/wlog.rb
|
98
|
+
- lib/wlog/commands/archive_finished_issues.rb
|
99
|
+
- lib/wlog/commands/archive_issues.rb
|
97
100
|
- lib/wlog/commands/commandable.rb
|
98
101
|
- lib/wlog/commands/concat_description.rb
|
102
|
+
- lib/wlog/commands/delete_issue.rb
|
99
103
|
- lib/wlog/commands/innit_db.rb
|
100
104
|
- lib/wlog/commands/make_csv.rb
|
101
105
|
- lib/wlog/commands/new_entry.rb
|
102
106
|
- lib/wlog/commands/replace_pattern.rb
|
107
|
+
- lib/wlog/commands/taint_setup.rb
|
103
108
|
- lib/wlog/db_registry.rb
|
104
|
-
- lib/wlog/domain
|
109
|
+
- lib/wlog/domain.rb
|
105
110
|
- lib/wlog/domain/attachment.rb
|
106
111
|
- lib/wlog/domain/helpers.rb
|
107
112
|
- lib/wlog/domain/issue.rb
|
108
113
|
- lib/wlog/domain/key_value.rb
|
109
114
|
- lib/wlog/domain/log_entry.rb
|
115
|
+
- lib/wlog/domain/session.rb
|
110
116
|
- lib/wlog/domain/sql_modules/attachment_sql.rb
|
111
117
|
- lib/wlog/domain/sql_modules/issue_sql.rb
|
112
118
|
- lib/wlog/domain/sql_modules/key_value_sql.rb
|
@@ -114,16 +120,36 @@ files:
|
|
114
120
|
- lib/wlog/domain/sql_modules/polymorphic_attachments_sql.rb
|
115
121
|
- lib/wlog/domain/static_configurations.rb
|
116
122
|
- lib/wlog/domain/sys_config.rb
|
123
|
+
- lib/wlog/domain/template_engine.rb
|
124
|
+
- lib/wlog/domain/timelog_helper.rb
|
117
125
|
- lib/wlog/sql/mono/1.sql
|
118
126
|
- lib/wlog/sql/seq/.gitkeep
|
127
|
+
- lib/wlog/sql/seq/2.sql
|
128
|
+
- lib/wlog/tech/ansi_colors.rb
|
129
|
+
- lib/wlog/tech/uncolored_string.rb
|
130
|
+
- lib/wlog/tech/wlog_string.rb
|
131
|
+
- lib/wlog/ui/bootstrap.rb
|
119
132
|
- lib/wlog/ui/cli_interface.rb
|
120
133
|
- lib/wlog/ui/commands/attach_to_issue.rb
|
121
134
|
- lib/wlog/ui/commands/attach_to_log_entry.rb
|
122
135
|
- lib/wlog/ui/commands/create_issue.rb
|
123
136
|
- lib/wlog/ui/commands/ui_command.rb
|
124
137
|
- lib/wlog/ui/issue_ui.rb
|
138
|
+
- lib/wlog/ui/setup_wizard.rb
|
125
139
|
- lib/wlog/version.rb
|
126
|
-
- spec/
|
140
|
+
- spec/domain/attachment_spec.rb
|
141
|
+
- spec/domain/commands/concat_desc_spec.rb
|
142
|
+
- spec/domain/commands/new_entry_spec.rb
|
143
|
+
- spec/domain/commands/replace_pattern_spec.rb
|
144
|
+
- spec/domain/issue_spec.rb
|
145
|
+
- spec/domain/key_value_spec.rb
|
146
|
+
- spec/domain/log_entry_spec.rb
|
147
|
+
- spec/domain/sys_config_spec.rb
|
148
|
+
- spec/make_db.rb
|
149
|
+
- spec/old-databases/README.md
|
150
|
+
- spec/old-databases/default
|
151
|
+
- spec/tech/uncolored_string.rb
|
152
|
+
- spec/tech/wlog_string_spec.rb
|
127
153
|
- wlog.gemspec
|
128
154
|
homepage: http://github.com/psyomn/wlog
|
129
155
|
licenses:
|
@@ -148,7 +174,19 @@ rubyforge_project:
|
|
148
174
|
rubygems_version: 2.0.3
|
149
175
|
signing_key:
|
150
176
|
specification_version: 4
|
151
|
-
summary: 'A light ruby script to help track tasks and time commit:
|
177
|
+
summary: 'A light ruby script to help track tasks and time commit: 02d901e'
|
152
178
|
test_files:
|
153
|
-
- spec/
|
179
|
+
- spec/domain/attachment_spec.rb
|
180
|
+
- spec/domain/commands/concat_desc_spec.rb
|
181
|
+
- spec/domain/commands/new_entry_spec.rb
|
182
|
+
- spec/domain/commands/replace_pattern_spec.rb
|
183
|
+
- spec/domain/issue_spec.rb
|
184
|
+
- spec/domain/key_value_spec.rb
|
185
|
+
- spec/domain/log_entry_spec.rb
|
186
|
+
- spec/domain/sys_config_spec.rb
|
187
|
+
- spec/make_db.rb
|
188
|
+
- spec/old-databases/README.md
|
189
|
+
- spec/old-databases/default
|
190
|
+
- spec/tech/uncolored_string.rb
|
191
|
+
- spec/tech/wlog_string_spec.rb
|
154
192
|
has_rdoc:
|