short 0.2.1 → 0.3.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.
data/README.md CHANGED
@@ -7,3 +7,56 @@ Check it out [here](http://shortener1.heroku.com), but be aware that the css on
7
7
 
8
8
  :edit: the version ^ there is an oldy but a goody. There's been a lot of feature creep since then which would muck up a demo. Very soon there will be a way to disable said feature creep and we'll get a new demo.
9
9
 
10
+ ### Configuration
11
+
12
+ Currently, short uses either environment variables or settings from a config file, ~/.shortener.
13
+
14
+ for the `short` client to work, you only need something like
15
+ <pre>
16
+ ---
17
+ :SHORTENER_URL: http://< your shortener url>
18
+ </pre>
19
+
20
+ checkout `lib/shortener/configuration.rb` for more options that you can set.
21
+
22
+ I'm going to put together a better way of handling this soon, because right now
23
+ it's kind of a mess.
24
+
25
+ ### Usage
26
+
27
+ Use the `short` executable to
28
+
29
+ * start the shortener server
30
+ * shorten a url
31
+ * fetch info on a short
32
+ * delete a short
33
+ * view the index of shorts
34
+ * run a `short` rake task.
35
+
36
+ #### Rake
37
+
38
+ Short provides rake tasks for building and deploying an instance on heroku.
39
+ Once you have `short server` running locally (i.e. you've figured out the conf stuff)
40
+ you can run `short rake heroku:setup` and it will create a git repo of the necessary
41
+ server files, create a heroku app, add the needed addons and push to the created heroku app.
42
+ Run `short rake -T` to see more info.
43
+
44
+
45
+ ### License
46
+
47
+
48
+ <pre>
49
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
50
+ Version 2, December 2004
51
+
52
+ Copyright (C) 20011 Jake Wilkins <jake AT jakewilkins DOT com>
53
+
54
+ Everyone is permitted to copy and distribute verbatim or modified
55
+ copies of this license document, and changing it is allowed as long
56
+ as the name is changed.
57
+
58
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
59
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
+
61
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
62
+ </pre>
@@ -52,7 +52,7 @@ end
52
52
 
53
53
  def show_index
54
54
  index = Shortener::Client.new.index
55
- short_summary = index.map do |v|
55
+ short_summary = index.map do |v|
56
56
  url = v['url'].length > 38 ? "#{v['url'][0..25]}...#{v['url'][-10..-1]}" : "#{v['url']}"
57
57
  "#{v['shortened']} : #{url} #{v['type'].nil? ? '' : ('type: ' + v['type'])}"
58
58
  end.join("\n")
@@ -85,12 +85,15 @@ def usage
85
85
  Usage: shortener COMMAND <arg>
86
86
 
87
87
  a command could be:
88
+ server: start an instance of the shortener server locally.
88
89
  shorten: get a shortened version of <arg>.
89
90
  fetch: get data for <arg> which should be a short.
91
+ delete: delete a short from the index.
90
92
  index: show summary data for all shorts.
93
+ rake: run a shortener rake task. [heroku:build, heroku:setup...]
91
94
 
92
95
  the default command is shorten, so that one could
93
-
96
+
94
97
  shortener www.google.com
95
98
 
96
99
  and the result would be a short for www.google.com
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Shortener
3
3
 
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
5
5
 
6
6
  end
data/short.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "shortener/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "short"
7
+ s.version = Shortener::VERSION
8
+ s.authors = ["Jake Wilkins"]
9
+ s.email = ["jake@jakewilkins.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{A Link Shortener}
12
+ s.description = %q{A (hopefully) easy and handy deployable APIable way to shorten links.}
13
+
14
+ #s.rubyforge_project = "shortener"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ s.add_development_dependency "sinatra"
23
+ s.add_development_dependency "redis-namespace"
24
+ s.add_development_dependency "haml"
25
+ s.add_development_dependency "turn"
26
+ #s.add_runtime_dependency "rest-client"
27
+ end
metadata CHANGED
@@ -1,19 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: short
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - jake
8
+ - Jake Wilkins
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2011-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sinatra
16
+ requirement: &70335546444520 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70335546444520
25
+ - !ruby/object:Gem::Dependency
26
+ name: redis-namespace
27
+ requirement: &70335546443200 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70335546443200
36
+ - !ruby/object:Gem::Dependency
37
+ name: haml
38
+ requirement: &70335546441520 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70335546441520
14
47
  - !ruby/object:Gem::Dependency
15
48
  name: turn
16
- requirement: &70302203079100 !ruby/object:Gem::Requirement
49
+ requirement: &70335546438400 !ruby/object:Gem::Requirement
17
50
  none: false
18
51
  requirements:
19
52
  - - ! '>='
@@ -21,19 +54,19 @@ dependencies:
21
54
  version: '0'
22
55
  type: :development
23
56
  prerelease: false
24
- version_requirements: *70302203079100
25
- description: A (hopefully) easy and handy way to shorten links.
57
+ version_requirements: *70335546438400
58
+ description: A (hopefully) easy and handy deployable APIable way to shorten links.
26
59
  email:
27
- - jake.wilkins@adfitech.com
60
+ - jake@jakewilkins.com
28
61
  executables:
29
- - shortener
62
+ - short
30
63
  extensions: []
31
64
  extra_rdoc_files: []
32
65
  files:
33
66
  - .gitignore
34
67
  - README.md
35
68
  - Rakefile
36
- - bin/shortener
69
+ - bin/short
37
70
  - config.ru
38
71
  - lib/shortener.rb
39
72
  - lib/shortener/client.rb
@@ -68,6 +101,7 @@ files:
68
101
  - lib/shortener/server/views/s3/video.haml
69
102
  - lib/shortener/server/views/upload.haml
70
103
  - lib/shortener/version.rb
104
+ - short.gemspec
71
105
  - tasks/heroku.rake
72
106
  - test/test_client.rb
73
107
  - test/test_configuration.rb
@@ -95,7 +129,7 @@ rubyforge_project:
95
129
  rubygems_version: 1.8.10
96
130
  signing_key:
97
131
  specification_version: 3
98
- summary: Link Shortener
132
+ summary: A Link Shortener
99
133
  test_files:
100
134
  - test/test_client.rb
101
135
  - test/test_configuration.rb