lazylead 0.7.1 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.docs/duedate_expired.md +1 -1
  3. data/.rubocop.yml +19 -3
  4. data/Gemfile +1 -1
  5. data/Rakefile +1 -1
  6. data/bin/lazylead +1 -1
  7. data/lazylead.gemspec +17 -16
  8. data/lib/lazylead.rb +2 -2
  9. data/lib/lazylead/allocated.rb +1 -1
  10. data/lib/lazylead/cc.rb +17 -23
  11. data/lib/lazylead/cli/app.rb +1 -1
  12. data/lib/lazylead/confluence.rb +1 -1
  13. data/lib/lazylead/email.rb +1 -1
  14. data/lib/lazylead/exchange.rb +1 -1
  15. data/lib/lazylead/home.rb +1 -1
  16. data/lib/lazylead/log.rb +1 -1
  17. data/lib/lazylead/model.rb +6 -8
  18. data/lib/lazylead/opts.rb +6 -3
  19. data/lib/lazylead/postman.rb +1 -1
  20. data/{Guardfile → lib/lazylead/requires.rb} +13 -8
  21. data/lib/lazylead/salt.rb +1 -1
  22. data/lib/lazylead/schedule.rb +1 -1
  23. data/lib/lazylead/smtp.rb +1 -1
  24. data/lib/lazylead/system/empty.rb +1 -1
  25. data/lib/lazylead/system/fake.rb +1 -1
  26. data/lib/lazylead/system/jira.rb +20 -18
  27. data/lib/lazylead/system/synced.rb +1 -1
  28. data/lib/lazylead/task/accuracy/accuracy.rb +37 -29
  29. data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
  30. data/lib/lazylead/task/accuracy/attachment.rb +1 -1
  31. data/lib/lazylead/task/accuracy/environment.rb +1 -1
  32. data/lib/lazylead/task/accuracy/logs.rb +5 -2
  33. data/lib/lazylead/task/accuracy/onlyll.rb +6 -8
  34. data/lib/lazylead/task/accuracy/records.rb +1 -1
  35. data/lib/lazylead/task/accuracy/requirement.rb +1 -1
  36. data/lib/lazylead/task/accuracy/screenshots.rb +60 -0
  37. data/lib/lazylead/task/accuracy/servers.rb +1 -1
  38. data/lib/lazylead/task/accuracy/stacktrace.rb +1 -1
  39. data/lib/lazylead/task/accuracy/testcase.rb +3 -3
  40. data/lib/lazylead/task/accuracy/wiki.rb +1 -1
  41. data/lib/lazylead/task/{alert.rb → alert/alert.rb} +6 -6
  42. data/lib/lazylead/task/alert/alertif.rb +75 -0
  43. data/lib/lazylead/task/alert/changed_to.rb +58 -0
  44. data/lib/lazylead/task/assignment.rb +1 -1
  45. data/lib/lazylead/task/confluence_ref.rb +1 -1
  46. data/lib/lazylead/task/echo.rb +1 -1
  47. data/lib/lazylead/task/fix_version.rb +1 -1
  48. data/lib/lazylead/task/loading.rb +94 -0
  49. data/lib/lazylead/task/missing_comment.rb +1 -1
  50. data/lib/lazylead/task/propagate_down.rb +3 -3
  51. data/lib/lazylead/task/savepoint.rb +1 -1
  52. data/lib/lazylead/task/svn/diff.rb +29 -7
  53. data/lib/lazylead/task/svn/grep.rb +1 -1
  54. data/lib/lazylead/task/svn/touch.rb +1 -1
  55. data/lib/lazylead/version.rb +2 -2
  56. data/lib/messages/accuracy.erb +1 -1
  57. data/lib/messages/alertif.erb +134 -0
  58. data/lib/messages/created_recently.erb +110 -0
  59. data/lib/messages/loading.erb +117 -0
  60. data/readme.md +26 -18
  61. data/test/lazylead/allocated_test.rb +1 -1
  62. data/test/lazylead/cc_test.rb +1 -1
  63. data/test/lazylead/cli/app_test.rb +2 -2
  64. data/test/lazylead/confluence_test.rb +1 -1
  65. data/test/lazylead/exchange_test.rb +1 -1
  66. data/test/lazylead/model_test.rb +1 -1
  67. data/test/lazylead/opts_test.rb +1 -1
  68. data/test/lazylead/postman_test.rb +1 -1
  69. data/test/lazylead/salt_test.rb +1 -1
  70. data/test/lazylead/smoke_test.rb +1 -1
  71. data/test/lazylead/smtp_test.rb +1 -1
  72. data/test/lazylead/system/jira_test.rb +10 -1
  73. data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
  74. data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
  75. data/test/lazylead/task/accuracy/attachment_test.rb +1 -1
  76. data/test/lazylead/task/accuracy/environment_test.rb +1 -1
  77. data/test/lazylead/task/accuracy/logs_test.rb +13 -1
  78. data/test/lazylead/task/accuracy/onlyll_test.rb +1 -1
  79. data/test/lazylead/task/accuracy/records_test.rb +1 -1
  80. data/test/lazylead/task/accuracy/score_test.rb +40 -2
  81. data/test/lazylead/task/accuracy/screenshots_test.rb +126 -0
  82. data/test/lazylead/task/accuracy/servers_test.rb +1 -1
  83. data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
  84. data/test/lazylead/task/accuracy/testcase_test.rb +28 -1
  85. data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
  86. data/test/lazylead/task/alert/alertif_test.rb +54 -0
  87. data/test/lazylead/task/{assignee_alert_test.rb → alert/assignee_alert_test.rb} +10 -10
  88. data/test/lazylead/task/alert/changed_to_test.rb +42 -0
  89. data/test/lazylead/task/assignment_test.rb +1 -1
  90. data/test/lazylead/task/confluence_ref_test.rb +1 -1
  91. data/test/lazylead/task/created_recently_test.rb +53 -0
  92. data/test/lazylead/task/duedate_test.rb +2 -2
  93. data/test/lazylead/task/echo_test.rb +1 -1
  94. data/test/lazylead/task/fix_version_test.rb +1 -1
  95. data/test/lazylead/task/loading_test.rb +54 -0
  96. data/test/lazylead/task/missing_comment_test.rb +1 -1
  97. data/test/lazylead/task/propagate_down_test.rb +1 -1
  98. data/test/lazylead/task/savepoint_test.rb +1 -1
  99. data/test/lazylead/task/svn/diff_test.rb +8 -4
  100. data/test/lazylead/task/svn/grep_test.rb +1 -1
  101. data/test/lazylead/task/svn/touch_test.rb +1 -1
  102. data/test/lazylead/version_test.rb +1 -1
  103. data/test/sqlite_test.rb +1 -1
  104. data/test/test.rb +13 -1
  105. data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -1
  106. data/upgrades/sqlite/999.testdata.sql +1 -1
  107. metadata +64 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fec0d2240a9c27715ef0fe82cd614844e0d5a1f3493b8c2230dcea4675f5e8f
