imagine 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -34,4 +34,9 @@ In another terminal, once that's done, you can:
34
34
  bundle exec rspec spec
35
35
 
36
36
  ## License
37
- This project rocks and uses MIT-LICENSE.
37
+ This project uses MIT-LICENSE.
38
+
39
+ ## Contributors
40
+ Josh Adams (josh@isotope11.com)
41
+
42
+ Some code (plugin system, .travis.yml) lifted ungraciously from http://github.com/resolve/refinerycms. Those guys are awesome.
@@ -5,6 +5,7 @@ module Imagine
5
5
 
6
6
  def show
7
7
  load_album
8
+ return render_show_view
8
9
  end
9
10
 
10
11
  def new
@@ -14,8 +15,7 @@ module Imagine
14
15
  def create
15
16
  load_new_album
16
17
  if ::Imagine::Warehouses::Album.save(@album)
17
- flash[:notice] = "Album has been created!"
18
- redirect_to @album
18
+ redirect_to @album, :notice => "Album has been created!"
19
19
  else
20
20
  flash.now[:error] = "There was a problem creating the album."
21
21
  render :action => 'new'
@@ -30,5 +30,13 @@ module Imagine
30
30
  def load_album
31
31
  @album = ::Imagine::Warehouses::Album.find(params[:id])
32
32
  end
33
+
34
+ def render_show_view
35
+ if params[:plugin]
36
+ render :action => "/#{params[:plugin]}/show"
37
+ else
38
+ render :action => 'show'
39
+ end
40
+ end
33
41
  end
34
42
  end
@@ -13,8 +13,7 @@ module Imagine
13
13
  def create
14
14
  load_new_image
15
15
  if ::Imagine::Warehouses::Image.save(@image)
16
- flash[:notice] = "Image has been attached!"
17
- redirect_to [@album, @image]
16
+ redirect_to [@album, @image], :notice => "Image has been attached!"
18
17
  else
19
18
  flash.now[:error] = "There was a problem creating the image."
20
19
  render :action => 'new'
@@ -0,0 +1,8 @@
1
+ %h2= @album.name
2
+ %h3 Basic List View
3
+
4
+ .images
5
+ - @album.images.each do |image|
6
+ = render :partial => 'imagine/images/basic_list_view/image', :object => image
7
+
8
+ = link_to "New Image", new_album_image_path(@album)
@@ -0,0 +1 @@
1
+ = image_tag image.file.url
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{imagine-basic_list_view}
5
- s.version = %q{0.1.1}
5
+ s.version = %q{0.1.2}
6
6
  s.summary = %q{Basic list view for Imagine}
7
7
  s.description = %q{The default album view for Imagine. Just lists images one after another}
8
8
  s.date = %q{2011-08-28}
@@ -1,13 +1,5 @@
1
1
  module Imagine
2
2
  module BasicListView
3
-
4
- class << self
5
- attr_accessor :root
6
- def root
7
- @root ||= Pathname.new(File.expand_path('../../', __FILE__))
8
- end
9
- end
10
-
11
3
  class Engine < ::Rails::Engine
12
4
  isolate_namespace ::Imagine
13
5
 
@@ -16,7 +8,7 @@ module Imagine
16
8
  plugin.pathname = root
17
9
  plugin.name = 'imagine_basic_list_view'
18
10
  plugin.directory = 'basic_list_view'
19
- plugin.version = %q{0.0.1}
11
+ plugin.version = %q{0.1.2}
20
12
  end
21
13
  end
22
14
 
@@ -5,43 +5,10 @@ module Imagine
5
5
  @plugins = []
6
6
  end
7
7
 
8
- def find_by_name(name)
9
- self.detect { |plugin| plugin.name == name }
10
- end
11
- alias :[] :find_by_name
12
-
13
- def names
14
- self.map(&:name)
15
- end
16
-
17
- def pathnames
18
- self.map(&:pathname).compact.uniq
19
- end
20
-
21
8
  class << self
22
- def active
23
- @active_plugins ||= self.new
24
- end
25
-
26
9
  def registered
27
10
  @registered_plugins ||= self.new
28
11
  end
29
-
30
- def activate(name)
31
- active << registered[name] if registered[name] && !active[name]
32
- end
33
-
34
- def deactivate(name)
35
- active.delete_if {|p| p.name == name}
36
- end
37
-
38
- def set_active(names)
39
- @active_plugins = self.new
40
-
41
- names.each do |name|
42
- activate(name)
43
- end
44
- end
45
12
  end
46
13
  end
47
14
  end
@@ -1,7 +1,7 @@
1
1
  module Imagine
2
2
  class << self
3
3
  def version
4
- %q{0.1.1}
4
+ %q{0.1.2}
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-08-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: imagine-basic_list_view
16
- requirement: &12852000 !ruby/object:Gem::Requirement
16
+ requirement: &21184540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *12852000
24
+ version_requirements: *21184540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: haml-rails
27
- requirement: &12851580 !ruby/object:Gem::Requirement
27
+ requirement: &21184120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *12851580
35
+ version_requirements: *21184120
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dragonfly
38
- requirement: &12918360 !ruby/object:Gem::Requirement
38
+ requirement: &21183580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *12918360
46
+ version_requirements: *21183580
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rack-cache
49
- requirement: &12917860 !ruby/object:Gem::Requirement
49
+ requirement: &21183080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.5.3
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *12917860
57
+ version_requirements: *21183080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec-rails
60
- requirement: &12917400 !ruby/object:Gem::Requirement
60
+ requirement: &21238020 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '2.5'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *12917400
68
+ version_requirements: *21238020
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: capybara
71
- requirement: &12917020 !ruby/object:Gem::Requirement
71
+ requirement: &21237640 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *12917020
79
+ version_requirements: *21237640
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: factory_girl
82
- requirement: &12916560 !ruby/object:Gem::Requirement
82
+ requirement: &21237180 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *12916560
90
+ version_requirements: *21237180
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: spork
93
- requirement: &12916140 !ruby/object:Gem::Requirement
93
+ requirement: &21236760 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *12916140
101
+ version_requirements: *21236760
102
102
  description: Imagine can be dropped into an app to provide albums and images in your
103
103
  app. It supports extensions to specify new view styles.
104
104
  email: josh@isotope11.com
@@ -129,6 +129,8 @@ files:
129
129
  - app/helpers/imagine/application_helper.rb
130
130
  - basic_list_view/imagine-basic_list_view.gemspec
131
131
  - basic_list_view/imagine-basic_list_view-0.1.1.gem
132
+ - basic_list_view/app/views/imagine/images/basic_list_view/_image.html.haml
133
+ - basic_list_view/app/views/imagine/albums/basic_list_view/show.html.haml
132
134
  - basic_list_view/lib/imagine-basic_list_view.rb
133
135
  - MIT-LICENSE
134
136
  - Rakefile