cells-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e1b105374e1d4806e75407a1f21a42c91684f527
4
+ data.tar.gz: fd6284c358c047a3902a5853d6bc5e82d4dd1453
5
+ SHA512:
6
+ metadata.gz: a1fd0680441e28d413d6e4d7f46c49f5c77bf515f9e0734451cf3fcb3ed1a4449177c899b4624f8651a0ecb1fcbdf5e482d4605e8988996af8becd39475a6467
7
+ data.tar.gz: 8aa156d200e0ee1781b5ac451b7e610f3f29581cdaee41f015f8fb92dfd75e31755590d2c395f4b52bdc861b4c6b1331a11a5c73b6a845c6489d7fe2647c44c6
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ rvm:
3
+ - ruby-head
4
+ - 2.2
5
+ - 2.1
6
+ - 2.0.0
7
+ - 1.9.3
8
+ - jruby-19mode
9
+ gemfile:
10
+ - gemfiles/rails4.2.gemfile
11
+ - gemfiles/rails4.1.gemfile
12
+ - gemfiles/rails4.0.gemfile
13
+ - gemfiles/rails3.2.gemfile
@@ -0,0 +1,3 @@
1
+ ## 0.0.2
2
+
3
+ * Moved all Rails files from `cells` to `cells-rails`.
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cells-rails.gemspec
4
+ gemspec
5
+
6
+ # gem "my_engine", path: "engines/my_engine"
7
+
8
+ # gem 'sass-rails', "~> 4.0.3"#, " ~> 3.1.0"
9
+ # gem "sprockets", "~> 2.12.3"
10
+
11
+ group :development, :test do
12
+ gem "minitest-spec-rails"
13
+ gem "capybara_minitest_spec"
14
+ end
15
+
16
+ gem "simple_form"
17
+ gem "formtastic"
@@ -0,0 +1,20 @@
1
+ # Cells::Rails
2
+
3
+ [Cells](https://github.com/apotonick/cells) is a generic view model implementation for Ruby. Cells-rails brings Rails-specific bindings.
4
+
5
+ ## Rails Features
6
+
7
+ * html_safe
8
+ * controller in context
9
+ * TODO: asset helpers
10
+
11
+
12
+ ## Installation
13
+
14
+ Note that `cells-rails` is designed to work with Cells >= 4.1.
15
+
16
+ Add this line to your application's Gemfile:
17
+
18
+ ```ruby
19
+ gem 'cells-rails'
20
+ ```
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,28 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'cells/rails/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "cells-rails"
7
+ spec.version = Cells::Rails::VERSION
8
+ spec.authors = ["Nick Sutterer"]
9
+ spec.email = ["apotonick@gmail.com"]
10
+
11
+ spec.summary = %q{Convenient Rails support for Cells.}
12
+ spec.homepage = "http://trailblazer.to"
13
+
14
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
15
+ spec.bindir = "exe"
16
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency "cells", ">= 4.0"
20
+ spec.add_dependency "actionpack", ">= 3.0"
21
+
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.10"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "minitest"
26
+ spec.add_development_dependency "rails"
27
+ spec.add_development_dependency "cells-erb"
28
+ end
@@ -0,0 +1,15 @@
1
+ module Cell
2
+ module Caching
3
+ module Notifications
4
+ def fetch_from_cache_for(key, options)
5
+ ActiveSupport::Notifications.instrument('read_fragment.cells', key: key) do
6
+ cache_store.fetch(key, options) do
7
+ ActiveSupport::Notifications.instrument('write_fragment.cells', key: key) do
8
+ yield
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ module Cell
2
+ module RailsExtension
3
+ module Collection
4
+ def call(*)
5
+ super.html_safe
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Cell
2
+ module RailsExtension
3
+ module ConstantFor
4
+ def constant_for(name)
5
+ name.camelize.constantize
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ require "cell/testing"
2
+
3
+ module Cell
4
+ # Test your cells.
5
+ #
6
+ # TODO: document me, Capybara, etc.
7
+ class TestCase < ActiveSupport::TestCase
8
+ include Testing
9
+ end
10
+ end
11
+
12
+ Cell::Testing.capybara = true if Object.const_defined?(:"Capybara")
@@ -0,0 +1,19 @@
1
+ # NOTE: this will soon be moved to cells-rails.
2
+ module Cell::Translation
3
+ def self.included(includer)
4
+ super
5
+ includer.inheritable_attr :translation_path
6
+ end
7
+
8
+ def initialize(*)
9
+ super
10
+ @virtual_path = translation_path
11
+ end
12
+
13
+ private
14
+ # If you override this to change this path, please report it on the trailblazer/chat gitter channel,
15
+ # so we can find out best practices.
16
+ def translation_path
17
+ self.class.translation_path or controller_path.gsub("/", ".")
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ require "cells/rails/version"
2
+ require "cells"
3
+
4
+ require "cell/rails/collection"
5
+ require "cell/rails/constant_for"
6
+
7
+ Cell::Collection.send :include, Cell::RailsExtension::Collection
8
+ Cell::ViewModel.send :include, Cell::RailsExtension::ConstantFor
9
+
10
+ require "cell/caching/notification"
11
+ require "cell/railtie"
12
+
13
+ module Cell
14
+ autoload :TestCase, "cell/test_case"
15
+ end
@@ -0,0 +1,5 @@
1
+ module Cells
2
+ module Rails
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,155 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cells-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Nick Sutterer
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cells
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: actionpack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: cells-erb
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description:
112
+ email:
113
+ - apotonick@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".travis.yml"
120
+ - CHANGES.md
121
+ - Gemfile
122
+ - README.md
123
+ - Rakefile
124
+ - cells-rails.gemspec
125
+ - lib/cell/caching/notification.rb
126
+ - lib/cell/rails/collection.rb
127
+ - lib/cell/rails/constant_for.rb
128
+ - lib/cell/test_case.rb
129
+ - lib/cell/translation.rb
130
+ - lib/cells/rails.rb
131
+ - lib/cells/rails/version.rb
132
+ homepage: http://trailblazer.to
133
+ licenses: []
134
+ metadata: {}
135
+ post_install_message:
136
+ rdoc_options: []
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ requirements: []
150
+ rubyforge_project:
151
+ rubygems_version: 2.4.8
152
+ signing_key:
153
+ specification_version: 4
154
+ summary: Convenient Rails support for Cells.
155
+ test_files: []