shortly 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTllNWNlYzU3MGM3YzZlM2U4MzAxMGVkNTUzZmQxZmVlN2MxZWY1OQ==
5
- data.tar.gz: !binary |-
6
- ZTJkZWEwZTFkOGE3NzhmZTViZDgwZjM3MTZhZTkxMTQ2NzdiMDM5MA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MmM0ZDY0ODhkMjE5N2E2Mzg5NjJiMmEwOWFjYmNjYWZiZDA5NTk3ZmQ5MGU5
10
- NDVjZGYxNTljYzgxODA1MTYxNDY4OTBhY2M2NmViNGY5ODE4NDFiMGM5Zjk0
11
- OTMxZTAwMTE2MGI5YzE0ZjRiN2VlZDZhYjlkY2YwZWQ3YjhkYmI=
12
- data.tar.gz: !binary |-
13
- MmFkY2NmY2MyZjI5ZmNkNjNkYWYzOWMxNjRhNzIzMzk0MWQ4NzEzNzgxMjc3
14
- MWQyOTUxNjFlNjEwZDI5MWEyYzFmZWQ5ZWFlZjNiNDNmNDFlYWE4MWM2NWRk
15
- OGM3MmUzY2ZmZDBlYjdkMDllNjRmYmYxNWNmNjhiMjg2MDk5MDI=
2
+ SHA1:
3
+ metadata.gz: 3a1da9df6df9580e9a5ac2858d19f0c36652f1d8
4
+ data.tar.gz: 2deb47bb0e8ef4655ea042433bb1cb5ed27a71f9
5
+ SHA512:
6
+ metadata.gz: b6dd8c828081cc9a7424426caf6e1f63a83d9a31a9d0515e24fa2b9191e090dd772a5fb6be257232c8fec932aa87c70bd07488456b9f6837757fe848d854404c
7
+ data.tar.gz: e06e14199445b72d8d5384aa43c648ea7c2153794c71bac9fd5641b7f8f41aec67165a17c96c4df3fe82597f5031e9c24bc0913f2adbbe9223c827b19a649cdd
data/README.markdown CHANGED
@@ -1,13 +1,25 @@
1
1
  # Shortly
2
2
 
3
+ <a style="float:right" href='https://pledgie.com/campaigns/24609'><img alt='Click here to lend your support to: Shortly and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/24609.png?skin_name=chrome' border='0' ></a><div style="clear:both"></div>
4
+
5
+ ____ _ _ _
6
+ / ___|| |__ ___ _ __| |_| |_ _
7
+ \___ \| '_ \ / _ \| '__| __| | | | |
8
+ ___) | | | | (_) | | | |_| | |_| |
9
+ |____/|_| |_|\___/|_| \__|_|\__, |
10
+ |___/
11
+
12
+
3
13
  A Ruby wrapper for various url shortener services
4
14
 
5
15
  ## Installation
6
16
 
7
17
  create a dependency in your Gemfile
8
- @gem 'shortly'@ then run
9
- @bundle install@
10
- and shortly will be up and running. or @gem install shortly@
18
+
19
+ gem 'shortly' #then run
20
+ bundle install
21
+
22
+ and shortly will be up and running. or `gem install shortly`
11
23
 
12
24
  ## Uses
13
25
 
@@ -116,4 +128,4 @@ Copyright (c) 2010 Bagwan Pankaj: http://bagwanpankaj.com, released under the MI
116
128
 
117
129
  ## Copyright
118
130
 
119
- Copyright (c) 2010 [Bagwan Pankaj]. See LICENSE.txt for further details.
131
+ Copyright (c) 2010-2014 [Bagwan Pankaj]. See LICENSE.txt for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.5
data/bin/shortly CHANGED
@@ -21,6 +21,7 @@ services = {
21
21
  :jmp => Shortly::Clients::Jmp,
22
22
  :tinyurl => Shortly::Clients::Tinyurl,
23
23
  :snim => Shortly::Clients::Snim,
24
+ :bitdo => Shortly::Clients::Bitdo
24
25
  }
25
26
 
26
27
  options = {:service => :googl, :method => :shorten} #defaults to be used
@@ -119,6 +120,7 @@ output = case options[:service]
119
120
  when :isgd, :vgd then response.shorturl
120
121
  when :lggd, :shortswitch then response.shortUrl
121
122
  when :tinyurl then response.shorturl
123
+ when :bitdo then response.short_url
122
124
  else abort("Something went wrong. Please raise an issue on Github")
123
125
  end
124
126
 
data/lib/shortly.rb CHANGED
@@ -15,6 +15,7 @@ require 'shortly/clients/shortswitch'
15
15
  require 'shortly/clients/tinyurl'
16
16
  require 'shortly/clients/vgd'
17
17
  require 'shortly/clients/snim'
18
+ require 'shortly/clients/bitdo'
18
19
 
19
20
  module Shortly
20
21
 
@@ -0,0 +1,43 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ module Shortly
23
+
24
+ module Clients
25
+
26
+ class Bitdo < Client
27
+
28
+ self.register!
29
+ base_uri 'bit.do'
30
+
31
+ #shorts provided url by making call to is.gd api with given options.
32
+ def self.shorten(url, options = {})
33
+ validate_uri!(url)
34
+ options = {:action => "shorten", :url => url}.merge(options)
35
+ response = post("/mod_perl/url-shortener.pl", post_params(options))
36
+ struct = JSON.parse(response.body)
37
+ struct = struct.merge({ :short_url => "http://bit.do/#{struct["url_hash"]}" })
38
+ OpenStruct.new(struct)
39
+ end
40
+
41
+ end
42
+ end
43
+ end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shortly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bagwan Pankaj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-21 00:00:00.000000000 Z
11
+ date: 2014-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.13.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.13.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.8.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.8.1
41
41
  description: Ruby Wrapper for different Url Shortner Services Ruby Wrapper
42
42
  email: bagwanpankaj@gmail.com
43
43
  executables:
@@ -48,10 +48,12 @@ extra_rdoc_files:
48
48
  - README.markdown
49
49
  files:
50
50
  - LICENSE.txt
51
+ - README.markdown
51
52
  - VERSION
52
53
  - bin/shortly
53
54
  - lib/shortly.rb
54
55
  - lib/shortly/client.rb
56
+ - lib/shortly/clients/bitdo.rb
55
57
  - lib/shortly/clients/bitly.rb
56
58
  - lib/shortly/clients/googl.rb
57
59
  - lib/shortly/clients/isgd.rb
@@ -62,7 +64,6 @@ files:
62
64
  - lib/shortly/clients/vgd.rb
63
65
  - lib/shortly/errors.rb
64
66
  - lib/shortly/helper.rb
65
- - README.markdown
66
67
  - spec/shortly_spec.rb
67
68
  - spec/spec_helper.rb
68
69
  - spec/support/fakeweb_stub.rb
@@ -76,17 +77,17 @@ require_paths:
76
77
  - lib
77
78
  required_ruby_version: !ruby/object:Gem::Requirement
78
79
  requirements:
79
- - - ! '>='
80
+ - - ">="
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
83
  required_rubygems_version: !ruby/object:Gem::Requirement
83
84
  requirements:
84
- - - ! '>='
85
+ - - ">="
85
86
  - !ruby/object:Gem::Version
86
87
  version: '0'
87
88
  requirements: []
88
89
  rubyforge_project:
89
- rubygems_version: 2.0.5
90
+ rubygems_version: 2.2.1
90
91
  signing_key:
91
92
  specification_version: 3
92
93
  summary: Url Shortner Services Ruby Wrapper