upr 0.2.0 → 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/GIT-VERSION-GEN +1 -1
- data/README +9 -8
- data/Rakefile +41 -2
- data/examples/rails_app-2.3.4/app/controllers/files_controller.rb +1 -1
- data/examples/rails_app-2.3.4/public/stylesheets/site.css +1 -1
- data/lib/upr.rb +1 -1
- data/lib/upr/monitor.rb +4 -5
- data/upr.gemspec +1 -1
- metadata +36 -17
data/GIT-VERSION-GEN
CHANGED
data/README
CHANGED
@@ -6,13 +6,6 @@ several upload progress modules including ones used by leading web
|
|
6
6
|
servers. It allows any Moneta backing store in addition to DRb. There
|
7
7
|
is also a packaged example for using an ActiveRecord model for Rails.
|
8
8
|
|
9
|
-
== Demo
|
10
|
-
|
11
|
-
You can see upr in action at http://upr-demo.bogomips.org/ It will
|
12
|
-
report the size and SHA1 of the file you've uploaded. Much of the demo
|
13
|
-
was stolen from all the existing upload progress examples for other web
|
14
|
-
servers.
|
15
|
-
|
16
9
|
== Web Server Compatibility
|
17
10
|
|
18
11
|
While upr is completely Rack::Lint-compatible, upr is only compatible
|
@@ -23,10 +16,18 @@ handful of concurrency models:
|
|
23
16
|
* ThreadSpawn
|
24
17
|
* ThreadPool
|
25
18
|
* Revactor*
|
19
|
+
* FiberSpawn
|
20
|
+
* FiberPool
|
21
|
+
* RevFiberSpawn
|
22
|
+
* ActorSpawn (Rubinius)
|
26
23
|
|
27
24
|
For use with Revactor, the use of network-based Moneta stores or DRb is
|
28
25
|
only advised if those stores are using Revactor-aware sockets.
|
29
26
|
|
27
|
+
Likewise, with the *FiberSpawn and FiberPool models, any network based stores
|
28
|
+
should be using the wrapper class
|
29
|
+
{Rainbows::Fiber::IO}[http://rainbows.rubyforge.org/Rainbows/Fiber/IO.html]
|
30
|
+
|
30
31
|
== JavaScript/CSS/HTML Compatibility
|
31
32
|
|
32
33
|
The current developer does not react well with GUIs. Thus all (R)HTML,
|
@@ -46,7 +47,7 @@ Contributions to enhance compatibility for more modern things like
|
|
46
47
|
jQuery and HTML5 are very welcome. We would prefer as much as possible
|
47
48
|
to NOT proliferate new AJAX sub-protocols and use existing ones whenever
|
48
49
|
possible. Our current favorite is the Ajax.Pull JavaScript used in
|
49
|
-
|
50
|
+
ry dahl's mongrel_streaming_upload_progress because it only requires a
|
50
51
|
one extra HTTP request to pull all the status notifications.
|
51
52
|
|
52
53
|
== Backend Compatibility
|
data/Rakefile
CHANGED
@@ -24,6 +24,7 @@ def tags
|
|
24
24
|
end
|
25
25
|
|
26
26
|
cgit_url = "http://git.bogomips.org/cgit/upr.git"
|
27
|
+
git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/upr.git'
|
27
28
|
|
28
29
|
desc 'prints news as an Atom feed'
|
29
30
|
task :news_atom do
|
@@ -88,8 +89,6 @@ desc "print release notes for Rubyforge"
|
|
88
89
|
task :release_notes do
|
89
90
|
require 'rubygems'
|
90
91
|
|
91
|
-
git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/upr.git'
|
92
|
-
|
93
92
|
spec = Gem::Specification.load('upr.gemspec')
|
94
93
|
puts spec.description.strip
|
95
94
|
puts ""
|
@@ -117,3 +116,43 @@ task :publish_news do
|
|
117
116
|
rf.login
|
118
117
|
rf.post_news('rainbows', subject, body)
|
119
118
|
end
|
119
|
+
|
120
|
+
desc "post to RAA"
|
121
|
+
task :raa_update do
|
122
|
+
require 'rubygems'
|
123
|
+
require 'net/http'
|
124
|
+
require 'net/netrc'
|
125
|
+
rc = Net::Netrc.locate('upr-raa') or abort "~/.netrc not found"
|
126
|
+
password = rc.password
|
127
|
+
p password
|
128
|
+
|
129
|
+
s = Gem::Specification.load('upr.gemspec')
|
130
|
+
desc = [ s.description.strip ]
|
131
|
+
desc << ""
|
132
|
+
desc << "* #{s.homepage}"
|
133
|
+
desc << "* #{s.email}"
|
134
|
+
desc << "* #{git_url}"
|
135
|
+
desc << "* http://upr-demo.bogomips.org/"
|
136
|
+
desc = desc.join("\n")
|
137
|
+
uri = URI.parse('http://raa.ruby-lang.org/regist.rhtml')
|
138
|
+
form = {
|
139
|
+
:name => s.name,
|
140
|
+
:short_description => s.summary,
|
141
|
+
:version => s.version,
|
142
|
+
:status => 'beta',
|
143
|
+
:owner => s.authors.first,
|
144
|
+
:email => 'upr@bogomips.org',
|
145
|
+
:category_major => 'Library',
|
146
|
+
:category_minor => 'Rack',
|
147
|
+
:url => s.homepage,
|
148
|
+
:download => "http://rubyforge.org/frs/?group_id=8977",
|
149
|
+
:license => "Ruby's",
|
150
|
+
:description_style => 'Plain',
|
151
|
+
:description => desc,
|
152
|
+
:pass => password,
|
153
|
+
:submit => "Update",
|
154
|
+
}
|
155
|
+
res = Net::HTTP.post_form(uri, form)
|
156
|
+
p res
|
157
|
+
puts res.body
|
158
|
+
end
|
data/lib/upr.rb
CHANGED
data/lib/upr/monitor.rb
CHANGED
@@ -5,10 +5,10 @@ module Upr
|
|
5
5
|
# This uses any {Moneta}[http://github.com/wycats/moneta]
|
6
6
|
# store to monitor upload progress.
|
7
7
|
#
|
8
|
-
# Usage (in config.ru with Moneta
|
8
|
+
# Usage (in config.ru with Moneta Memory store):
|
9
9
|
# require 'upr'
|
10
|
-
# require 'moneta
|
11
|
-
# use Upr, :backend => Upr::Monitor.new(Moneta
|
10
|
+
# require 'moneta'
|
11
|
+
# use Upr, :backend => Upr::Monitor.new(Moneta.new(:Memory, :serializer => nil))
|
12
12
|
# run YourApplication.new
|
13
13
|
class Monitor < Struct.new(:moneta)
|
14
14
|
# nuke anything not read/updated in 60 seconds
|
@@ -17,8 +17,7 @@ module Upr
|
|
17
17
|
def initialize(moneta_store = nil)
|
18
18
|
super
|
19
19
|
if moneta_store.nil?
|
20
|
-
|
21
|
-
self.moneta = Moneta::Memory.new
|
20
|
+
self.moneta = Moneta.new(:Memory, :serializer => nil)
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
data/upr.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.require_paths = %w(lib)
|
32
32
|
s.rubyforge_project = %q{rainbows}
|
33
33
|
|
34
|
-
s.add_dependency(%q<moneta
|
34
|
+
s.add_dependency(%q<moneta>, '~>0.7')
|
35
35
|
s.add_dependency(%q<rack>)
|
36
36
|
|
37
37
|
# Folks on intranets sharing humongous files can use Unicorn, too
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- upr hackers
|
@@ -9,29 +15,37 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
13
|
-
default_executable:
|
18
|
+
date: 2013-07-09 00:00:00 Z
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: moneta
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
|
-
- -
|
26
|
+
- - ~>
|
22
27
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
28
|
+
hash: 5
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 7
|
32
|
+
version: "0.7"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
25
35
|
- !ruby/object:Gem::Dependency
|
26
36
|
name: rack
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
30
40
|
requirements:
|
31
41
|
- - ">="
|
32
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
33
46
|
version: "0"
|
34
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
35
49
|
description: |-
|
36
50
|
upr is Rack middleware that allows browser-side upload progress
|
37
51
|
monitoring. It is based on (and should be client-side compatible with)
|
@@ -125,7 +139,6 @@ files:
|
|
125
139
|
- setup.rb
|
126
140
|
- test/test_monitor.rb
|
127
141
|
- upr.gemspec
|
128
|
-
has_rdoc: true
|
129
142
|
homepage: http://upr.bogomips.org/
|
130
143
|
licenses: []
|
131
144
|
|
@@ -137,21 +150,27 @@ rdoc_options:
|
|
137
150
|
require_paths:
|
138
151
|
- lib
|
139
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
140
154
|
requirements:
|
141
155
|
- - ">="
|
142
156
|
- !ruby/object:Gem::Version
|
157
|
+
hash: 3
|
158
|
+
segments:
|
159
|
+
- 0
|
143
160
|
version: "0"
|
144
|
-
version:
|
145
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
146
163
|
requirements:
|
147
164
|
- - ">="
|
148
165
|
- !ruby/object:Gem::Version
|
166
|
+
hash: 3
|
167
|
+
segments:
|
168
|
+
- 0
|
149
169
|
version: "0"
|
150
|
-
version:
|
151
170
|
requirements: []
|
152
171
|
|
153
172
|
rubyforge_project: rainbows
|
154
|
-
rubygems_version: 1.
|
173
|
+
rubygems_version: 1.8.24
|
155
174
|
signing_key:
|
156
175
|
specification_version: 3
|
157
176
|
summary: Upload Progress for Rack
|