dryrun 0.8.0 → 0.8.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d6c17c4daa6f07ff66e42bbb93fee0f301e159e
4
- data.tar.gz: 9a822a3cb7961d64e0127776a549cc5f503f2ec1
3
+ metadata.gz: 005bfb7f37647f9971b214b8830b486c565ecc12
4
+ data.tar.gz: ad829eaf19861597354b3566004c62232c374696
5
5
  SHA512:
6
- metadata.gz: 22ed812fc2e7bbb4bcb621915e0a64f550f899da8de52fdeab807c2ef111b37c5bdce6a0783b6a6219eb53935e8c320d310221ae5970a949bb2bb7da8819d519
7
- data.tar.gz: 9606739e80de94d5bf619d30a8c57ed25d14fb821ec62c50a3c544eb91699fa8f908aee10ffc72ed451605f009336891b2e854365c265bbd1c10e84c3acac160
6
+ metadata.gz: a085e052f943535a1f368ef88b37092a4031570873c18b7be6fa823be6d31fdecc526c4780c4c3dd9ac0e2a5bc8b259fe087c03361479da947a7eeb3f5ec1611
7
+ data.tar.gz: 1868495c41a7a841480858ece8966288ff81ef8891917c6835721c3ebd9211317671abb72f98812f684e46df47951aec34c16a8efb18ca2245db67dc637db669
@@ -1,21 +1,31 @@
1
1
  require 'tmpdir'
2
2
  require 'fileutils'
3
3
  require 'uri'
4
- require 'digest'
5
4
  require_relative 'dryrun_utils'
6
5
 
7
6
  module Dryrun
8
7
  class Github
9
8
  def initialize(url)
9
+ @base_url = sanitize_url(url)
10
+ @destination = destination
11
+ end
12
+
13
+ def sanitize_url(url)
10
14
  url = url.split('?').first
11
15
  url.chop! if url.end_with? '/'
12
-
13
- @base_url = url
14
- @destination = destination
16
+ return url
15
17
  end
16
18
 
17
19
  def destination
18
- Digest::SHA256.hexdigest @base_url
20
+ unless @base_url.include? 'github.com'
21
+ return Digest::SHA256.hexdigest @base_url
22
+ end
23
+
24
+ stripped_url = @base_url.gsub('.git', '')
25
+ stripped_url = stripped_url.gsub('.git', '')
26
+ stripped_url = stripped_url.gsub('git@github.com:', '')
27
+ stripped_url = stripped_url.gsub('https://github.com/', '')
28
+ stripped_url = stripped_url.gsub('http://github.com/', '')
19
29
  end
20
30
 
21
31
  def valid?
@@ -1,3 +1,3 @@
1
1
  module Dryrun
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryrun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cesar ferreira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-05 00:00:00.000000000 Z
11
+ date: 2016-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.6.6
176
+ rubygems_version: 2.5.1
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Tool to try any android library hosted online directly from the command line