parvus 1.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 076c50b850af8cc1a8888354c5532bf1976970e8
4
+ data.tar.gz: 7ddcbd0d23c11b25f5b541b39f9ae715852d2a46
5
+ SHA512:
6
+ metadata.gz: b981ca7099b02749cf67702bd2fa458ea261f9e8972870104af96a8aac28c3239e607176ae6a2dbdffc93ada51f28b6e3002727ba261312f542bb76174ca22bc
7
+ data.tar.gz: 44194105fa98c948b7d3dd72bc23f21a984842664fe1afb8515f418bd4079d5dec23206c4c042b20dcf40853ac8fcba9c637abc1a180269b0843a6faf712b079
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ ����A���]^���u���-\��6J��p{��Pkl{7�8����������Ywm����J�y6dGU����jWX�����'�g�*J�ڤO���� c���[7�Z�� ��$�_�Q����-�<G��� ���y3���C!�~�@&&S!{��fa7���$���ۉŌ���Ɂ����,F}VbM�b�`���l�R�v��+A����_��#�1I���@�5(F~l{��s�NK⮨ )T��4l�Q<�\x
2
+ b�G��
data/.gitignore ADDED
@@ -0,0 +1,43 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+
16
+ *.gem
17
+ *.rbc
18
+ /.config
19
+ /InstalledFiles
20
+ /test/tmp/
21
+ /test/version_tmp/
22
+
23
+ ## Specific to RubyMotion:
24
+ .dat*
25
+ .repl_history
26
+ build/
27
+
28
+ ## Documentation cache and generated files:
29
+ /rdoc/
30
+
31
+ ## Environment normalisation:
32
+ /.bundle/
33
+ /vendor/bundle
34
+ /lib/bundler/man/
35
+
36
+ # for a library or gem, you might want to ignore these files since the code is
37
+ # intended to run in multiple environments; otherwise, check them in:
38
+ # Gemfile.lock
39
+ # .ruby-version
40
+ # .ruby-gemset
41
+
42
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
43
+ .rvmrc
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0-p598
5
+ - 2.1.5
6
+ - 2.2.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in parvus.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 William Mathewson
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # Parvus [![Build Status](https://travis-ci.org/neanias/parvus.svg)](https://travis-ci.org/neanias/parvus)
2
+
3
+ Yet another URL shortening gem
4
+
5
+ ## Installation
6
+
7
+ $ gem install parvus
8
+
9
+ ## Usage
10
+
11
+ For usage instructions
12
+
13
+ $ parvus (help)
14
+
15
+ To shorten urls
16
+
17
+ $ parvus shorten (-s SERVICE) URL
18
+
19
+ ## Contributing
20
+
21
+ 1. Fork it ( https://github.com/neanias/parvus/fork )
22
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
23
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
24
+ 4. Push to the branch (`git push origin my-new-feature`)
25
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ task default: [:build]
data/bin/parvus ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/parvus'
3
+
4
+ CommandLineParser.start
data/lib/parvus/cli.rb ADDED
@@ -0,0 +1,18 @@
1
+ require_relative 'shorteners/butts_so'
2
+
3
+ class CommandLineParser < Thor
4
+ map '--version' => :version, '-v' => :version
5
+
6
+ desc 'shorten URL',
7
+ 'shortens the given URL using a service (butts.so by default)'
8
+ method_option :service, type: :string, default: 'butts.so', aliases: '-s',
9
+ enum: %w(butts.so)
10
+ def shorten(url)
11
+ puts ButtsSo.get_short_url(url) if options[:service].eql? 'butts.so'
12
+ end
13
+
14
+ desc 'version', 'prints out the version of parvus installed'
15
+ def version
16
+ puts Parvus::VERSION
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ class ButtsSo
2
+ @base_uri = 'http://butts.so/api/v1/create'
3
+ @header = { 'Content-Type' => 'application/json' }
4
+
5
+ def self.get_short_url(url)
6
+ options = { body: {url: url}.to_json }
7
+ options[:headers] = @header
8
+
9
+ shortcode = HTTParty.post(@base_uri, options)
10
+
11
+ "http://butts.so/#{shortcode['shortcode']}"
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module Parvus
2
+ VERSION = '1.0.0'
3
+ end
data/lib/parvus.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'thor'
2
+ require 'httparty'
3
+
4
+ require_relative 'parvus/version'
5
+ require_relative 'parvus/cli'
data/parvus.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'parvus/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'parvus'
8
+ spec.version = Parvus::VERSION
9
+ spec.authors = ['William Mathewson']
10
+ spec.email = ['wncmathewson@me.com']
11
+ spec.summary = 'Yet another URL shortening gem'
12
+ # spec.description = 'TODO: Write a longer description. Optional.'
13
+ spec.homepage = 'https://github.com/neanias/parvus'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 1.9.3'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.7'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+
25
+ spec.add_runtime_dependency 'httparty', '~> 0.13'
26
+ spec.add_runtime_dependency 'thor', '~> 0.19'
27
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: parvus
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - William Mathewson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRUwEwYDVQQDDAx3bmNt
14
+ YXRoZXdzb24xEjAQBgoJkiaJk/IsZAEZFgJtZTETMBEGCgmSJomT8ixkARkWA2Nv
15
+ bTAeFw0xNDA0M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2xRTFaZ463WgGKyW/9K
31
+ QJdPChDoNFnekdfEGjFvvjSqlZ5MGrqS
32
+ -----END CERTIFICATE-----
33
+ date: 2015-04-10 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: bundler
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.7'
42
+ type: :development
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.7'
49
+ - !ruby/object:Gem::Dependency
50
+ name: rake
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '10.0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '10.0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: httparty
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0.13'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '0.13'
77
+ - !ruby/object:Gem::Dependency
78
+ name: thor
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '0.19'
84
+ type: :runtime
85
+ prerelease: false
86
+ version_requirements: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '0.19'
91
+ description:
92
+ email:
93
+ - wncmathewson@me.com
94
+ executables:
95
+ - parvus
96
+ extensions: []
97
+ extra_rdoc_files: []
98
+ files:
99
+ - ".gitignore"
100
+ - ".travis.yml"
101
+ - Gemfile
102
+ - LICENSE.txt
103
+ - README.md
104
+ - Rakefile
105
+ - bin/parvus
106
+ - lib/parvus.rb
107
+ - lib/parvus/cli.rb
108
+ - lib/parvus/shorteners/butts_so.rb
109
+ - lib/parvus/version.rb
110
+ - parvus.gemspec
111
+ homepage: https://github.com/neanias/parvus
112
+ licenses:
113
+ - MIT
114
+ metadata: {}
115
+ post_install_message:
116
+ rdoc_options: []
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 1.9.3
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 2.4.3
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: Yet another URL shortening gem
135
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ v����R��Pbx�2�@y�~rT�Q}\������ry���K�6IO1���讅p}V�,��F�k��n{`�~���
2
+ {���Ai��a'�! ��s���>�dV�Evդ�$$3��^:�k)A]H�T��>M�䏓j��2�Hbѓ�ř �;�q^K��|k�,�2��0Q:x����!e��{��i�?n�����R�с�M��#��@���� ����a�B��q6b��*W��_ ~T�,�c�v�;��V