lolita 3.1.7 → 3.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  # Thing how to seperate gems for Rails Engine from those that are only for lolita
4
- gem "rails", "~>3.0"
4
+ gem "rails", "~>3.0.7"
5
5
  gem "kaminari", "~>0.12.4"
6
6
  gem "abstract"
7
7
  gem "builder", "~> 2.1.2" #cucumber asks for builder 3 but rails supports 2.1
data/History.rdoc CHANGED
@@ -1,5 +1,9 @@
1
- === Version 3.1.8 / 2011
1
+ === Version 3.1.9 /
2
2
 
3
+ === Version 3.1.8 / 2011-06-15
4
+ * Bug fixes
5
+ * Show layout on info page
6
+
3
7
  === Version 3.1.7 / 2011-06-10
4
8
  * Enhancements
5
9
  * Builder refactored. Now support conditions. (Arturs Meisters)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.7
1
+ 3.1.8
@@ -1,7 +1,10 @@
1
1
  class Lolita::InfoController < ApplicationController
2
2
  @@properties = []
3
+
3
4
  def index
5
+ render :layout => false
4
6
  end
7
+
5
8
  def properties
6
9
  if request.local?
7
10
  render :inline => to_html
@@ -2,7 +2,7 @@
2
2
  # FIXME: move to /tab_types/
3
3
  #
4
4
  %>
5
- <%= form_tag "#", :id=>"tab-form-#{tab.__id__}" do |form| %>
5
+ <%= form_tag "#",:multipart=>true, :id=>"tab-form-#{tab.__id__}",:method => resource.new_record? ? :post : :put do |form| %>
6
6
  <div class="tab-content">
7
7
  <%= render_component :"lolita/configuration/tab", :fields, :tab=>tab %>
8
8
  </div>
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+ match '/lolita' => "lolita/info#index"
3
+ match '/lolita/info/properties' => "lolita/info#properties"
4
+ end
data/lib/lolita.rb CHANGED
@@ -16,11 +16,13 @@ puts "=> Lolita #{LOLITA_VERSION} starting#{defined?(Rails) ? " with Rails" : ""
16
16
  # end
17
17
 
18
18
  require 'abstract'
19
- require 'active_support/core_ext/numeric/time'
20
- require 'active_support/core_ext/date_time/conversions'
21
- require 'active_support/concern'
22
- require 'active_support/callbacks'
23
- require 'active_support/dependencies'
19
+ unless defined?(ActiveSupport)
20
+ require 'active_support/core_ext/numeric/time'
21
+ require 'active_support/core_ext/date_time/conversions'
22
+ require 'active_support/concern'
23
+ require 'active_support/callbacks'
24
+ require 'active_support/dependencies'
25
+ end
24
26
  require 'lolita/errors'
25
27
  require "lolita/hooks"
26
28
  # Require all ruby extensions
@@ -9,14 +9,24 @@ module Lolita
9
9
 
10
10
  def add(dbi,*args,&block)
11
11
  @create_temp_object=true
12
- begin
13
- temp_object=self.const_get(:Base).new(dbi,*args,&block)
14
- rescue Exception => e
15
- raise e
16
- ensure
17
- @create_temp_object=false
12
+ name = nil
13
+ if self == Lolita::Configuration::Tab
14
+ if args && args.first
15
+ name = args.first
16
+ else
17
+ raise ArgumentError, "Define tab with type."
18
+ end
19
+ else
20
+ begin
21
+ temp_object=self.const_get(:Base).new(dbi,*args,&block)
22
+ name =temp_object.type
23
+ rescue Exception => e
24
+ raise e
25
+ ensure
26
+ @create_temp_object=false
27
+ end
18
28
  end
19
- factory(temp_object.type).new(dbi,*args,&block)
29
+ factory(name).new(dbi,*args,&block)
20
30
  end
21
31
 
22
32
 
@@ -30,22 +30,22 @@ module Lolita
30
30
  # is used, than <code>conditions</code> is ignored.
31
31
  def association_values() #TODO test
32
32
  @association_values=if options_for_select
33
- options_for_select
34
- elsif @association
35
- klass=@dbi.association_class_name(@association).camelize.constantize
36
- current_text_method=@text_method || default_text_method(klass)
37
- current_value_method=@value_method || :id
38
- options=@find_options || {}
39
- options[:conditions]||=@conditions
33
+ options_for_select
34
+ elsif @association
35
+ klass=@dbi.association_class_name(@association).camelize.constantize
36
+ current_text_method=@text_method || default_text_method(klass)
37
+ current_value_method=@value_method || :id
38
+ options=@find_options || {}
39
+ options[:conditions]||=@conditions
40
40
 
