cells-slim 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e942ee4f1aee1b46e930d8fe4665c3a475bb1acd
4
+ data.tar.gz: 4029e004141cddfb8d9be7a2d17316f749bb2e14
5
+ SHA512:
6
+ metadata.gz: e58707694c81c24c9e7c8d4cf7694cf371a8306eb0501fe2687fc1d4221e6ed2af7ea257cdbffd7a8438769d63ae5970256fb40cd25ae58a32c19c7793781a1f
7
+ data.tar.gz: c3a96fd82394b2ce37e226438468ed52b2ff1f28bb71bcf38a8c23bf373ae2091a2550e66ab65d4d6400ab4b4735d8ee3cf003911d46ec0ee20dbc07b3ac022f
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.idea
2
+ /.bundle/
3
+ /.yardoc
4
+ *.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
4
+ - 2.0.0
5
+
6
+ sudo: false
7
+
8
+ bundler_args: '--without local_development --jobs 3 --retry 3'
9
+
10
+ script: bundle exec rake
11
+
12
+ gemfile:
13
+ - gemfiles/rails4.2.gemfile
14
+ - gemfiles/rails4.1.gemfile
data/Appraisals ADDED
@@ -0,0 +1,9 @@
1
+ appraise "rails4.1" do
2
+ gem 'railties', github: 'rails/rails', branch: '4-1-stable'
3
+ gem 'minitest', '~> 5.2'
4
+ end
5
+
6
+ appraise "rails4.2" do
7
+ gem 'railties', github: 'rails/rails', branch: '4-2-stable'
8
+ gem 'minitest', '~> 5.2'
9
+ end
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cells-slim.gemspec
4
+ gemspec
5
+
6
+ gem 'pry-byebug' , platforms: [:mri_20, :mri_21]
7
+ gem 'appraisal'
8
+ gem 'minitest-reporters'
9
+ gem 'cells', github: 'apotonick/cells', branch: 'cells-4'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014-2015 Abdelkader Boudih & Nick Sutterer
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR WORLD HUNGER, WARS, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Cells::Slim
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'cells-slim'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install cells-slim
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/trailblazer/cells-slim/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake/testtask'
5
+
6
+ desc 'Default: run unit tests.'
7
+ task :default => :test
8
+
9
+ Rake::TestTask.new(:test) do |test|
10
+ test.libs << 'test'
11
+ test.pattern = 'test/*_test.rb'
12
+ test.verbose = true
13
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'cells-slim'
7
+ spec.version = '0.0.1'
8
+ spec.authors = ['Abdelkader Boudih', 'Nick Sutterer']
9
+ spec.email = %w(terminale@gmail.com apotonick@gmail.com)
10
+ spec.summary = 'Slim integration for cells 4'
11
+ spec.description = spec.summary
12
+ spec.homepage = 'https://github.com/trailblazer/cells-slim'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.test_files = spec.files.grep(%r{^(test)/})
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.add_runtime_dependency 'cells', '~> 4.0.0.alpha1'
20
+ spec.add_runtime_dependency 'slim', '~> 3.0'
21
+ spec.add_runtime_dependency 'tilt', '>= 1.4.1'
22
+ spec.add_development_dependency 'bundler', '>= 1.6'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ end
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "minitest-reporters"
7
+ gem 'cells', github: 'apotonick/cells', branch: 'cells-4'
8
+ gem "railties", :github => "rails/rails", :branch => "4-1-stable"
9
+ gem "activemodel", :github => "rails/rails", :branch => "4-1-stable"
10
+ gem "minitest", "~> 5.2"
11
+
12
+ gemspec :path => "../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "minitest-reporters"
7
+ gem 'cells', github: 'apotonick/cells', branch: 'cells-4'
8
+ gem "railties", :github => "rails/rails", :branch => "4-2-stable"
9
+ gem "activemodel", :github => "rails/rails", :branch => "4-2-stable"
10
+ gem "minitest", "~> 5.2"
11
+
12
+ gemspec :path => "../"
data/lib/cells/slim.rb ADDED
@@ -0,0 +1,55 @@
1
+ require 'slim'
2
+ require 'cells'
3
+
4
+ Tilt.register 'Slim::Template', 'slim', 'slim'
5
+
6
+ module Cell
7
+ module Slim
8
+ class OutputBuffer < String
9
+ end
10
+
11
+ def with_output_buffer(buf = nil)
12
+ unless buf
13
+ buf = OutputBuffer.new
14
+ end
15
+ self.output_buffer, old_buffer = buf, output_buffer
16
+ yield
17
+ output_buffer
18
+ ensure
19
+ self.output_buffer = old_buffer
20
+ end
21
+
22
+ def capture(*args,&block)
23
+ value = nil
24
+ buffer = with_output_buffer() { value = yield(*args) }
25
+ if string = buffer.presence || value and string.is_a?(String)
26
+ return string
27
+ end
28
+ end
29
+
30
+ # From FormTagHelper. why do they escape every possible string? why?
31
+ def form_tag_in_block(html_options, &block)
32
+ content = capture(&block)
33
+ "#{form_tag_html(html_options)}" << content << "</form>"
34
+ end
35
+
36
+ def form_tag_html(html_options)
37
+ extra_tags = extra_tags_for_form(html_options)
38
+ "#{tag(:form, html_options, true) + extra_tags}"
39
+ end
40
+
41
+ def tag_option(key, value, escape)
42
+ super(key, value, false)
43
+ end
44
+
45
+ def content_tag_string(name, content, options, escape=true)
46
+ super(name, content, options, false)
47
+ end
48
+ end
49
+
50
+ ViewModel.class_eval do
51
+ include Slim
52
+ end
53
+
54
+ ViewModel.template_engine = :slim
55
+ end
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,37 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "action_controller/railtie"
4
+ require "action_view/railtie"
5
+
6
+ module Dummy
7
+ class Application < Rails::Application
8
+ config.encoding = "utf-8"
9
+ config.i18n.enforce_available_locales = false
10
+
11
+ # Configure sensitive parameters which will be filtered from the log file.
12
+ config.filter_parameters += [:password]
13
+
14
+ config.cache_store = :memory_store
15
+ config.secret_token = SecureRandom.uuid
16
+ config.secret_key_base = SecureRandom.uuid
17
+
18
+ # enable asset pipeline as in development.
19
+ config.assets.enabled = true
20
+ config.assets.compile = true
21
+ config.cache_classes = true
22
+
23
+ # Show full error reports and disable caching
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+
27
+ # Raise exceptions instead of rendering exception templates
28
+ config.action_dispatch.show_exceptions = false
29
+
30
+ # Disable request forgery protection in test environment
31
+ config.action_controller.allow_forgery_protection = false
32
+ config.active_support.deprecation = :stderr
33
+
34
+ config.eager_load = false
35
+ config.active_support.test_order = :random
36
+ end
37
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,3 @@
1
+ Dummy::Application.routes.draw do
2
+ resources :drugs
3
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
data/test/slim_test.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ class SlimTest < MiniTest::Test
4
+
5
+ def test_template_engine
6
+ assert_equal 'slim', Cell::ViewModel.template_engine
7
+ end
8
+
9
+ end
@@ -0,0 +1,15 @@
1
+ begin
2
+ require 'byebug'
3
+ rescue LoadError
4
+ end
5
+ require 'minitest/autorun'
6
+
7
+ require 'minitest/reporters'
8
+ Minitest::Reporters.use! [Minitest::Reporters::ProgressReporter.new]
9
+
10
+ ENV['RAILS_ENV'] = 'test'
11
+
12
+ require 'cells/slim'
13
+ require_relative 'dummy/config/environment'
14
+ require "rails/test_help" # adds stuff like @routes, etc.
15
+
metadata ADDED
@@ -0,0 +1,148 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cells-slim
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Abdelkader Boudih
8
+ - Nick Sutterer
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-03-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cells
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 4.0.0.alpha1
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 4.0.0.alpha1
28
+ - !ruby/object:Gem::Dependency
29
+ name: slim
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '3.0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '3.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: tilt
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 1.4.1
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.4.1
56
+ - !ruby/object:Gem::Dependency
57
+ name: bundler
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '1.6'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '1.6'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rake
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '10.0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '10.0'
84
+ description: Slim integration for cells 4
85
+ email:
86
+ - terminale@gmail.com
87
+ - apotonick@gmail.com
88
+ executables: []
89
+ extensions: []
90
+ extra_rdoc_files: []
91
+ files:
92
+ - ".gitignore"
93
+ - ".travis.yml"
94
+ - Appraisals
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - cells-slim.gemspec
100
+ - gemfiles/rails4.1.gemfile
101
+ - gemfiles/rails4.2.gemfile
102
+ - lib/cells/slim.rb
103
+ - test/dummy/Rakefile
104
+ - test/dummy/app/controllers/application_controller.rb
105
+ - test/dummy/config.ru
106
+ - test/dummy/config/application.rb
107
+ - test/dummy/config/boot.rb
108
+ - test/dummy/config/environment.rb
109
+ - test/dummy/config/routes.rb
110
+ - test/dummy/script/rails
111
+ - test/slim_test.rb
112
+ - test/test_helper.rb
113
+ homepage: https://github.com/trailblazer/cells-slim
114
+ licenses:
115
+ - MIT
116
+ metadata: {}
117
+ post_install_message:
118
+ rdoc_options: []
119
+ require_paths:
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ requirements: []
132
+ rubyforge_project:
133
+ rubygems_version: 2.4.5
134
+ signing_key:
135
+ specification_version: 4
136
+ summary: Slim integration for cells 4
137
+ test_files:
138
+ - test/dummy/Rakefile
139
+ - test/dummy/app/controllers/application_controller.rb
140
+ - test/dummy/config.ru
141
+ - test/dummy/config/application.rb
142
+ - test/dummy/config/boot.rb
143
+ - test/dummy/config/environment.rb
144
+ - test/dummy/config/routes.rb
145
+ - test/dummy/script/rails
146
+ - test/slim_test.rb
147
+ - test/test_helper.rb
148
+ has_rdoc: