panoramic 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +6 -0
- data/Gemfile +3 -11
- data/Gemfile.lock +59 -52
- data/panoramic.gemspec +7 -2
- data/spec/controllers/rendering_spec.rb +3 -3
- data/spec/orm/active_record_spec.rb +7 -3
- data/spec/resolver_spec.rb +2 -2
- data/spec/support/factories.rb +10 -7
- metadata +97 -8
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,14 +1,6 @@
|
|
1
|
-
source
|
2
|
-
|
3
|
-
gem "rails", "3.2.0"
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
4
3
|
|
5
4
|
group :test do
|
6
|
-
gem
|
7
|
-
gem 'factory_girl'
|
8
|
-
gem 'simplecov'
|
9
|
-
end
|
10
|
-
|
11
|
-
group :development, :test do
|
12
|
-
gem "sqlite3"
|
13
|
-
gem 'rspec-rails', '~> 2.8.0'
|
5
|
+
gem 'rake'
|
14
6
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
panoramic (0.0.4)
|
5
|
+
rails (>= 3.0.7)
|
6
|
+
|
1
7
|
GEM
|
2
8
|
remote: http://rubygems.org/
|
3
9
|
specs:
|
4
|
-
actionmailer (3.2.
|
5
|
-
actionpack (= 3.2.
|
6
|
-
mail (~> 2.4.
|
7
|
-
actionpack (3.2.
|
8
|
-
activemodel (= 3.2.
|
9
|
-
activesupport (= 3.2.
|
10
|
+
actionmailer (3.2.6)
|
11
|
+
actionpack (= 3.2.6)
|
12
|
+
mail (~> 2.4.4)
|
13
|
+
actionpack (3.2.6)
|
14
|
+
activemodel (= 3.2.6)
|
15
|
+
activesupport (= 3.2.6)
|
10
16
|
builder (~> 3.0.0)
|
11
17
|
erubis (~> 2.7.0)
|
12
|
-
journey (~> 1.0.
|
18
|
+
journey (~> 1.0.1)
|
13
19
|
rack (~> 1.4.0)
|
14
|
-
rack-cache (~> 1.
|
20
|
+
rack-cache (~> 1.2)
|
15
21
|
rack-test (~> 0.6.1)
|
16
|
-
sprockets (~> 2.1.
|
17
|
-
activemodel (3.2.
|
18
|
-
activesupport (= 3.2.
|
22
|
+
sprockets (~> 2.1.3)
|
23
|
+
activemodel (3.2.6)
|
24
|
+
activesupport (= 3.2.6)
|
19
25
|
builder (~> 3.0.0)
|
20
|
-
activerecord (3.2.
|
21
|
-
activemodel (= 3.2.
|
22
|
-
activesupport (= 3.2.
|
23
|
-
arel (~> 3.0.
|
26
|
+
activerecord (3.2.6)
|
27
|
+
activemodel (= 3.2.6)
|
28
|
+
activesupport (= 3.2.6)
|
29
|
+
arel (~> 3.0.2)
|
24
30
|
tzinfo (~> 0.3.29)
|
25
|
-
activeresource (3.2.
|
26
|
-
activemodel (= 3.2.
|
27
|
-
activesupport (= 3.2.
|
28
|
-
activesupport (3.2.
|
31
|
+
activeresource (3.2.6)
|
32
|
+
activemodel (= 3.2.6)
|
33
|
+
activesupport (= 3.2.6)
|
34
|
+
activesupport (3.2.6)
|
29
35
|
i18n (~> 0.6)
|
30
36
|
multi_json (~> 1.0)
|
31
|
-
arel (3.0.
|
37
|
+
arel (3.0.2)
|
32
38
|
builder (3.0.0)
|
33
39
|
capybara (1.1.2)
|
34
40
|
mime-types (>= 1.16)
|
@@ -46,54 +52,54 @@ GEM
|
|
46
52
|
ffi (1.0.11)
|
47
53
|
hike (1.2.1)
|
48
54
|
i18n (0.6.0)
|
49
|
-
journey (1.0.
|
50
|
-
json (1.
|
51
|
-
mail (2.4.
|
55
|
+
journey (1.0.4)
|
56
|
+
json (1.7.3)
|
57
|
+
mail (2.4.4)
|
52
58
|
i18n (>= 0.4.0)
|
53
59
|
mime-types (~> 1.16)
|
54
60
|
treetop (~> 1.4.8)
|
55
|
-
mime-types (1.
|
61
|
+
mime-types (1.19)
|
56
62
|
multi_json (1.0.4)
|
57
63
|
nokogiri (1.5.0)
|
58
64
|
polyglot (0.3.3)
|
59
65
|
rack (1.4.1)
|
60
|
-
rack-cache (1.
|
66
|
+
rack-cache (1.2)
|
61
67
|
rack (>= 0.4)
|
62
68
|
rack-ssl (1.3.2)
|
63
69
|
rack
|
64
70
|
rack-test (0.6.1)
|
65
71
|
rack (>= 1.0)
|
66
|
-
rails (3.2.
|
67
|
-
actionmailer (= 3.2.
|
68
|
-
actionpack (= 3.2.
|
69
|
-
activerecord (= 3.2.
|
70
|
-
activeresource (= 3.2.
|
71
|
-
activesupport (= 3.2.
|
72
|
+
rails (3.2.6)
|
73
|
+
actionmailer (= 3.2.6)
|
74
|
+
actionpack (= 3.2.6)
|
75
|
+
activerecord (= 3.2.6)
|
76
|
+
activeresource (= 3.2.6)
|
77
|
+
activesupport (= 3.2.6)
|
72
78
|
bundler (~> 1.0)
|
73
|
-
railties (= 3.2.
|
74
|
-
railties (3.2.
|
75
|
-
actionpack (= 3.2.
|
76
|
-
activesupport (= 3.2.
|
79
|
+
railties (= 3.2.6)
|
80
|
+
railties (3.2.6)
|
81
|
+
actionpack (= 3.2.6)
|
82
|
+
activesupport (= 3.2.6)
|
77
83
|
rack-ssl (~> 1.3.2)
|
78
84
|
rake (>= 0.8.7)
|
79
85
|
rdoc (~> 3.4)
|
80
|
-
thor (
|
86
|
+
thor (>= 0.14.6, < 2.0)
|
81
87
|
rake (0.9.2.2)
|
82
88
|
rdoc (3.12)
|
83
89
|
json (~> 1.4)
|
84
|
-
rspec (2.
|
85
|
-
rspec-core (~> 2.
|
86
|
-
rspec-expectations (~> 2.
|
87
|
-
rspec-mocks (~> 2.
|
88
|
-
rspec-core (2.
|
89
|
-
rspec-expectations (2.
|
90
|
-
diff-lcs (~> 1.1.
|
91
|
-
rspec-mocks (2.
|
92
|
-
rspec-rails (2.
|
90
|
+
rspec (2.10.0)
|
91
|
+
rspec-core (~> 2.10.0)
|
92
|
+
rspec-expectations (~> 2.10.0)
|
93
|
+
rspec-mocks (~> 2.10.0)
|
94
|
+
rspec-core (2.10.1)
|
95
|
+
rspec-expectations (2.10.0)
|
96
|
+
diff-lcs (~> 1.1.3)
|
97
|
+
rspec-mocks (2.10.1)
|
98
|
+
rspec-rails (2.10.1)
|
93
99
|
actionpack (>= 3.0)
|
94
100
|
activesupport (>= 3.0)
|
95
101
|
railties (>= 3.0)
|
96
|
-
rspec (~> 2.
|
102
|
+
rspec (~> 2.10.0)
|
97
103
|
rubyzip (0.9.5)
|
98
104
|
selenium-webdriver (2.18.0)
|
99
105
|
childprocess (>= 0.2.5)
|
@@ -104,17 +110,17 @@ GEM
|
|
104
110
|
multi_json (~> 1.0.3)
|
105
111
|
simplecov-html (~> 0.5.3)
|
106
112
|
simplecov-html (0.5.3)
|
107
|
-
sprockets (2.1.
|
113
|
+
sprockets (2.1.3)
|
108
114
|
hike (~> 1.2)
|
109
115
|
rack (~> 1.0)
|
110
116
|
tilt (~> 1.1, != 1.3.0)
|
111
117
|
sqlite3 (1.3.5)
|
112
|
-
thor (0.
|
118
|
+
thor (0.15.4)
|
113
119
|
tilt (1.3.3)
|
114
120
|
treetop (1.4.10)
|
115
121
|
polyglot
|
116
122
|
polyglot (>= 0.3.1)
|
117
|
-
tzinfo (0.3.
|
123
|
+
tzinfo (0.3.33)
|
118
124
|
xpath (0.1.4)
|
119
125
|
nokogiri (~> 1.3)
|
120
126
|
|
@@ -122,9 +128,10 @@ PLATFORMS
|
|
122
128
|
ruby
|
123
129
|
|
124
130
|
DEPENDENCIES
|
125
|
-
capybara (
|
131
|
+
capybara (~> 1.1.2)
|
126
132
|
factory_girl
|
127
|
-
|
128
|
-
|
133
|
+
panoramic!
|
134
|
+
rake
|
135
|
+
rspec-rails (~> 2.10.0)
|
129
136
|
simplecov
|
130
137
|
sqlite3
|
data/panoramic.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "panoramic"
|
5
|
-
s.version ='0.0.
|
5
|
+
s.version ='0.0.4'
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Andrea Pavoni"]
|
8
8
|
s.email = ["andrea.pavoni@gmail.com"]
|
@@ -10,7 +10,12 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.summary = %q{Stores rails views on database}
|
11
11
|
s.description = %q{Stores rails views on database}
|
12
12
|
|
13
|
-
s.add_dependency 'rails', "
|
13
|
+
s.add_dependency 'rails', ">= 3.0.7"
|
14
|
+
s.add_development_dependency "capybara", "~> 1.1.2"
|
15
|
+
s.add_development_dependency "factory_girl"
|
16
|
+
s.add_development_dependency "simplecov"
|
17
|
+
s.add_development_dependency "sqlite3"
|
18
|
+
s.add_development_dependency "rspec-rails", '~> 2.10.0'
|
14
19
|
|
15
20
|
s.files = `git ls-files`.split("\n")
|
16
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -6,7 +6,7 @@ describe FooController do
|
|
6
6
|
|
7
7
|
context "renders views fetched from database with" do
|
8
8
|
it "a basic template" do
|
9
|
-
|
9
|
+
FactoryGirl.create(:database_template, :path => 'foo/default_layout')
|
10
10
|
|
11
11
|
visit '/foo/default_layout'
|
12
12
|
|
@@ -15,8 +15,8 @@ describe FooController do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "a custom layout" do
|
18
|
-
|
19
|
-
|
18
|
+
FactoryGirl.create(:database_template, :path => 'foo/custom_layout')
|
19
|
+
FactoryGirl.create(:database_template, :path => 'layouts/custom', :body => 'This is a layout with body: <%= yield %>')
|
20
20
|
|
21
21
|
visit '/foo/custom_layout'
|
22
22
|
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Panoramic::Orm::ActiveRecord do
|
4
4
|
context "validations" do
|
5
|
-
let(:template) {
|
5
|
+
let(:template) { FactoryGirl.build :database_template }
|
6
6
|
|
7
7
|
it "has body present" do
|
8
8
|
template.body = nil
|
@@ -13,7 +13,7 @@ describe Panoramic::Orm::ActiveRecord do
|
|
13
13
|
it "is valid" do
|
14
14
|
template.format = 'notknown'
|
15
15
|
template.should have(1).errors_on(:format)
|
16
|
-
end
|
16
|
+
end
|
17
17
|
|
18
18
|
it "is present" do
|
19
19
|
template.format = nil
|
@@ -47,11 +47,15 @@ describe Panoramic::Orm::ActiveRecord do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
context "cache" do
|
50
|
+
before do
|
51
|
+
DatabaseTemplate.delete_all
|
52
|
+
end
|
53
|
+
|
50
54
|
it "is expired on update" do
|
51
55
|
resolver = DatabaseTemplate.resolver
|
52
56
|
|
53
57
|
cache_key = Object.new
|
54
|
-
db_template =
|
58
|
+
db_template = FactoryGirl.create(:database_template, :path => 'foo/some_list', :body => 'Listing something')
|
55
59
|
|
56
60
|
details = { :formats => [:html], :locale => [:en], :handlers => [:erb] }
|
57
61
|
|
data/spec/resolver_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe Panoramic::Resolver do
|
|
5
5
|
|
6
6
|
context ".find_templates" do
|
7
7
|
it "lookups templates for given params" do
|
8
|
-
template =
|
8
|
+
template = FactoryGirl.create(:database_template, :path => 'foo/example')
|
9
9
|
details = { :formats => [:html], :locale => [:en], :handlers => [:erb] }
|
10
10
|
resolver.find_templates('example', 'foo', false, details).first.should_not be_nil
|
11
11
|
end
|
@@ -32,7 +32,7 @@ describe_private Panoramic::Resolver, '(private methods)' do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
context "#initialize_template" do
|
35
|
-
let(:template) {
|
35
|
+
let(:template) { FactoryGirl.create :database_template }
|
36
36
|
|
37
37
|
it "initializes an ActionView::Template object" do
|
38
38
|
resolver.initialize_template(template).should be_a(ActionView::Template)
|
data/spec/support/factories.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
# FactoryGirl.define :database_template do |t|
|
2
|
+
FactoryGirl.define do
|
3
|
+
factory :database_template do
|
4
|
+
path 'foo/index'
|
5
|
+
format 'html'
|
6
|
+
locale 'en'
|
7
|
+
handler 'erb'
|
8
|
+
partial 'false'
|
9
|
+
body "something here in the body of the page: <%= 2 + 2 %>"
|
10
|
+
end
|
8
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panoramic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,19 +9,104 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: 3.0.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.7
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: capybara
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.1.2
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.1.2
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: factory_girl
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: simplecov
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: sqlite3
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rspec-rails
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 2.10.0
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 2.10.0
|
25
110
|
description: Stores rails views on database
|
26
111
|
email:
|
27
112
|
- andrea.pavoni@gmail.com
|
@@ -30,6 +115,7 @@ extensions: []
|
|
30
115
|
extra_rdoc_files: []
|
31
116
|
files:
|
32
117
|
- .gitignore
|
118
|
+
- .travis.yml
|
33
119
|
- Gemfile
|
34
120
|
- Gemfile.lock
|
35
121
|
- MIT-LICENSE
|
@@ -83,16 +169,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
169
|
version: '0'
|
84
170
|
segments:
|
85
171
|
- 0
|
86
|
-
hash:
|
172
|
+
hash: -106334275974701259
|
87
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
174
|
none: false
|
89
175
|
requirements:
|
90
176
|
- - ! '>='
|
91
177
|
- !ruby/object:Gem::Version
|
92
178
|
version: '0'
|
179
|
+
segments:
|
180
|
+
- 0
|
181
|
+
hash: -106334275974701259
|
93
182
|
requirements: []
|
94
183
|
rubyforge_project:
|
95
|
-
rubygems_version: 1.8.
|
184
|
+
rubygems_version: 1.8.24
|
96
185
|
signing_key:
|
97
186
|
specification_version: 3
|
98
187
|
summary: Stores rails views on database
|