cells 4.0.0.beta4 → 4.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +19 -0
- data/Rakefile +11 -0
- data/cells.gemspec +3 -4
- data/gemfiles/rails4.2.gemfile +0 -7
- data/lib/cell.rb +19 -19
- data/lib/cell/abstract.rb +9 -0
- data/lib/cell/caching.rb +16 -17
- data/lib/cell/concept.rb +2 -4
- data/lib/cell/prefixes.rb +3 -2
- data/lib/cell/rails.rb +27 -4
- data/lib/cell/railtie.rb +47 -42
- data/lib/cell/testing.rb +12 -9
- data/lib/cell/twin.rb +2 -2
- data/lib/cell/util.rb +16 -0
- data/lib/cell/version.rb +1 -8
- data/lib/cell/view_model.rb +63 -90
- data/test/builder_test.rb +5 -5
- data/test/caching_test.rb +2 -2
- data/test/cell_test.rb +1 -1
- data/test/concept_test.rb +24 -10
- data/test/dummy/config/application.rb +1 -1
- data/test/public_test.rb +8 -9
- data/test/rails4.2/.gitignore +13 -0
- data/test/rails4.2/Gemfile +16 -0
- data/test/rails4.2/README.rdoc +3 -0
- data/test/rails4.2/Rakefile +6 -0
- data/test/rails4.2/app/assets/images/.keep +0 -0
- data/test/rails4.2/app/assets/stylesheets/application.css +17 -0
- data/test/rails4.2/app/cells/song/song.css +1 -0
- data/test/rails4.2/app/cells/song_cell.rb +2 -0
- data/test/rails4.2/app/controllers/application_controller.rb +5 -0
- data/test/rails4.2/app/controllers/concerns/.keep +0 -0
- data/test/rails4.2/app/controllers/index_controller.rb +7 -0
- data/test/rails4.2/app/helpers/application_helper.rb +2 -0
- data/test/rails4.2/app/mailers/.keep +0 -0
- data/test/rails4.2/app/models/.keep +0 -0
- data/test/rails4.2/app/models/concerns/.keep +0 -0
- data/test/rails4.2/app/views/index/index.html.erb +6 -0
- data/test/rails4.2/app/views/layouts/application.html.erb +13 -0
- data/test/rails4.2/bin/bundle +3 -0
- data/test/rails4.2/bin/rails +4 -0
- data/test/rails4.2/bin/rake +4 -0
- data/test/rails4.2/bin/setup +29 -0
- data/test/rails4.2/config.ru +4 -0
- data/test/rails4.2/config/application.rb +38 -0
- data/test/rails4.2/config/boot.rb +3 -0
- data/test/rails4.2/config/environment.rb +5 -0
- data/test/rails4.2/config/environments/development.rb +25 -0
- data/test/rails4.2/config/environments/production.rb +64 -0
- data/test/rails4.2/config/environments/test.rb +42 -0
- data/test/rails4.2/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails4.2/config/initializers/cookies_serializer.rb +3 -0
- data/test/rails4.2/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/rails4.2/config/initializers/inflections.rb +16 -0
- data/test/rails4.2/config/initializers/mime_types.rb +4 -0
- data/test/rails4.2/config/initializers/session_store.rb +3 -0
- data/test/rails4.2/config/initializers/wrap_parameters.rb +9 -0
- data/test/rails4.2/config/locales/en.yml +23 -0
- data/test/rails4.2/config/routes.rb +4 -0
- data/test/rails4.2/config/secrets.yml +22 -0
- data/test/rails4.2/db/seeds.rb +7 -0
- data/test/rails4.2/engines/my_engine/.gitignore +3 -0
- data/test/rails4.2/engines/my_engine/Gemfile +15 -0
- data/test/rails4.2/engines/my_engine/MIT-LICENSE +20 -0
- data/test/rails4.2/engines/my_engine/README.rdoc +3 -0
- data/test/rails4.2/engines/my_engine/Rakefile +24 -0
- data/test/rails4.2/engines/my_engine/app/assets/images/my_engine/.keep +0 -0
- data/test/rails4.2/engines/my_engine/app/assets/stylesheets/my_engine/application.css +15 -0
- data/test/rails4.2/engines/my_engine/app/concepts/user/cell.rb +8 -0
- data/test/rails4.2/engines/my_engine/app/concepts/user/views/show.erb +1 -0
- data/test/rails4.2/engines/my_engine/app/concepts/user/views/user.scss +3 -0
- data/test/rails4.2/engines/my_engine/app/controllers/my_engine/application_controller.rb +4 -0
- data/test/rails4.2/engines/my_engine/app/controllers/my_engine/user_controller.rb +7 -0
- data/test/rails4.2/engines/my_engine/app/helpers/my_engine/application_helper.rb +4 -0
- data/test/rails4.2/engines/my_engine/app/models/my_engine/user.rb +4 -0
- data/test/rails4.2/engines/my_engine/app/views/layouts/my_engine/application.html.erb +14 -0
- data/test/rails4.2/engines/my_engine/app/views/my_engine/user/show.html.erb +3 -0
- data/test/rails4.2/engines/my_engine/bin/rails +12 -0
- data/test/rails4.2/engines/my_engine/config/routes.rb +3 -0
- data/test/rails4.2/engines/my_engine/db/migrate/20150530135920_create_my_engine_users.rb +8 -0
- data/test/rails4.2/engines/my_engine/lib/my_engine.rb +6 -0
- data/test/rails4.2/engines/my_engine/lib/my_engine/engine.rb +9 -0
- data/test/rails4.2/engines/my_engine/lib/my_engine/version.rb +3 -0
- data/test/rails4.2/engines/my_engine/lib/tasks/my_engine_tasks.rake +4 -0
- data/test/rails4.2/engines/my_engine/my_engine.gemspec +24 -0
- data/test/rails4.2/engines/my_engine/test/fixtures/my_engine/users.yml +11 -0
- data/test/rails4.2/engines/my_engine/test/models/my_engine/user_test.rb +9 -0
- data/test/rails4.2/lib/assets/.keep +0 -0
- data/test/rails4.2/lib/tasks/.keep +0 -0
- data/test/rails4.2/log/.keep +0 -0
- data/test/rails4.2/public/404.html +67 -0
- data/test/rails4.2/public/422.html +67 -0
- data/test/rails4.2/public/500.html +66 -0
- data/test/rails4.2/public/favicon.ico +0 -0
- data/test/rails4.2/public/robots.txt +5 -0
- data/test/rails4.2/test/integration/asset_pipeline_test.rb +17 -0
- data/test/rails4.2/test/test_helper.rb +14 -0
- data/test/rails4.2/vendor/assets/stylesheets/.keep +0 -0
- data/test/twin_test.rb +1 -1
- data/test/url_helper_test.rb +1 -1
- metadata +83 -19
@@ -0,0 +1,13 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore all logfiles and tempfiles.
|
11
|
+
/log/*
|
12
|
+
!/log/.keep
|
13
|
+
/tmp
|
@@ -0,0 +1,16 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '4.2.1'
|
4
|
+
|
5
|
+
gem "my_engine", path: "engines/my_engine"
|
6
|
+
|
7
|
+
gem 'sass-rails', "~> 4.0.3"#, " ~> 3.1.0"
|
8
|
+
gem "sprockets", "~> 2.12.3"
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem "minitest-spec-rails"
|
12
|
+
gem "capybara_minitest_spec"
|
13
|
+
end
|
14
|
+
|
15
|
+
gem "cells", path: "../../"
|
16
|
+
gem "cells-erb"
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*= require user
|
16
|
+
*= require song
|
17
|
+
*/
|
@@ -0,0 +1 @@
|
|
1
|
+
.song { background: red; }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
# Pick the frameworks you want:
|
5
|
+
require "active_model/railtie"
|
6
|
+
require "active_job/railtie"
|
7
|
+
# require "active_record/railtie"
|
8
|
+
require "action_controller/railtie"
|
9
|
+
require "action_mailer/railtie"
|
10
|
+
require "action_view/railtie"
|
11
|
+
require "sprockets/railtie"
|
12
|
+
require "rails/test_unit/railtie"
|
13
|
+
|
14
|
+
# Require the gems listed in Gemfile, including any gems
|
15
|
+
# you've limited to :test, :development, or :production.
|
16
|
+
Bundler.require(*Rails.groups)
|
17
|
+
|
18
|
+
module EngineCells
|
19
|
+
class Application < Rails::Application
|
20
|
+
# Settings in config/environments/* take precedence over those specified here.
|
21
|
+
# Application configuration should go into files in config/initializers
|
22
|
+
# -- all .rb files in that directory are automatically loaded.
|
23
|
+
|
24
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
25
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
26
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
27
|
+
|
28
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
29
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
30
|
+
# config.i18n.default_locale = :de
|
31
|
+
|
32
|
+
# enable asset pipeline as in development/test.
|
33
|
+
config.assets.enabled = true
|
34
|
+
config.assets.compile = true
|
35
|
+
|
36
|
+
config.cells.with_assets = ["user/cell", "song_cell"]
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
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
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
|
23
|
+
# Raises error for missing translations
|
24
|
+
# config.action_view.raise_on_missing_translations = true
|
25
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
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.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
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
|
22
|
+
|
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?
|
26
|
+
|
27
|
+
|
28
|
+
# Specifies the header that your server uses for sending files.
|
29
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
30
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
31
|
+
|
32
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
33
|
+
# config.force_ssl = true
|
34
|
+
|
35
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
36
|
+
# when problems arise.
|
37
|
+
config.log_level = :debug
|
38
|
+
|
39
|
+
# Prepend all log lines with the following tags.
|
40
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
41
|
+
|
42
|
+
# Use a different logger for distributed setups.
|
43
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
44
|
+
|
45
|
+
# Use a different cache store in production.
|
46
|
+
# config.cache_store = :mem_cache_store
|
47
|
+
|
48
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
49
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
50
|
+
|
51
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
52
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
53
|
+
# config.action_mailer.raise_delivery_errors = false
|
54
|
+
|
55
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
56
|
+
# the I18n.default_locale when a translation cannot be found).
|
57
|
+
config.i18n.fallbacks = true
|
58
|
+
|
59
|
+
# Send deprecation notices to registered listeners.
|
60
|
+
config.active_support.deprecation = :notify
|
61
|
+
|
62
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
63
|
+
config.log_formatter = ::Logger::Formatter.new
|
64
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
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
|
14
|
+
|
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.
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
36
|
+
|
37
|
+
# Print deprecation notices to the stderr.
|
38
|
+
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
42
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|