technicaldebt-techincaldebt 0.1.2 → 0.2.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.2.0
@@ -85,10 +85,9 @@ class TechnicalDebt
85
85
  def connection_exists?
86
86
  check_connection ? true : false
87
87
  end
88
-
89
- #DEBT 1 hour Just a sanity check
88
+
90
89
  def register_debt
91
- if git_token_exists? && connection_exists?
90
+ if git_token_exists? && connection_exists? && !debt_lines_with_logged.blank?
92
91
  push_to_technical_debt
93
92
  else
94
93
  log_debt
@@ -117,12 +116,13 @@ class TechnicalDebt
117
116
  "#{project}/.git/technical_debt"
118
117
  end
119
118
 
119
+ #DEBT 1h Just a sanity check maybe a reality check
120
120
  def send_to_server(debt)
121
- Net::HTTP.post_form(URI.parse("http://techdebt.dev/transactions"), {:message => stripped_debt_line(debt), :sha => last_commit_sha, :git_token => get_git_token })
121
+ Net::HTTP.post_form(URI.parse("http://techdebt.dev/transactions"), { 'transaction[message]' => stripped_debt_line(debt), 'transaction[sha]' => last_commit_sha, 'git_token' => get_git_token, 'kind' => 'debt' })
122
122
  end
123
123
 
124
124
  def stripped_debt_line(debt_line)
125
- debt_line[regex_debt_matcher, 1]
125
+ debt_line[/^\+\s*#\s*[dD][eE][bB][tT]\s+(.*)$/, 1]
126
126
  end
127
127
 
128
128
  def debtify
@@ -225,7 +225,7 @@ describe TechnicalDebt,"strip # DEBT from debt lines" do
225
225
  end
226
226
 
227
227
  it "should not start with the word DEBT" do
228
- @techdebt.stripped_debt_line(@techdebt.debt_lines_only.first).should_not include("+ #DEBT")
228
+ @techdebt.stripped_debt_line("+ #DEBT 1 hour Just a sanity check maybe a reality check, booooo, sigh").should_not include("+ #DEBT")
229
229
  end
230
230
 
231
231
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{techincaldebt}
8
- s.version = "0.1.2"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Chris Herring", "Jeremy Grant", "Gareth Stokes", "Carl Woodward"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: technicaldebt-techincaldebt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Herring