wlog 1.2.1 → 1.2.2

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -0
  3. data/bin/wlog +1 -2
  4. data/lib/wlog/commands/bootstrap_templates.rb +1 -1
  5. data/lib/wlog/commands/concat_description.rb +0 -1
  6. data/lib/wlog/commands/create_issue.rb +1 -1
  7. data/lib/wlog/commands/delete_attachment.rb +0 -1
  8. data/lib/wlog/commands/delete_issue.rb +1 -2
  9. data/lib/wlog/commands/fetch_git_commits.rb +5 -4
  10. data/lib/wlog/commands/fetch_git_commits_standard.rb +0 -1
  11. data/lib/wlog/commands/innit_db.rb +4 -5
  12. data/lib/wlog/commands/make_csv.rb +0 -1
  13. data/lib/wlog/commands/new_entry.rb +2 -2
  14. data/lib/wlog/commands/replace_pattern.rb +0 -1
  15. data/lib/wlog/commands/taint_setup.rb +0 -1
  16. data/lib/wlog/domain.rb +0 -1
  17. data/lib/wlog/domain/attachment.rb +1 -1
  18. data/lib/wlog/domain/git_commit.rb +1 -1
  19. data/lib/wlog/domain/helpers.rb +4 -5
  20. data/lib/wlog/domain/invoice.rb +1 -1
  21. data/lib/wlog/domain/issue.rb +35 -10
  22. data/lib/wlog/domain/key_value.rb +2 -3
  23. data/lib/wlog/domain/log_entry.rb +5 -13
  24. data/lib/wlog/domain/static_configurations.rb +24 -25
  25. data/lib/wlog/domain/sys_config.rb +2 -3
  26. data/lib/wlog/domain/template_helper.rb +2 -2
  27. data/lib/wlog/domain/timelog_helper.rb +1 -1
  28. data/lib/wlog/migrations/make_standard_tables.rb +4 -5
  29. data/lib/wlog/tech/ansi_colors.rb +0 -1
  30. data/lib/wlog/tech/git_commit_parser.rb +14 -14
  31. data/lib/wlog/tech/git_commit_printer.rb +4 -4
  32. data/lib/wlog/tech/text_filters.rb +20 -0
  33. data/lib/wlog/tech/uncolored_string.rb +1 -1
  34. data/lib/wlog/tech/wlog_string.rb +1 -1
  35. data/lib/wlog/ui/bootstrap.rb +1 -2
  36. data/lib/wlog/ui/cli_interface.rb +12 -12
  37. data/lib/wlog/ui/configuration_ui.rb +5 -6
  38. data/lib/wlog/ui/edit_handler.rb +6 -6
  39. data/lib/wlog/ui/git_ui.rb +29 -16
  40. data/lib/wlog/ui/invoice_ui.rb +41 -27
  41. data/lib/wlog/ui/issue_ui.rb +29 -26
  42. data/lib/wlog/ui/setup_wizard.rb +4 -2
  43. data/lib/wlog/ui/template_ui.rb +1 -2
  44. data/lib/wlog/version.rb +1 -1
  45. data/spec/domain/attachment_spec.rb +8 -8
  46. data/spec/domain/commands/concat_desc_spec.rb +2 -2
  47. data/spec/domain/commands/new_entry_spec.rb +2 -2
  48. data/spec/domain/commands/replace_pattern_spec.rb +0 -1
  49. data/spec/domain/git_commits_spec.rb +11 -11
  50. data/spec/domain/invoice_spec.rb +5 -6
  51. data/spec/domain/issue_spec.rb +8 -9
  52. data/spec/domain/key_value_spec.rb +3 -4
  53. data/spec/domain/log_entry_spec.rb +6 -7
  54. data/spec/make_db.rb +1 -2
  55. data/spec/spec_helper.rb +4 -5
  56. data/spec/tech/text_filters_spec.rb +54 -0
  57. data/spec/tech/uncolored_string.rb +1 -1
  58. metadata +6 -3
@@ -4,7 +4,7 @@ require 'wlog/domain/issue'
4
4
 
5
5
  include Wlog
6
6
 
7
- describe Issue do
7
+ describe Issue do
8
8
 
9
9
  db_name = 'default'
10
10
 
@@ -22,7 +22,7 @@ describe Issue do
22
22
  issue.description = "Some issue"
23
23
  issue.mark_started!
24
24
  issue.save
25
-
25
+
26
26
  ret = Issue.all
27
27
  expect(ret.size).to eq(1)
28
28
  end
@@ -34,7 +34,7 @@ describe Issue do
34
34
  issue.save
