merb-photos 0.1.2 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -2
- data/Rakefile +1 -1
- data/app/controllers/photos.rb +0 -5
- data/lib/merb-photos.rb +1 -56
- metadata +2 -2
data/README
CHANGED
@@ -21,8 +21,6 @@ a
|
|
21
21
|
Merb::BootLoader.before_app_loads do
|
22
22
|
Merb::Slices::config[:merb_photos][:title] = 'Photos' #Title of the index page and/or tab.
|
23
23
|
Merb::Slices::config[:merb_photos][:flickr_user_name] = 'your_user_name' #Flickr user name.
|
24
|
-
Merb::Slices::config[:merb_photos][:flickr_api_key] = '********************************' #Flickr API key.
|
25
|
-
Merb::Slices::config[:merb_photos][:flickr_shared_secret] = '****************' #Flickr shared secret.
|
26
24
|
end
|
27
25
|
|
28
26
|
esc : wq
|
data/Rakefile
CHANGED
data/app/controllers/photos.rb
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
class MerbPhotos::Photos < MerbPhotos::Application
|
2
|
-
|
3
|
-
load_dependency 'flickraw'
|
4
2
|
|
5
|
-
FlickRaw.api_key = MerbPhotos[:flickr_api_key]
|
6
|
-
FlickRaw.shared_secret = MerbPhotos[:flickr_shared_secret]
|
7
|
-
|
8
3
|
def index
|
9
4
|
@photosets = flickr.photosets.getList :user_id => user_id
|
10
5
|
photoset_id = params[:photoset_id] || @photosets.first.id
|
data/lib/merb-photos.rb
CHANGED
@@ -2,55 +2,15 @@ if defined?(Merb::Plugins)
|
|
2
2
|
|
3
3
|
$:.unshift File.dirname(__FILE__)
|
4
4
|
|
5
|
-
|
5
|
+
load_dependencies 'flickraw', 'merb-ui'
|
6
6
|
Merb::Plugins.add_rakefiles "merb-photos/merbtasks", "merb-photos/slicetasks", "merb-photos/spectasks"
|
7
7
|
|
8
|
-
# Register the Slice for the current host application
|
9
8
|
Merb::Slices::register(__FILE__)
|
10
9
|
|
11
|
-
# Slice configuration - set this in a before_app_loads callback.
|
12
|
-
# By default a Slice uses its own layout, so you can swicht to
|
13
|
-
# the main application layout or no layout at all if needed.
|
14
|
-
#
|
15
|
-
# Configuration options:
|
16
|
-
# :layout - the layout to use; defaults to :merb-photos
|
17
|
-
# :mirror - which path component types to use on copy operations; defaults to all
|
18
10
|
Merb::Slices::config[:merb_photos][:layout] ||= :application
|
19
11
|
|
20
|
-
# All Slice code is expected to be namespaced inside a module
|
21
12
|
module MerbPhotos
|
22
13
|
|
23
|
-
# Slice metadata
|
24
|
-
self.description = "Merb UI Photos"
|
25
|
-
self.version = "1.0"
|
26
|
-
self.author = "UI Poet"
|
27
|
-
|
28
|
-
# Stub classes loaded hook - runs before LoadClasses BootLoader
|
29
|
-
# right after a slice's classes have been loaded internally.
|
30
|
-
def self.loaded
|
31
|
-
end
|
32
|
-
|
33
|
-
# Initialization hook - runs before AfterAppLoads BootLoader
|
34
|
-
def self.init
|
35
|
-
end
|
36
|
-
|
37
|
-
# Activation hook - runs after AfterAppLoads BootLoader
|
38
|
-
def self.activate
|
39
|
-
end
|
40
|
-
|
41
|
-
# Deactivation hook - triggered by Merb::Slices.deactivate(MerbPhotos)
|
42
|
-
def self.deactivate
|
43
|
-
end
|
44
|
-
|
45
|
-
# Setup routes inside the host application
|
46
|
-
#
|
47
|
-
# @param scope<Merb::Router::Behaviour>
|
48
|
-
# Routes will be added within this scope (namespace). In fact, any
|
49
|
-
# router behaviour is a valid namespace, so you can attach
|
50
|
-
# routes at any level of your router setup.
|
51
|
-
#
|
52
|
-
# @note prefix your named routes with :merb_photos_
|
53
|
-
# to avoid potential conflicts with global named routes.
|
54
14
|
def self.setup_router(scope)
|
55
15
|
scope.to(:controller => 'photos') do |p|
|
56
16
|
p.match('/photo').to(:action => 'photo').name(:photo)
|
@@ -60,21 +20,6 @@ if defined?(Merb::Plugins)
|
|
60
20
|
|
61
21
|
end
|
62
22
|
|
63
|
-
# Setup the slice layout for MerbPhotos
|
64
|
-
#
|
65
|
-
# Use MerbPhotos.push_path and MerbPhotos.push_app_path
|
66
|
-
# to set paths to merb-photos-level and app-level paths. Example:
|
67
|
-
#
|
68
|
-
# MerbPhotos.push_path(:application, MerbPhotos.root)
|
69
|
-
# MerbPhotos.push_app_path(:application, Merb.root / 'slices' / 'merb-photos')
|
70
|
-
# ...
|
71
|
-
#
|
72
|
-
# Any component path that hasn't been set will default to MerbPhotos.root
|
73
|
-
#
|
74
|
-
# Or just call setup_default_structure! to setup a basic Merb MVC structure.
|
75
23
|
MerbPhotos.setup_default_structure!
|
76
24
|
|
77
|
-
# Add dependencies for other MerbPhotos classes below. Example:
|
78
|
-
# dependency "merb-photos/other"
|
79
|
-
|
80
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb-photos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: "0.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uipoet
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-05 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|