4
- data.tar.gz: de4ea1ea31e59c3145ca4c184c7df50b6295f68180242db0be23eaa7fbf20c21
3
+ metadata.gz: 81d974a6e2fd3b5417524a420005f1d12714fabab71ead5dd7c9fc6e04582981
4
+ data.tar.gz: a181d093106c36c8d57a47a802fd21bd2a7c0b9ce4bbf09622721ed648481c07
5
5
  SHA512:
6
- metadata.gz: 56b73423b8d4d0ab2ba8daa084f24792f418fa14e5ad68b3443c4f3ee23b463b5b69462d2bbe5085259183768b23d00b4d6bdfa0d018910a8becd2a0bf47e729
7
- data.tar.gz: 51586cfd51223b8dfb6a1dfa7893c9018587bc0339212f757b94d05bfa88f5fa73aafee4c5c9073e0f62cd08eaa8afd20a2657172395cdf8d7ed3031aadd23aa
6
+ metadata.gz: 82388742ae4f14b8012b034631beb488ecdef5632c189ffa45fc1cc1947992051eef45d4444a2bef7d950b71e7e634f1c1ab8a63be77e355596ec87a3879cfd4
7
+ data.tar.gz: c1d297f36c42b0e4676211c52da716d05cca80561706d2e38406076d4b5ccd83834f431919803fd576428dae1d422c95f79473c3643e95d1a54bbf8278ec9fbd
@@ -89,4 +89,4 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
89
89
  #### Where is the code?
90
90
  | Logic | Tests | Email Template |
91
91
  | :-----: | :------: | :-----: |
