postgresql_lo_streamer 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # postgresql_lo_streamer [![Build Status](https://secure.travis-ci.org/diogob/postgresql_lo_streamer.png)](http://travis-ci.org/diogob/postgresql_lo_streamer)
2
+
3
+ This gem adds to your application a controller that can read PostgreSQL Large Objects and stream them to a HTTP client.
4
+
5
+ For more information on PostgreSQL Large Objects you can take a look at the [oficial docs](http://www.postgresql.org/docs/9.2/static/largeobjects.html)
6
+
7
+ ## Installation
8
+
9
+ Add it to your Gemfile:
10
+
11
+ gem 'postgresql_lo_streamer'
12
+
13
+
14
+ Add to your `config/routes.rb` the mount url where you are going to retrieve the files.
15
+ The following example will create a route `/image_file/:id` where :id is the oid of the Large Object in the database:
16
+
17
+ mount PostgresqlLoStreamer::Engine => "/image_file"
18
+
19
+ ## Using it with carrierwave-postgresql
20
+
21
+ If you are storing your files in the database using the [carrierwave-postgresql](http://diogob.github.com/carrierwave-postgresql/) gem, then your model will generate an URL like `/<mode_name>_<attribute_name>/<oid>`.
22
+
23
+ So, for our previous example, if you have a model called `Image`, with and attribute called `file` (which is the oid referencing the Large Object), then the model will generate the URL matching our example. If you have more than one large object attribute in your database you can mount this engine multiple times with different URLs.
24
+
25
+ ## Contributing to postgresql_lo_streamer
26
+
27
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
28
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
29
+ * Fork the project.
30
+ * Start a feature/bugfix branch.
31
+ * Commit and push until you are happy with your contribution.
32
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
33
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
34
+
35
+ ## Copyright
36
+
37
+ Copyright (c) 2012 Diogo Biazus. See MIT-LICENSE for
38
+ further details.
39
+
data/Rakefile CHANGED
@@ -25,3 +25,15 @@ end
25
25
 
26
26
  Bundler::GemHelper.install_tasks
27
27
 
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.rcov = true
37
+ end
38
+
39
+ task :default => :spec
@@ -1,3 +1,3 @@
1
1
  module PostgresqlLoStreamer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgresql_lo_streamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -75,7 +75,7 @@ files:
75
75
  - lib/tasks/postgresql_lo_streamer_tasks.rake
76
76
  - MIT-LICENSE
77
77
  - Rakefile
78
- - README.rdoc
78
+ - README.md
79
79
  homepage: https://github.com/diogob/postgresql_lo_streamer
80
80
  licenses: []
81
81
  post_install_message:
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: -2308992678537270647
93
+ hash: -2648312008717080371
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  segments:
101
101
  - 0
102
- hash: -2308992678537270647
102
+ hash: -2648312008717080371
103
103
  requirements: []
104
104
  rubyforge_project:
105
105
  rubygems_version: 1.8.24
data/README.rdoc DELETED
@@ -1,3 +0,0 @@
1
- = PostgresqlLoStreamer
2
-
3
- This project rocks and uses MIT-LICENSE.