commit-msg-url-shortener 0.0.1 → 0.0.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.
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["dani.m.mobile@gmail.com"]
7
7
  gem.description = %q{Shortens the url that may appear in your commit message.}
8
8
  gem.summary = %q{Shortens the url that may appear in your commit message.}
9
- gem.homepage = ""
9
+ gem.homepage = "https://github.com/daniele-m/commit-msg-url-shortener"
10
10
  gem.platform = Gem::Platform::RUBY
11
11
 
12
12
  gem.files = `git ls-files`.split($\)
@@ -7,7 +7,7 @@ require "#{gem_name}/service"
7
7
  require "#{gem_name}/service_helper"
8
8
 
9
9
  module CommitMsgUrlShortener
10
- DEFAULT_SERVICE = 'goo.gl'
10
+ DEFAULT_SERVICE = 'svel.to'
11
11
  HOOK_CODE_SRV_TOKEN = 'SERVICE'
12
12
  ROOT_PATH = File.dirname File.expand_path(__FILE__)
13
13
  HOOK_CODES = Dir[File.join ROOT_PATH, "#{GEM_NAME}/hook_codes/*.*"].map do |path|
@@ -0,0 +1,14 @@
1
+ CommitMsgUrlShortener::Service.define do |commit_message|
2
+ def call_googl_api long_url
3
+ error_safe_request do
4
+ uri = URI 'http://svel.to/links'
5
+ http = Net::HTTP.new uri.host
6
+ http.read_timeout = 3
7
+ resp = http.post uri.path, "{'link': '#{long_url}'}", {"content-type" => "application/json", "accept" => "application/json"}
8
+ json = JSON.parse resp.body
9
+ json['url']
10
+ end
11
+ end
12
+
13
+ each_long_url(commit_message) {|url| call_googl_api url}
14
+ end
@@ -1,5 +1,5 @@
1
1
  module CommitMsgUrlShortener
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  BIN_NAME = 'commit-msg-url-shortener'
4
4
  GEM_NAME = 'commit-msg-url-shortener'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commit-msg-url-shortener
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-25 00:00:00.000000000 Z
12
+ date: 2012-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -84,10 +84,11 @@ files:
84
84
  - lib/commit-msg-url-shortener/service_helper.rb
85
85
  - lib/commit-msg-url-shortener/services/goo.gl.rb
86
86
  - lib/commit-msg-url-shortener/services/is.gd.rb
87
+ - lib/commit-msg-url-shortener/services/svel.to.rb
87
88
  - lib/commit-msg-url-shortener/services/tinyurl.com.rb
88
89
  - lib/commit-msg-url-shortener/version.rb
89
90
  - spec/fill_me
90
- homepage: ''
91
+ homepage: https://github.com/daniele-m/commit-msg-url-shortener
91
92
  licenses: []
92
93
  post_install_message:
93
94
  rdoc_options: []
@@ -101,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
102
  version: '0'
102
103
  segments:
103
104
  - 0
104
- hash: -1375090855405394249
105
+ hash: -2348041571703810309
105
106
  required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  none: false
107
108
  requirements:
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  version: '0'
111
112
  segments:
112
113
  - 0
113
- hash: -1375090855405394249
114
+ hash: -2348041571703810309
114
115
  requirements: []
115
116
  rubyforge_project:
116
117
  rubygems_version: 1.8.24