92
- | AssigneeAlert in [alert.rb](../lib/lazylead/task/alert.rb)| [duedate_test.rb](../test/lazylead/task/duedate_test.rb) | [due_date_expired.erb](../lib/messages/due_date_expired.erb) |
92
+ | AssigneeAlert in [alert.rb](../lib/lazylead/task/alert/alert.rb)| [duedate_test.rb](../test/lazylead/task/duedate_test.rb) | [due_date_expired.erb](../lib/messages/due_date_expired.erb) |
data/.rubocop.yml CHANGED
@@ -3,6 +3,7 @@ require:
3
3
  - rubocop-performance
4
4
 
5
5
  AllCops:
6
+ NewCops: enable
6
7
  DisplayCopNames: true
7
8
  DisplayStyleGuide: true
8
9
  TargetRubyVersion: 2.6
@@ -85,12 +86,20 @@ Style/HashTransformValues:
85
86
  Style/FormatStringToken:
86
87
  Exclude:
87
88
  - "lib/lazylead/task/accuracy/accuracy.rb"
88
-
89
+ Style/IfWithBooleanLiteralBranches: # (new in 1.9)
90
+ Enabled: true
89
91
  Lint/RaiseException:
90
92
  Enabled: true
91
-
92
93
  Lint/StructNewOverride:
93
94
  Enabled: true
95
+ Lint/NumberedParameterAssignment: # (new in 1.9)
96
+ Enabled: true
97
+ Lint/OrAssignmentToConstant: # (new in 1.9)
98
+ Enabled: true
99
+ Lint/SymbolConversion: # (new in 1.9)
100
+ Enabled: true
101
+ Lint/TripleQuotes: # (new in 1.9)
102
+ Enabled: true
94
103
 
95
104
  # @todo #/DEV Add violation regarding methods without documentation using RDoc
96
105
  # https://stackoverflow.com/questions/1681467/how-to-document-ruby-code
@@ -139,7 +148,8 @@ Style/RedundantArgument: # (new in 1.4)
139
148
  Enabled: true
140
149
  Style/SwapValues: # (new in 1.1)
141
150
  Enabled: true
142
-
151
+ Style/HashConversion: # (new in 1.10)
152
+ Enabled: true
143
153
  Minitest/AssertInDelta: # (new in 0.10)
144
154
  Enabled: true
145
155
  Minitest/AssertionInLifecycleHook: # (new in 0.10)
@@ -191,4 +201,10 @@ Performance/Squeeze: # (new in 1.7)
191
201
  Performance/StringInclude: # (new in 1.7)
192
202
  Enabled: true
193
203
  Performance/Sum: # (new in 1.8)
204
+ Enabled: true
205
+ Performance/RedundantEqualityComparisonBlock: # (new in 1.10)
206
+ Enabled: true
207
+ Performance/RedundantSplitRegexpArgument: # (new in 1.10)
208
+ Enabled: true
209
+ Gemspec/DateAssignment: # (new in 1.10)
194
210
  Enabled: true
data/Gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
data/Rakefile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
data/bin/lazylead CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # The MIT License
5
5
  #
6
- # Copyright (c) 2019-2020 Yurii Dubinka
6
+ # Copyright (c) 2019-2021 Yurii Dubinka
7
7
  #
8
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
9
9
  # of this software and associated documentation files (the "Software"),
data/lazylead.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.rubygems_version = "2.2"
33
33
  s.required_ruby_version = ">=2.6.5"
34
34
  s.name = "lazylead"
35
- s.version = "0.7.1"
35
+ s.version = "0.8.3"
36
36
  s.license = "MIT"
37
37
  s.summary = "Eliminate the annoying work within bug-trackers."
38
38
  s.description = "Ticketing systems (Github, Jira, etc.) are strongly
@@ -45,7 +45,7 @@ tasks instead of solving technical problems."
45
45
  s.authors = ["Yurii Dubinka"]
46
46
  s.email = "yurii.dubinka@gmail.com"
47
47
  s.homepage = "http://github.com/dgroup/lazylead"
48
- s.post_install_message = "Thanks for installing Lazylead v0.7.1!
48
+ s.post_install_message = "Thanks for installing Lazylead v0.8.3!
49
49
  Read our blog posts: https://lazylead.org
50
50
  Stay in touch with the community in Telegram: https://t.me/lazylead
51
51
  Follow us on Twitter: https://twitter.com/lazylead
@@ -55,46 +55,47 @@ tasks instead of solving technical problems."
55
55
  s.test_files = s.files.grep(%r{^(test|features)/})
56
56
  s.rdoc_options = ["--charset=UTF-8"]
57
57
  s.extra_rdoc_files = %w[readme.md license.txt]
58
- s.add_runtime_dependency "activerecord", "6.1.1"
58
+ s.add_runtime_dependency "activerecord", "6.1.3"
59
59
  s.add_runtime_dependency "backtrace", "0.3"
60
60
  s.add_runtime_dependency "colorize", "0.8.1"
61
61
  s.add_runtime_dependency "faraday", "1.3.0"
62
62
  s.add_runtime_dependency "get_process_mem", "0.2.7"
63
63
  s.add_runtime_dependency "inifile", "3.0.0"
64
- s.add_runtime_dependency "jira-ruby", "2.1.4"
64
+ s.add_runtime_dependency "jira-ruby", "2.1.5"
65
65
  s.add_runtime_dependency "json", "2.5.1"
66
66
  s.add_runtime_dependency "logging", "2.3.0"
67
67
  s.add_runtime_dependency "mail", "2.7.1"
68
68
  s.add_runtime_dependency "memory_profiler", "1.0.0"
69
69
  s.add_runtime_dependency "openssl", "2.1.2"
70
- s.add_runtime_dependency "railties", "6.1.1"
70
+ s.add_runtime_dependency "railties", "6.1.3"
71
71
  s.add_runtime_dependency "require_all", "3.0.0"
72
+ s.add_runtime_dependency "rubyzip", "2.3.0"
72
73
  s.add_runtime_dependency "rufus-scheduler", "3.7.0"
73
74
  s.add_runtime_dependency "slop", "4.8.2"
74
75
  s.add_runtime_dependency "sqlite3", "1.4.2"
75
76
  s.add_runtime_dependency "tempfile", "0.1.1"
76
77
  s.add_runtime_dependency "tilt", "2.0.10"
77
78
  s.add_runtime_dependency "tzinfo", "2.0.4"
78
- s.add_runtime_dependency "tzinfo-data", "1.2020.6"
79
+ s.add_runtime_dependency "tzinfo-data", "1.2021.1"
79
80
  s.add_runtime_dependency "vcs4sql", "0.1.1"
80
- s.add_runtime_dependency "viewpoint", "1.1.0"
81
- s.add_development_dependency "codecov", "0.3.0"
81
+ s.add_runtime_dependency "viewpoint", "1.1.1"
82
+ s.add_development_dependency "codecov", "0.5.1"
82
83
  s.add_development_dependency "guard", "2.16.2"
83
84
  s.add_development_dependency "guard-minitest", "2.4.6"
84
- s.add_development_dependency "minitest", "5.14.3"
85
+ s.add_development_dependency "minitest", "5.14.4"
85
86
  s.add_development_dependency "minitest-fail-fast", "0.1.0"
86
87
  s.add_development_dependency "minitest-hooks", "1.5.0"
87
- s.add_development_dependency "minitest-reporters", "1.4.2"
88
+ s.add_development_dependency "minitest-reporters", "1.4.3"
88
89
  s.add_development_dependency "net-ping", "2.0.8"
89
90
  s.add_development_dependency "rake", "13.0.3"
90
91
  s.add_development_dependency "random-port", "0.5.1"
91
92
  s.add_development_dependency "rdoc", "6.3.0"
92
- s.add_development_dependency "rubocop", "1.8.1"
93
- s.add_development_dependency "rubocop-minitest", "0.10.3"
94
- s.add_development_dependency "rubocop-performance", "1.9.2"
93
+ s.add_development_dependency "rubocop", "1.12.1"
94
+ s.add_development_dependency "rubocop-minitest", "0.11.1"
95
+ s.add_development_dependency "rubocop-performance", "1.10.2"
95
96
  s.add_development_dependency "rubocop-rake", "0.5.1"
96
- s.add_development_dependency "rubocop-rspec", "2.1.0"
97
- s.add_development_dependency "sqlint", "0.1.10"
97
+ s.add_development_dependency "rubocop-rspec", "2.2.0"
98
+ s.add_development_dependency "sqlint", "0.2.0"
98
99
  s.add_development_dependency "tempfile", "0.1.1"
99
100
  s.add_development_dependency "xcop", "0.6.2"
100
101
  end
data/lib/lazylead.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -37,7 +37,7 @@ require_relative "lazylead/system/jira"
37
37
  require_relative "lazylead/system/empty"
38
38
  require_relative "lazylead/system/fake"
39
39
  require_relative "lazylead/system/synced"
40
- require_relative "lazylead/task/alert"
40
+ require_relative "lazylead/task/alert/alert"
41
41
  require_relative "lazylead/task/confluence_ref"
42
42
  require_relative "lazylead/task/echo"
43
43
  require_relative "lazylead/task/fix_version"
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
data/lib/lazylead/cc.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -80,13 +80,11 @@ module Lazylead
80
80
  end
81
81
 
82
82
  def cc
83
- @cc ||= begin
84
- if @text.include? ","
85
- @text.split(",").map(&:strip).select { |e| e[@regxp] }
86
- elsif @text[@regxp]
87
- [@text.strip]
88
- end
89
- end
83
+ @cc ||= if @text.include? ","
84
+ @text.split(",").map(&:strip).select { |e| e[@regxp] }
85
+ elsif @text[@regxp]
86
+ [@text.strip]
87
+ end
90
88
  end
91
89
 
92
90
  def each(&block)
@@ -125,15 +123,13 @@ module Lazylead
125
123
  end
126
124
 
127
125
  def to_h
128
- @to_h ||= begin
129
- if @orig.is_a? Hash
130
- @orig.each_with_object({}) do |i, o|
131
- o[i.first] = Lazylead::PlainCC.new(i.last).cc
132
- end
133
- else
134
- {}
135
- end
136
- end
126
+ @to_h ||= if @orig.is_a? Hash
127
+ @orig.each_with_object({}) do |i, o|
128
+ o[i.first] = Lazylead::PlainCC.new(i.last).cc
129
+ end
130
+ else
131
+ {}
132
+ end
137
133
  end
138
134
  end
139
135
 
@@ -151,12 +147,10 @@ module Lazylead
151
147
  end
152
148
 
153
149
  def to_h
154
- @to_h ||= begin
155
- components.each_with_object({}) do |c, h|
156
- email = lead(c.attrs["id"])
157
- next if email.nil? || email.blank?
158
- h[c.attrs["name"]] = email
159
- end
150
+ @to_h ||= components.each_with_object({}) do |c, h|
151
+ email = lead(c.attrs["id"])
152
+ next if email.nil? || email.blank?
153
+ h[c.attrs["name"]] = email
160
154
  end
161
155
  end
162
156
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
data/lib/lazylead/home.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
data/lib/lazylead/log.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -135,13 +135,11 @@ module Lazylead
135
135
  end
136
136
 
137
137
  def props
138
- @props ||= begin
139
- if team.nil?
140
- Opts.new(env(to_hash))
141
- else
142
- Opts.new(env(team.to_hash.merge(to_hash)))
143
- end
144
- end
138
+ @props ||= if team.nil?
139
+ Opts.new(env(to_hash))
140
+ else
141
+ Opts.new(env(team.to_hash.merge(to_hash)))
142
+ end
145
143
  end
146
144
 
147
145
  def postman
data/lib/lazylead/opts.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -34,8 +34,7 @@ module Lazylead
34
34
  # License:: MIT
35
35
  class Opts
36
36
  extend Forwardable
37
- def_delegators :@origin, :[], :[]=, :to_s, :key?, :fetch, :except, :each,
38
- :each_pair, :sort_by
37
+ def_delegators :@origin, :[], :[]=, :to_s, :key?, :fetch, :except, :each, :each_pair, :sort_by
39
38
 
40
39
  def initialize(origin = {})
41
40
  @origin = origin
@@ -139,5 +138,9 @@ module Lazylead
139
138
  def numeric?(key)
140
139
  to_h[key].to_i.positive?
141
140
  end
141
+
142
+ def construct(field, delim: ",")
143
+ slice(field, delim).map(&:constantize).map(&:new)
144
+ end
142
145
  end
143
146
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -22,12 +22,17 @@
22
22
  # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23
23
  # OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
- # Guardfile for Lazylead
26
- guard :minitest, all_after_pass: false, all_on_start: false do
27
- # with Minitest::Unit
28
- watch(%r{^test/(.*)/?test_(.*)\.rb$})
29
- watch(%r{^test/test\.rb$}) { "test" }
30
- watch(%r{^lib/lazylead/(.*/)?([^/]+)\.rb$}) do |m|
31
- "test/#{m[1]}test_#{m[2]}.rb"
25
+ module Lazylead
26
+ #
27
+ # Allows to load all ruby files within particular dir.
28
+ #
29
+ class Requires
30
+ def initialize(dir)
31
+ @dir = dir
32
+ end
33
+
34
+ def load
35
+ Dir[File.join(@dir, "*.rb")].sort.each { |f| require f }
36
+ end
32
37
  end
33
38
  end