35
35
  issue.delete
36
36
 
37
- ret = Issue.find_by_id(issue.id)
37
+ ret = Issue.find_by_id(issue.id)
38
38
  expect(ret).to eq(nil)
39
39
  end
40
40
 
@@ -67,13 +67,13 @@ describe Issue do
67
67
  issue3 = Issue.new
68
68
 
69
69
  issue1.description = "find me 1"
70
- issue2.description = "find me 2"
70
+ issue2.description = "find me 2"
71
71
  issue3.description = "find me 3"
72
-
72
+
73
73
  issue1.long_description = "long desc 1"
74
74
  issue2.long_description = "long desc 2"
75
75
  issue3.long_description = "long desc 3"
76
-
76
+
77
77
  issue1.save
78
78
  issue2.save
79
79
  issue3.save
@@ -113,7 +113,7 @@ describe Issue do
113
113
  end
114
114
 
115
115
  it "should find all finished issues" do
116
- 4.times do
116
+ 4.times do
117
117
  iss = Issue.new
118
118
  iss.description = "hello"
119
119
  iss.mark_finished!
@@ -128,5 +128,4 @@ describe Issue do
128
128
 
129
129
  it "should accept attachments" do
130
130
  end
131
- end
132
-
131
+ end
@@ -4,8 +4,8 @@ require 'wlog/domain/key_value'
4
4
 
5
5
  include Wlog
6
6
 
7
- describe KeyValue do
8
-
7
+ describe KeyValue do
8
+
9
9
  db_name = "default"
10
10
  db_path = standard_db_path(db_name)
11
11
 
@@ -36,5 +36,4 @@ describe KeyValue do
36
36
  expect(@kv.get('my_value')).to eq('321')
37
37
  end
38
38
 
39
- end
40
-
39
+ end
@@ -5,7 +5,7 @@ require 'wlog/domain/issue'
5
5
 
6
6
  include Wlog
7
7
 
8
- describe LogEntry do
8
+ describe LogEntry do
9
9
 
10
10
  db_name = 'default'
11
11
  db_path = standard_db_path(db_name)
@@ -23,14 +23,14 @@ describe LogEntry do
23
23
 
24
24
  it "should be inserted" do
25
25
  le = LogEntry.new
26
- desc = "This is a log description"
26
+ desc = "This is a log description"
27
27
  le.description = desc
28
28
  @issue.log_entries << le
29
29
 
30
30
  other = @issue.log_entries.first
31
31
  expect(other.description).to eq(desc)
32
32
  expect(other.issue_id).to eq(@issue.id)
33
- end
33
+ end
34
34
 
35
35
  it "should handle something that is not found properly" do
36
36
  le = LogEntry.find_by_id(12123123123)
@@ -40,9 +40,9 @@ describe LogEntry do
40
40
  it "should not be inserted more than once" do
41
41
  previous = LogEntry.count
42
42
  le = LogEntry.new
43
- le.description = "derp"
43
+ le.description = "derp"
44
44
  le.issue_id = @issue.id
45
- 4.times{ le.save }
45
+ 4.times{ le.save }
46
46
  after = LogEntry.count
47
47
  expect(after).to eq(previous + 1)
48
48
  end
@@ -71,5 +71,4 @@ describe LogEntry do
71
71
 
72
72
  expect(check.description).to eq(after)
73
73
  end
74
- end
75
-
74
+ end
@@ -22,7 +22,7 @@ end
22
22
 
23
23
  # make the tables, and perform possible migrations
24
24
  def setup_db
25
- ActiveRecord::Migration.verbose = false
25
+ ActiveRecord::Migration.verbose = false
26
26
  ActiveRecord::Migration.run(MakeSchemaMigration)
27
27
 
28
28
  InnitDb.new.execute_migrations!
@@ -31,4 +31,3 @@ end
31
31
  def standard_db_path(dbname)
32
32
  "#{File.expand_path File.dirname(__FILE__)}/#{dbname}"
33
33
  end
34
-
@@ -14,7 +14,7 @@ module DomainHelpers
14
14
  old = $sn
15
15
  $sn += 1
16
16
  old end
17
-
17
+
18
18
  # Make a log entry but don't store it
19
19
  def make_log_entry
20
20
  le = LogEntry.new(:description => "Desc ##{sn}")
@@ -22,10 +22,9 @@ module DomainHelpers
22
22
 
23
23
  def make_issue
24
24
  is = Issue.new(:description => "Desc #{sn}",
25
- :due_date => DateTime.now,
26
- :status => 0,
27
- :timelog => 10,
25
+ :due_date => DateTime.now,
26
+ :status => 0,
27
+ :timelog => 10,
28
28
  :long_description => "big desc #{sn}")
29
29
  is end
30
30
  end
31
-
@@ -0,0 +1,54 @@
1
+ require 'wlog/tech/text_filters'
2
+ require 'wlog/tech/ansi_colors'
3
+ require 'wlog/tech/wlog_string'
4
+
5
+ include Wlog
6
+ include TextFilters
7
+ include AnsiColors
8
+
9
+ describe TextFilters do
10
+
11
+ before :each do
12
+ allow(SysConfig).to receive(:string_decorator).and_return(WlogString)
13
+ end
14
+
15
+ it 'should detect a simple link' do
16
+ a = highlight_hyperlink_s("www.google.com")
17
+ b = highlight_hyperlink_s("http://www.google.com")
18
+ c = highlight_hyperlink_s("https://www.google.com")
19
+ expect(a).to match(/^\x1b\[#{Blue}/)
20
+ expect(b).to match(/^\x1b\[#{Blue}/)
21
+ expect(c).to match(/^\x1b\[#{Blue}/)
22
+ end
23
+
24
+ it 'should not color a common string' do
25
+ a = highlight_hyperlink_s("potato potato how is the potato")
26
+ expect(a).to eq("potato potato how is the potato")
27
+ end
28
+
29
+ it 'should color only links within a mixed string' do
30
+ a = "http://a.com potato https://go.go cat www.nooo.no yes"
31
+ ret = highlight_hyperlink_s(a)
32
+ count = 0
33
+ ret_a = ret.split
34
+ ret_a.each do |n|
35
+ count += 1 if n.include?("\x1b[#{Blue}")
36
+ end
37
+ # we dected three links
38
+ expect(count).to eq(3)
39
+ # out of 6 tokens
40
+ expect(ret_a.count).to eq(6)
41
+ end
42
+
43
+ it 'should preserve line formatting' do
44
+ str = 'this is my line and there is more to say'
45
+ str.concat($/).concat('and there is yet more again').concat($/)
46
+ str.concat('but now I am talking about www.link.com and').concat($/)
47
+ str.concat('will continue to babble on to make sure that the test').concat($/)
48
+ str.concat('is actually quite ok. also www.potato.com!').concat($/)
49
+
50
+ res = highlight_hyperlink_s(str)
51
+ expect(res.lines.count).to eq(str.lines.count)
52
+ end
53
+
54
+ end
@@ -2,7 +2,7 @@ require 'wlog/tech/uncolored_string'
2
2
 
3
3
  include Wlog
4
4
 
5
- describe UncoloredString do
5
+ describe UncoloredString do
6
6
 
7
7
  ucs = UncoloredString
8
8
 
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.2.1
4
+ version: 1.2.2
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-14 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -171,6 +171,7 @@ files:
171
171
  - lib/wlog/tech/ansi_colors.rb
172
172
  - lib/wlog/tech/git_commit_parser.rb
173
173
  - lib/wlog/tech/git_commit_printer.rb
174
+ - lib/wlog/tech/text_filters.rb
174
175
  - lib/wlog/tech/uncolored_string.rb
175
176
  - lib/wlog/tech/wlog_string.rb
176
177
  - lib/wlog/ui/bootstrap.rb
@@ -197,6 +198,7 @@ files:
197
198
  - spec/old-databases/README.md
198
199
  - spec/old-databases/default
199
200
  - spec/spec_helper.rb
201
+ - spec/tech/text_filters_spec.rb
200
202
  - spec/tech/uncolored_string.rb
201
203
  - spec/tech/wlog_string_spec.rb
202
204
  - wlog.gemspec
@@ -223,7 +225,7 @@ rubyforge_project:
223
225
  rubygems_version: 2.0.14
224
226
  signing_key:
225
227
  specification_version: 4
226
- summary: 'A light ruby script to help track tasks and time commit: 0c90fed'
228
+ summary: 'A light ruby script to help track tasks and time commit: a4b3c0a'
227
229
  test_files:
228
230
  - spec/domain/attachment_spec.rb
229
231
  - spec/domain/commands/concat_desc_spec.rb
@@ -239,6 +241,7 @@ test_files:
239
241
  - spec/old-databases/README.md
240
242
  - spec/old-databases/default
241
243
  - spec/spec_helper.rb
244
+ - spec/tech/text_filters_spec.rb
242
245
  - spec/tech/uncolored_string.rb
243
246
  - spec/tech/wlog_string_spec.rb
244
247
  has_rdoc: