Skip to content

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gandarez committed Apr 17, 2016
2 parents a84f246 + 7594410 commit 357d3b6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ Installation
Screen Shots
------------

![Project Overview](https://wakatime.com/static/img/ScreenShots/ScreenShot-2014-10-29.png)
![Project Overview](https://wakatime.com/static/img/ScreenShots/ScreenShot-2014-10-29.png)

Contributing
------------
**TO DO**

1. Implement logging
34 changes: 22 additions & 12 deletions WakaTimeConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace WakaTime
{
internal static class WakaTimeConstants
{
{
internal const string CliUrl = "https://github.com/wakatime/wakatime/archive/master.zip";
internal const string PluginName = "ssms-wakatime";
internal const string EditorName = "ssms";
Expand All @@ -15,20 +15,30 @@ internal static class WakaTimeConstants
{
var regex = new Regex(@"(__version_info__ = )(\(( ?\'[0-9]\'\,?){3}\))");
var client = new WebClient();
var about = client.DownloadString("https://raw.githubusercontent.com/wakatime/wakatime/master/wakatime/__about__.py");
var match = regex.Match(about);
if (!match.Success)
try
{
Logger.Warning("Couldn't auto resolve wakatime cli version");
return string.Empty;
}
var about = client.DownloadString("https://raw.githubusercontent.com/wakatime/wakatime/master/wakatime/__about__.py");
var match = regex.Match(about);
if (!match.Success)
{
Logger.Warning("Couldn't auto resolve wakatime cli version");
return string.Empty;
}
var grp1 = match.Groups[2];
var regexVersion = new Regex("([0-9])");
var match2 = regexVersion.Matches(grp1.Value);
var grp1 = match.Groups[2];
var regexVersion = new Regex("([0-9])");
var match2 = regexVersion.Matches(grp1.Value);
return string.Format("{0}.{1}.{2}", match2[0].Value, match2[1].Value, match2[2].Value);
return string.Format("{0}.{1}.{2}", match2[0].Value, match2[1].Value, match2[2].Value);
}
catch (Exception ex)
{
{
Logger.Error("Exception when checking current wakatime cli version: ", ex);
return string.Empty;
}
}
};
}
}

0 comments on commit 357d3b6

Please sign in to comment.