griddleware 0.1.0 → 0.1.1

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.
@@ -0,0 +1,58 @@
1
+ Griddleware: The middleware for Griddle
2
+ =======================================
3
+
4
+ Specifically designed to interact with [Griddle](http://www.github.com/toastyapps/griddle), use griddleware to serve files from `GridFileSystem` to the browser.
5
+
6
+ Installation
7
+ ------------------
8
+
9
+ Griddleware can be used anywhere you would use middleware. Install the gem:
10
+
11
+ gem install griddleware
12
+
13
+ For Rails 2.3.5, add the following to your `environment.rb`:
14
+
15
+ config.middleware.use "Griddleware::GridFile"
16
+
17
+ Griddle::Attachment helpers for the web
18
+ ---------------------------------------
19
+
20
+ A class with a grid attachment:
21
+
22
+ class Document
23
+
24
+ include Griddle::Attachment
25
+
26
+ has_grid_attachment :image, :styles=>{
27
+ :thumb => "50x50#"
28
+ }
29
+
30
+ end
31
+
32
+ Create a document (*See griddle for alternatives*):
33
+
34
+ @document = Document.new
35
+ @document.image = File.new("attached_file.jpg", 'rb')
36
+ @document.save_attached_files
37
+
38
+ Griddleware adds a `url` method to grid attachments:
39
+
40
+ puts @document.image.url
41
+ => /grid/documents/12345/image/attached_file.jpg
42
+
43
+ puts @document.image.medium.url
44
+ => /grid/documents/12345/image/medium/attached_file.jpg
45
+
46
+ Note on Patches/Pull Requests
47
+ -----------------------------
48
+
49
+ * Fork the project.
50
+ * Make your feature addition or bug fix.
51
+ * Add tests for it. This is important so I don’t break it in a future version unintentionally.
52
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
53
+ * Send me a pull request. Bonus points for topic branches.
54
+
55
+ Copyright
56
+ ---------
57
+
58
+ Copyright © 2010 meanmarcus. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{griddleware}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["meanmarcus", "Matt Mongeau"]
@@ -14,19 +14,19 @@ Gem::Specification.new do |s|
14
14
  s.email = %q{conradmr@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.markdown"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
21
  ".gitignore",
22
22
  "LICENSE",
23
- "README.rdoc",
23
+ "README.markdown",
24
24
  "Rakefile",
25
25
  "VERSION",
26
26
  "griddleware.gemspec",
27
27
  "lib/griddleware.rb",
28
28
  "lib/griddleware/browser_helper.rb",
29
- "lib/griddleware/grid_image.rb",
29
+ "lib/griddleware/grid_file.rb",
30
30
  "test/fixtures/baboon.jpg",
31
31
  "test/helper.rb",
32
32
  "test/rails_helper.rb",
@@ -84,7 +84,7 @@ Gem::Specification.new do |s|
84
84
  "test/rails_root/test/fixtures/baboon.jpg",
85
85
  "test/rails_root/test/fixtures/fox.jpg",
86
86
  "test/rails_root/test/fixtures/sample.pdf",
87
- "test/rails_root/test/integration/grid_image_test.rb",
87
+ "test/rails_root/test/integration/grid_file_test.rb",
88
88
  "test/rails_root/test/performance/browsing_test.rb",
89
89
  "test/rails_root/test/test_helper.rb",
90
90
  "test/test_griddleware.rb"
@@ -114,7 +114,7 @@ Gem::Specification.new do |s|
114
114
  "test/rails_root/config/initializers/session_store.rb",
115
115
  "test/rails_root/config/routes.rb",
116
116
  "test/rails_root/db/seeds.rb",
117
- "test/rails_root/test/integration/grid_image_test.rb",
117
+ "test/rails_root/test/integration/grid_file_test.rb",
118
118
  "test/rails_root/test/performance/browsing_test.rb",
119
119
  "test/rails_root/test/test_helper.rb",
120
120
  "test/test_griddleware.rb"
@@ -1,2 +1,2 @@
1
1
  require 'griddleware/browser_helper'
2
- require 'griddleware/grid_image'
2
+ require 'griddleware/grid_file'
@@ -1,5 +1,5 @@
1
1
  module Griddleware
2
- class GridImage
2
+ class GridFile
3
3
 
4
4
  def initialize(app)
5
5
  @app = app
@@ -10,7 +10,7 @@ Rails::Initializer.run do |config|
10
10
 
11
11
  config.load_paths += Dir.glob(File.join(RAILS_ROOT, "..", "..", "lib"))
12
12
 
13
- config.middleware.use "Griddleware::GridImage"
13
+ config.middleware.use "Griddleware::GridFile"
14
14
 
15
15
  # Settings in config/environments/* take precedence over those specified here.
16
16
  # Application configuration should go into files in config/initializers
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
 
3
- class GridImageTest < ActionController::IntegrationTest
3
+ class GridFileTest < ActionController::IntegrationTest
4
4
 
5
5
  context "on GET to /grid/document/:id/:name/:style" do
6
6
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - meanmarcus
@@ -52,18 +52,18 @@ extensions: []
52
52
 
53
53
  extra_rdoc_files:
54
54
  - LICENSE
55
- - README.rdoc
55
+ - README.markdown
56
56
  files:
57
57
  - .document
58
58
  - .gitignore
59
59
  - LICENSE
60
- - README.rdoc
60
+ - README.markdown
61
61
  - Rakefile
62
62
  - VERSION
63
63
  - griddleware.gemspec
64
64
  - lib/griddleware.rb
65
65
  - lib/griddleware/browser_helper.rb
66
- - lib/griddleware/grid_image.rb
66
+ - lib/griddleware/grid_file.rb
67
67
  - test/fixtures/baboon.jpg
68
68
  - test/helper.rb
69
69
  - test/rails_helper.rb
@@ -121,7 +121,7 @@ files:
121
121
  - test/rails_root/test/fixtures/baboon.jpg
122
122
  - test/rails_root/test/fixtures/fox.jpg
123
123
  - test/rails_root/test/fixtures/sample.pdf
124
- - test/rails_root/test/integration/grid_image_test.rb
124
+ - test/rails_root/test/integration/grid_file_test.rb
125
125
  - test/rails_root/test/performance/browsing_test.rb
126
126
  - test/rails_root/test/test_helper.rb
127
127
  - test/test_griddleware.rb
@@ -175,7 +175,7 @@ test_files:
175
175
  - test/rails_root/config/initializers/session_store.rb
176
176
  - test/rails_root/config/routes.rb
177
177
  - test/rails_root/db/seeds.rb
178
- - test/rails_root/test/integration/grid_image_test.rb
178
+ - test/rails_root/test/integration/grid_file_test.rb
179
179
  - test/rails_root/test/performance/browsing_test.rb
180
180
  - test/rails_root/test/test_helper.rb
181
181
  - test/test_griddleware.rb
@@ -1,17 +0,0 @@
1
- = griddleware
2
-
3
- Description goes here.
4
-
5
- == Note on Patches/Pull Requests
6
-
7
- * Fork the project.
8
- * Make your feature addition or bug fix.
9
- * Add tests for it. This is important so I don't break it in a
10
- future version unintentionally.
11
- * Commit, do not mess with rakefile, version, or history.
12
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
- * Send me a pull request. Bonus points for topic branches.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2010 meanmarcus. See LICENSE for details.