puffer 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,7 @@ Puffer was created to help project owner or moderators view and edit all the pro
4
4
 
5
5
  ## Keyfeatures
6
6
 
7
- * Full rails integration. Puffer has no configs, just DSL to create interfaces. And this DLS depends on rails convensions.
7
+ * Full rails integration. Puffer has no configs, just DSL to create interfaces. And this DSL depends on rails convensions.
8
8
  * Flexibility. Puffer designed to be as flexible as possible, so you can create your own modules easily.
9
9
  * I18n. Surely.
10
10
  * Bla bla
@@ -147,3 +147,4 @@ namespace :moderator do
147
147
  resources :posts
148
148
  end
149
149
  </pre>
150
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.13
1
+ 0.0.14
@@ -5,24 +5,11 @@ module Puffer
5
5
  def self.included base
6
6
  base.class_eval do
7
7
  include InstanceMethods
8
- extend ClassMethods
9
8
 
10
9
  helper_method :resource_session, :puffer_navigation, :sidebar_puffer_navigation, :resource, :record, :records
11
10
  end
12
11
  end
13
12
 
14
- module ClassMethods
15
-
16
- def model_name
17
- @model_name ||= ((puffer? and configuration.model) || controller_name.singularize).to_s
18
- end
19
-
20
- def model
21
- @model ||= model_name.classify.constantize
22
- end
23
-
24
- end
25
-
26
13
  module InstanceMethods
27
14
 
28
15
  def puffer_navigation
@@ -43,15 +30,6 @@ module Puffer
43
30
  end if puffer?
44
31
  end
45
32
 
46
- def resource_session
47
- postfix = params[:action] =~ /associated_/ ? params[:action] : ''
48
- name = "#{resource.model_name}#{postfix}".to_sym
49
- session[:resources] ||= {}
50
- session[:resources][name] ||= {}
51
- session[:resources][name][:boolean] ||= {}
52
- session[:resources][name]
53
- end
54
-
55
33
  def resource
56
34
  @resource ||= Puffer::Resource.new params, request
57
35
  end
@@ -18,6 +18,14 @@ module Puffer
18
18
 
19
19
  module ClassMethods
20
20
 
21
+ def model_name
22
+ @model_name ||= ((puffer? and configuration.model) || controller_name.singularize).to_s
23
+ end
24
+
25
+ def model
26
+ @model ||= model_name.classify.constantize if model_name.present?
27
+ end
28
+
21
29
  def view_paths_fallbacks *args
22
30
  temp = Puffer::PathSet.new view_paths
23
31
  temp._fallbacks = args.flatten
@@ -19,8 +19,8 @@ module Puffer
19
19
  @controller_name = controller.controller_name
20
20
  controller_segments = params.delete(:controller).split('/')
21
21
  @prefix = controller_segments.first
22
- @model_name = controller.model_name
23
- @model = controller.model
22
+ @model_name = controller.model_name if controller.puffer?
23
+ @model = controller.model if controller.puffer?
24
24
  @params = params
25
25
  @request = request
26
26
  end
data/puffer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{puffer}
8
- s.version = "0.0.13"
8
+ s.version = "0.0.14"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["pyromaniac"]
12
- s.date = %q{2011-02-07}
12
+ s.date = %q{2011-02-08}
13
13
  s.description = %q{In Soviet Russia puffer admins you}
14
14
  s.email = %q{kinwizard@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puffer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 13
10
- version: 0.0.13
9
+ - 14
10
+ version: 0.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - pyromaniac
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-07 00:00:00 +03:00
18
+ date: 2011-02-08 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency