media_gallery 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -54
- data/lib/media_gallery/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d443c952fab62c79a265ef111c88f26537f6f79a
|
4
|
+
data.tar.gz: b0663082367eaad50c7ff4dcaff339636d391a56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9799352c1beaa08a381758d545331d4d5350fd342e3a31bf7edc2c0b0bf6bbe40d8494338e6f4b9756f2048aec0e8d5be0830e8350746072d69b9c6ef145c1b
|
7
|
+
data.tar.gz: bef257b487d175170b64da42448b9cc187b5fb0f2ef69309d836eafdf0c01f2ffc860b2b65e5d3447eec9f70518aeb076aedaa10f9215d574fbb7e53d5990ab0
|
data/README.md
CHANGED
@@ -2,9 +2,6 @@
|
|
2
2
|
This gem provides a Rails engine allowing for the storage of images on Amazon S3. Images are organized in galleries. All interactions are done through a simple REST API.
|
3
3
|
|
4
4
|
## Usage
|
5
|
-
This section goes over the internals of the engine (i.e. how to integrate it) and the REST API itself (io.e. how to interact with the gallery). It also describes how to run the unit and integration tests (if you so desire).
|
6
|
-
|
7
|
-
### Internals
|
8
5
|
As this is a Rails engine, you need to first mount the engine. This can be done by modifying your config/routes.rb file. You should add a mount point, something like:
|
9
6
|
|
10
7
|
```ruby
|
@@ -30,58 +27,8 @@ MediaGallery::ApplicationController.class_eval do
|
|
30
27
|
end
|
31
28
|
end
|
32
29
|
```
|
33
|
-
### REST API
|
34
|
-
The media_gallery uses a straightforward REST mechanism. Here are a few samples:
|
35
|
-
|
36
|
-
#### Creating gallery
|
37
|
-
|
38
|
-
```json
|
39
|
-
Request -> POST .../media_gallery/galleries
|
40
|
-
{
|
41
|
-
"gallery": {
|
42
|
-
"description": "an updated text for description."
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
Response ->
|
47
|
-
{
|
48
|
-
"id": 1,
|
49
|
-
"name": "jdoe_gallery",
|
50
|
-
"description": "stores images for joe doe",
|
51
|
-
"nbImages": 0,
|
52
|
-
"createdAt": "2018-03-02T14:13:19.805Z"
|
53
|
-
}
|
54
|
-
```
|
55
|
-
|
56
|
-
#### Updating a gallery
|
57
|
-
|
58
|
-
```json
|
59
|
-
Request -> PUT .../media_gallery/galleries/1
|
60
|
-
{
|
61
|
-
"name": "jdoe_gallery",
|
62
|
-
"description": "stores images for joe doe"
|
63
|
-
}
|
64
|
-
|
65
|
-
Response ->
|
66
|
-
{
|
67
|
-
"id": 1,
|
68
|
-
"ownable_id": 1,
|
69
|
-
"ownable_type": "User",
|
70
|
-
"description": "an updated text for description.",
|
71
|
-
"name": "jdoe_gallery",
|
72
|
-
"created_at": "2018-03-01T14:20:48.117Z",
|
73
|
-
"updated_at": "2018-03-01T14:21:38.612Z"
|
74
|
-
}
|
75
|
-
```
|
76
|
-
|
77
|
-
#### Deleting a gallery
|
78
|
-
|
79
|
-
```json
|
80
|
-
Request -> DELETE .../media_gallery/galleries/1
|
81
|
-
Response -> (Standard HTTP code, basically 200 or something equivalent)
|
82
|
-
```
|
83
|
-
|
84
30
|
|
31
|
+
You can check some API samples on the wiki page.
|
85
32
|
|
86
33
|
## Installation
|
87
34
|
Add this line to your application's Gemfile:
|
@@ -100,6 +47,12 @@ Or install it yourself as:
|
|
100
47
|
$ gem install media_gallery
|
101
48
|
```
|
102
49
|
|
50
|
+
You'll also need to ensure that the associated migrations are run. You can do this with the following:
|
51
|
+
|
52
|
+
```bash
|
53
|
+
bin/rails media_gallery:install:migrations
|
54
|
+
bin/rails db:migrate SCOPE=media_gallery
|
55
|
+
```
|
103
56
|
## Contributing
|
104
57
|
Contribution directions go here.
|
105
58
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: media_gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Beauvais
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|