41
- klass.find(:all,options).map{|r|
42
- [r.send(current_text_method),r.send(current_value_method)]
43
- }
44
- else
45
- []
41
+ klass.find(:all,options).map{|r|
42
+ [r.send(current_text_method),r.send(current_value_method)]
43
+ }
44
+ else
45
+ []
46
+ end
47
+ @association_values
46
48
  end
47
- @association_values
48
- end
49
49
 
50
50
  private
51
51
 
@@ -12,10 +12,6 @@ module ActionDispatch::Routing
12
12
  end
13
13
  Lolita.run(:before_routes_loaded)
14
14
  draw_without_lolita *args,&block
15
- draw_without_lolita *args, do
16
- match '/lolita' => "lolita/info#index"
17
- match '/lolita/info/properties' => "lolita/info#properties"
18
- end
19
15
  Lolita.run(:after_routes_loaded)
20
16
  end
21
17
 
data/lolita.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lolita}
8
- s.version = "3.1.7"
8
+ s.version = "3.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ITHouse (Latvia) and Arturs Meisters"]
12
- s.date = %q{2011-06-10}
12
+ s.date = %q{2011-06-15}
13
13
  s.description = %q{Great Rails CMS, that turns your business logic into good-looking, fully functional workspace. }
14
14
  s.email = %q{support@ithouse.lv}
15
15
  s.extra_rdoc_files = [
@@ -86,6 +86,7 @@ Gem::Specification.new do |s|
86
86
  "config/locales/default/lv.yml",
87
87
  "config/locales/en.yml",
88
88
  "config/locales/lv.yml",
89
+ "config/routes.rb",
89
90
  "db/seed.rb",
90
91
  "features/create_page.feature",
91
92
  "features/step_definitions/lolita_steps.rb",
@@ -387,7 +388,7 @@ Gem::Specification.new do |s|
387
388
  s.specification_version = 3
388
389
 
389
390
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
390
- s.add_runtime_dependency(%q<rails>, ["~> 3.0"])
391
+ s.add_runtime_dependency(%q<rails>, ["~> 3.0.7"])
391
392
  s.add_runtime_dependency(%q<kaminari>, ["~> 0.12.4"])
392
393
  s.add_runtime_dependency(%q<abstract>, [">= 0"])
393
394
  s.add_runtime_dependency(%q<builder>, ["~> 2.1.2"])
@@ -402,7 +403,7 @@ Gem::Specification.new do |s|
402
403
  s.add_development_dependency(%q<database_cleaner>, [">= 0"])
403
404
  s.add_development_dependency(%q<akephalos>, [">= 0"])
404
405
  else
405
- s.add_dependency(%q<rails>, ["~> 3.0"])
406
+ s.add_dependency(%q<rails>, ["~> 3.0.7"])
406
407
  s.add_dependency(%q<kaminari>, ["~> 0.12.4"])
407
408
  s.add_dependency(%q<abstract>, [">= 0"])
408
409
  s.add_dependency(%q<builder>, ["~> 2.1.2"])
@@ -418,7 +419,7 @@ Gem::Specification.new do |s|
418
419
  s.add_dependency(%q<akephalos>, [">= 0"])
419
420
  end
420
421
  else
421
- s.add_dependency(%q<rails>, ["~> 3.0"])
422
+ s.add_dependency(%q<rails>, ["~> 3.0.7"])
422
423
  s.add_dependency(%q<kaminari>, ["~> 0.12.4"])
423
424
  s.add_dependency(%q<abstract>, [">= 0"])
424
425
  s.add_dependency(%q<builder>, ["~> 2.1.2"])
@@ -1,7 +1,8 @@
1
1
  $(function(){
2
2
  $.ajaxSetup({
3
3
  headers:{
4
- "X-CSRF-Token": $("meta[name='csrf-token']").attr("content")
4
+ "X-CSRF-Token": $("meta[name='csrf-token']").attr("content"),
5
+ "lolita_xhr": "true"
5
6
  }
6
7
  })
7
8
  $("#flash").slideUp("fast");
@@ -34,11 +34,8 @@ describe Lolita::Configuration::Tab do
34
34
 
35
35
  describe "add tab" do
36
36
  it "should recognize type of tab added and create it as a related class object" do
37
- Lolita::Configuration::Tab.add(@dbi){ field(:email)}.class.to_s.should=="Lolita::Configuration::Tab::Default"
37
+ Lolita::Configuration::Tab.add(@dbi,:default){ field(:email)}.class.to_s.should=="Lolita::Configuration::Tab::Default"
38
38
  Lolita::Configuration::Tab.add(@dbi,:my).class.to_s.should == "Lolita::Configuration::Tab::My"
39
- Lolita::Configuration::Tab.add(@dbi) {
40
- type :my
41
- }.class.to_s.should == "Lolita::Configuration::Tab::My"
42
39
  end
43
40
 
44
41
  it "should raise error when tab is not recognized" do
@@ -66,7 +63,7 @@ describe Lolita::Configuration::Tab do
66
63
 
67
64
  it "should raise error when no fields are given for default type tab" do
68
65
  lambda{
69
- Lolita::Configuration::Tab.add(@dbi)
66
+ Lolita::Configuration::Tab.add(@dbi,:default)
70
67
  }.should raise_error Lolita::NoFieldsGivenError
71
68
  end
72
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolita
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 3.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,23 +9,23 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-10 00:00:00.000000000 +03:00
12
+ date: 2011-06-15 00:00:00.000000000 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &76216020 !ruby/object:Gem::Requirement
17
+ requirement: &82526620 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: '3.0'
22
+ version: 3.0.7
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *76216020
25
+ version_requirements: *82526620
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: kaminari
28
- requirement: &76215300 !ruby/object:Gem::Requirement
28
+ requirement: &82525820 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.12.4
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *76215300
36
+ version_requirements: *82525820
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: abstract
39
- requirement: &76214830 !ruby/object:Gem::Requirement
39
+ requirement: &82524740 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *76214830
47
+ version_requirements: *82524740
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: builder
50
- requirement: &76214280 !ruby/object:Gem::Requirement
50
+ requirement: &82524030 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 2.1.2
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *76214280
58
+ version_requirements: *82524030
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: jeweler
61
- requirement: &76213800 !ruby/object:Gem::Requirement
61
+ requirement: &82523460 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 1.5.2
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *76213800
69
+ version_requirements: *82523460
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
- requirement: &76213500 !ruby/object:Gem::Requirement
72
+ requirement: &82522850 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 2.6.0
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *76213500
80
+ version_requirements: *82522850
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rspec-rails
83
- requirement: &76213200 !ruby/object:Gem::Requirement
83
+ requirement: &82522090 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: 2.6.0
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *76213200
91
+ version_requirements: *82522090
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: factory_girl
94
- requirement: &76212630 !ruby/object:Gem::Requirement
94
+ requirement: &82521240 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *76212630
102
+ version_requirements: *82521240
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: ffaker
105
- requirement: &76211740 !ruby/object:Gem::Requirement
105
+ requirement: &82520260 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *76211740
113
+ version_requirements: *82520260
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: ruby-debug19
116
- requirement: &76211450 !ruby/object:Gem::Requirement
116
+ requirement: &82492180 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *76211450
124
+ version_requirements: *82492180
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: cucumber-rails
127
- requirement: &76211100 !ruby/object:Gem::Requirement
127
+ requirement: &82491400 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ! '>='
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: '0'
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *76211100
135
+ version_requirements: *82491400
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: capybara
138
- requirement: &76210810 !ruby/object:Gem::Requirement
138
+ requirement: &82490780 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - ! '>='
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: '0'
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *76210810
146
+ version_requirements: *82490780
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: database_cleaner
149
- requirement: &76210510 !ruby/object:Gem::Requirement
149
+ requirement: &82490200 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ! '>='
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: '0'
155
155
  type: :development
156
156
  prerelease: false
157
- version_requirements: *76210510
157
+ version_requirements: *82490200
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: akephalos
160
- requirement: &76210170 !ruby/object:Gem::Requirement
160
+ requirement: &82486060 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - ! '>='
@@ -165,7 +165,7 @@ dependencies:
165
165
  version: '0'
166
166
  type: :development
167
167
  prerelease: false
168
- version_requirements: *76210170
168
+ version_requirements: *82486060
169
169
  description: ! 'Great Rails CMS, that turns your business logic into good-looking,
170
170
  fully functional workspace. '
171
171
  email: support@ithouse.lv
@@ -244,6 +244,7 @@ files:
244
244
  - config/locales/default/lv.yml
245
245
  - config/locales/en.yml
246
246
  - config/locales/lv.yml
247
+ - config/routes.rb
247
248
  - db/seed.rb
248
249
  - features/create_page.feature
249
250
  - features/step_definitions/lolita_steps.rb
@@ -497,7 +498,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
497
498
  version: '0'
498
499
  segments:
499
500
  - 0
500
- hash: 23472445
501
+ hash: -957983409
501
502
  required_rubygems_version: !ruby/object:Gem::Requirement
502
503
  none: false
503
504
  requirements: