panoramic 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.travis.yml +3 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +124 -111
- data/README.md +26 -9
- data/Rakefile +18 -1
- data/gemfiles/active_record.gemfile +5 -0
- data/lib/panoramic/orm/active_record.rb +3 -3
- data/lib/panoramic/resolver.rb +8 -5
- data/panoramic.gemspec +3 -3
- data/spec/controllers/rendering_spec.rb +7 -7
- data/spec/dummy/Rakefile +1 -2
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +3 -1
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +2 -2
- data/spec/dummy/config/application.rb +7 -21
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/database.yml +11 -8
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/development.rb +28 -13
- data/spec/dummy/config/environments/production.rb +58 -28
- data/spec/dummy/config/environments/test.rb +22 -15
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +9 -3
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -6
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +20 -2
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/orm/active_record_spec.rb +26 -26
- data/spec/resolver_spec.rb +36 -8
- metadata +77 -46
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.6'
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Andrea Pavoni"]
|
8
8
|
s.email = ["andrea.pavoni@gmail.com"]
|
@@ -11,11 +11,11 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.description = %q{Stores rails views on database}
|
12
12
|
|
13
13
|
s.add_dependency 'rails', ">= 3.0.7"
|
14
|
-
s.add_development_dependency "capybara", "~>
|
14
|
+
s.add_development_dependency "capybara", "~> 2.5.0"
|
15
15
|
s.add_development_dependency "factory_girl"
|
16
16
|
s.add_development_dependency "simplecov"
|
17
17
|
s.add_development_dependency "sqlite3"
|
18
|
-
s.add_development_dependency "rspec-rails", '~>
|
18
|
+
s.add_development_dependency "rspec-rails", '~> 3.0'
|
19
19
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe FooController do
|
3
|
+
describe FooController, type: :controller do
|
4
4
|
include Capybara::DSL
|
5
5
|
render_views
|
6
6
|
|
@@ -10,8 +10,8 @@ describe FooController do
|
|
10
10
|
|
11
11
|
visit '/foo/default_layout'
|
12
12
|
|
13
|
-
response.
|
14
|
-
page.body.
|
13
|
+
expect(response).to render_template("foo/default_layout" )
|
14
|
+
expect(page.body).to match(/something here in the body of the page: 4/)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "a custom layout" do
|
@@ -20,10 +20,10 @@ describe FooController do
|
|
20
20
|
|
21
21
|
visit '/foo/custom_layout'
|
22
22
|
|
23
|
-
response.
|
24
|
-
response.
|
25
|
-
page.body.
|
26
|
-
page.body.
|
23
|
+
expect(response).to render_template("layouts/custom" )
|
24
|
+
expect(response).to render_template("foo/custom_layout" )
|
25
|
+
expect(page.body).to match(/This is a layout with body:/)
|
26
|
+
expect(page.body).to match(/something here in the body of the page:/)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/spec/dummy/Rakefile
CHANGED
File without changes
|
@@ -2,7 +2,9 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Dummy</title>
|
5
|
-
<%=
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
6
8
|
</head>
|
7
9
|
<body>
|
8
10
|
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
data/spec/dummy/config.ru
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
|
3
|
+
# Pick the frameworks you want:
|
4
4
|
require "active_record/railtie"
|
5
5
|
require "action_controller/railtie"
|
6
|
-
require "action_view/railtie"
|
7
6
|
require "action_mailer/railtie"
|
7
|
+
require "action_view/railtie"
|
8
|
+
require "sprockets/railtie"
|
9
|
+
# require "rails/test_unit/railtie"
|
8
10
|
|
9
|
-
Bundler.require
|
11
|
+
Bundler.require(*Rails.groups)
|
10
12
|
require "panoramic"
|
11
13
|
|
12
14
|
module Dummy
|
@@ -15,16 +17,6 @@ module Dummy
|
|
15
17
|
# Application configuration should go into files in config/initializers
|
16
18
|
# -- all .rb files in that directory are automatically loaded.
|
17
19
|
|
18
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
19
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
20
|
-
|
21
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
22
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
23
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
24
|
-
|
25
|
-
# Activate observers that should always be running.
|
26
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
27
|
-
|
28
20
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
29
21
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
30
22
|
# config.time_zone = 'Central Time (US & Canada)'
|
@@ -33,13 +25,7 @@ module Dummy
|
|
33
25
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
34
26
|
# config.i18n.default_locale = :de
|
35
27
|
|
36
|
-
#
|
37
|
-
|
38
|
-
|
39
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
40
|
-
config.encoding = "utf-8"
|
41
|
-
|
42
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
43
|
-
config.filter_parameters += [:password]
|
28
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
29
|
+
config.active_record.raise_in_transactional_callbacks = true
|
44
30
|
end
|
45
31
|
end
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,10 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Set up gems listed in the Gemfile.
|
2
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
3
3
|
|
4
|
-
if File.exist?(
|
5
|
-
|
6
|
-
require 'bundler'
|
7
|
-
Bundler.setup
|
8
|
-
end
|
9
|
-
|
10
|
-
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
4
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -1,22 +1,25 @@
|
|
1
1
|
# SQLite version 3.x
|
2
2
|
# gem install sqlite3
|
3
|
-
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
4
8
|
adapter: sqlite3
|
5
|
-
database: db/development.sqlite3
|
6
9
|
pool: 5
|
7
10
|
timeout: 5000
|
8
11
|
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
9
16
|
# Warning: The database defined as "test" will be erased and
|
10
17
|
# re-generated from your development database when you run "rake".
|
11
18
|
# Do not set this db to the same as development or production.
|
12
19
|
test:
|
13
|
-
|
20
|
+
<<: *default
|
14
21
|
database: db/test.sqlite3
|
15
|
-
pool: 5
|
16
|
-
timeout: 5000
|
17
22
|
|
18
23
|
production:
|
19
|
-
|
24
|
+
<<: *default
|
20
25
|
database: db/production.sqlite3
|
21
|
-
pool: 5
|
22
|
-
timeout: 5000
|
@@ -1,26 +1,41 @@
|
|
1
|
-
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
|
-
# every request.
|
6
|
-
# since you don't have to restart the
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports and disable caching
|
12
|
+
# Show full error reports and disable caching.
|
13
13
|
config.consider_all_requests_local = true
|
14
|
-
config.action_view.debug_rjs = true
|
15
14
|
config.action_controller.perform_caching = false
|
16
15
|
|
17
|
-
# Don't care if the mailer can't send
|
16
|
+
# Don't care if the mailer can't send.
|
18
17
|
config.action_mailer.raise_delivery_errors = false
|
19
18
|
|
20
|
-
# Print deprecation notices to the Rails logger
|
19
|
+
# Print deprecation notices to the Rails logger.
|
21
20
|
config.active_support.deprecation = :log
|
22
21
|
|
23
|
-
#
|
24
|
-
config.
|
25
|
-
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
|
+
# yet still be able to expire them through the digest params.
|
32
|
+
config.assets.digest = true
|
26
33
|
|
34
|
+
# Adds additional error checking when serving assets at runtime.
|
35
|
+
# Checks for improperly declared sprockets dependencies.
|
36
|
+
# Raises helpful error messages.
|
37
|
+
config.assets.raise_runtime_errors = true
|
38
|
+
|
39
|
+
# Raises error for missing translations
|
40
|
+
# config.action_view.raise_on_missing_translations = true
|
41
|
+
end
|
@@ -1,49 +1,79 @@
|
|
1
|
-
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
|
-
#
|
5
|
-
# Code is not reloaded between requests
|
4
|
+
# Code is not reloaded between requests.
|
6
5
|
config.cache_classes = true
|
7
6
|
|
8
|
-
#
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
9
14
|
config.consider_all_requests_local = false
|
10
15
|
config.action_controller.perform_caching = true
|
11
16
|
|
12
|
-
#
|
13
|
-
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
14
22
|
|
15
|
-
#
|
16
|
-
#
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
17
26
|
|
18
|
-
#
|
19
|
-
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
20
30
|
|
21
|
-
#
|
22
|
-
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
+
config.assets.compile = false
|
23
33
|
|
24
|
-
#
|
25
|
-
#
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
36
|
+
config.assets.digest = true
|
26
37
|
|
27
|
-
#
|
28
|
-
# config.cache_store = :mem_cache_store
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
29
39
|
|
30
|
-
#
|
31
|
-
#
|
32
|
-
config.
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
33
43
|
|
34
|
-
#
|
35
|
-
# config.
|
44
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
45
|
+
# config.force_ssl = true
|
36
46
|
|
37
|
-
#
|
38
|
-
#
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
39
50
|
|
40
|
-
#
|
41
|
-
# config.
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
53
|
+
|
54
|
+
# Use a different logger for distributed setups.
|
55
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
56
|
+
|
57
|
+
# Use a different cache store in production.
|
58
|
+
# config.cache_store = :mem_cache_store
|
59
|
+
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
62
|
+
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
65
|
+
# config.action_mailer.raise_delivery_errors = false
|
42
66
|
|
43
67
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
44
|
-
# the I18n.default_locale when a translation
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
45
69
|
config.i18n.fallbacks = true
|
46
70
|
|
47
|
-
# Send deprecation notices to registered listeners
|
71
|
+
# Send deprecation notices to registered listeners.
|
48
72
|
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Do not dump schema after migrations.
|
78
|
+
config.active_record.dump_schema_after_migration = false
|
49
79
|
end
|
@@ -1,35 +1,42 @@
|
|
1
|
-
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite.
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs.
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
11
|
-
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
12
14
|
|
13
|
-
#
|
15
|
+
# Configure static file server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_files = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
18
|
+
|
19
|
+
# Show full error reports and disable caching.
|
14
20
|
config.consider_all_requests_local = true
|
15
21
|
config.action_controller.perform_caching = false
|
16
22
|
|
17
|
-
# Raise exceptions instead of rendering exception templates
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
18
24
|
config.action_dispatch.show_exceptions = false
|
19
25
|
|
20
|
-
# Disable request forgery protection in test environment
|
21
|
-
config.action_controller.allow_forgery_protection
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
22
28
|
|
23
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
24
30
|
# The :test delivery method accumulates sent emails in the
|
25
31
|
# ActionMailer::Base.deliveries array.
|
26
32
|
config.action_mailer.delivery_method = :test
|
27
33
|
|
28
|
-
#
|
29
|
-
|
30
|
-
# like if you have constraints or database-specific column types
|
31
|
-
# config.active_record.schema_format = :sql
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
32
36
|
|
33
|
-
# Print deprecation notices to the stderr
|
37
|
+
# Print deprecation notices to the stderr.
|
34
38
|
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
35
42
|
end
|