cough-rails 0.0.0

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: f1aa1e0bbf3a798814c2e8311816ab2bb25ec397
4
+ data.tar.gz: a4c66db161fa70947c1e4d2edf514e865ed221bc
5
+ SHA512:
6
+ metadata.gz: e2acde16b11cf85be34bdfd4daee59fd505bac615353a9e8407fd6b8b7db3de2a8fb1ab92ee0a7536ab5ba895239f2b11f7b248a603e745d848a0f28dad52213
7
+ data.tar.gz: eec879626e1221a908ff2d47778c6cd655d828ed919e44b425d4a3952c1fa45468ff592a8c20745775a152916acb37d472485b63c190c8d93c1566193ecbb620
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in cough-rails.gemspec
4
+ gemspec
5
+
6
+ gem "rails", git: "git://github.com/rails/rails"
7
+
8
+ # To use debugger
9
+ # gem 'debugger'
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2014 Matthew Hilty
2
+
3
+ (Original project by Santiago Pastorino)
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 ANY CLAIM, 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.
23
+
@@ -0,0 +1,22 @@
1
+ # Cough-Rails
2
+
3
+ CoughSyrup adapter for the Rails asset pipeline. Also adds support to use CoughSyrup to respond to JavaScript requests (use .js.cough views).
4
+
5
+ ## Installation
6
+
7
+ Since Rails 3.1 Cough-Rails is included in the default Gemfile when you create a new application. If you are upgrading to Rails 3.1 you must add the cough-rails to your Gemfile:
8
+
9
+ gem 'cough-rails'
10
+
11
+ If you are precompiling your assets (with rake assets:precompile) before run your application in production, you might want add it to the assets group to prevent the gem being required in the production environment. _Note that this may prevent you from using Coughsyrup for UJS responses_.
12
+
13
+ group :assets do
14
+ gem 'cough-rails'
15
+ end
16
+
17
+ ## Running tests
18
+
19
+ $ bundle install
20
+ $ bundle exec rake test
21
+
22
+ If you need to test against local gems, use Bundler's gem :path option in the Gemfile.
@@ -0,0 +1,28 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'lib'
8
+ t.libs << 'test'
9
+ t.pattern = 'test/**/*_test.rb'
10
+ t.verbose = false
11
+ end
12
+
13
+ task default: :test
14
+
15
+ specname = "cough-rails.gemspec"
16
+ deps = `git ls-files`.split("\n") - [specname]
17
+
18
+ file specname => deps do
19
+ files = `git ls-files`.split("\n")
20
+ test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+
23
+ require 'erb'
24
+
25
+ File.open specname, 'w:utf-8' do |f|
26
+ f.write ERB.new(File.read("#{specname}.erb")).result(binding)
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "cough/rails/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "cough-rails"
6
+ s.version = Cough::Rails::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Santiago Pastorino", "Matthew Hilty"]
9
+ s.email = ["hilty.matthew@gmail.com"]
10
+ s.homepage = "https://github.com/rails/coffee-rails"
11
+ s.summary = %q{CoughSyrup adapter for the Rails asset pipeline.}
12
+ s.description = %q{CoughSyrup adapter for the Rails asset pipeline.}
13
+
14
+ s.add_runtime_dependency 'cough-syrup', '>= 0.0.0'
15
+ s.add_runtime_dependency 'railties', '>= 4.0.0.beta', '< 5.0'
16
+
17
+ s.files = ["Gemfile","MIT-LICENSE","README.markdown","Rakefile","cough-rails.gemspec","lib/assets/javascripts/cough-syrup.js.erb","lib/cough-rails.rb","lib/cough/rails/engine.rb","lib/cough/rails/template_handler.rb","lib/cough/rails/version.rb","lib/rails/generators/cough/assets/assets_generator.rb","lib/rails/generators/cough/assets/templates/javascript.js.cough"]
18
+ s.test_files = []
19
+ s.executables = []
20
+ s.require_paths = ["lib"]
21
+ s.license = "MIT"
22
+ end
@@ -0,0 +1 @@
1
+ <%= CoughSyrup::Source.contents %>
@@ -0,0 +1,4 @@
1
+ require 'cough-syrup'
2
+ require 'cough/rails/engine'
3
+ require 'cough/rails/template_handler'
4
+ require 'cough/rails/version'
@@ -0,0 +1,9 @@
1
+ require 'rails/engine'
2
+
3
+ module Cough
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ config.app_generators.javascript_engine :cough
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ module Cough
2
+ module Rails
3
+ class TemplateHandler
4
+ def self.erb_handler
5
+ @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
6
+ end
7
+
8
+ def self.call(template)
9
+ compiled_source = erb_handler.call(template)
10
+ "CoughSyrup.compile(begin;#{compiled_source};end)"
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ ActiveSupport.on_load(:action_view) do
17
+ ActionView::Template.register_template_handler :cough, Cough::Rails::TemplateHandler
18
+ end
@@ -0,0 +1,5 @@
1
+ module Cough
2
+ module Rails
3
+ VERSION = "0.0.0"
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ require "rails/generators/named_base"
2
+
3
+ module Cough
4
+ module Generators
5
+ class AssetsGenerator < ::Rails::Generators::NamedBase
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ def copy_cough
9
+ template "javascript.js.cough", File.join('app/assets/javascripts', class_path, "#{file_name}.js.cough")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoughSyrup in this file.
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cough-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Santiago Pastorino
8
+ - Matthew Hilty
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-05-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cough-syrup
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 0.0.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.0.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: railties
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: 4.0.0.beta
35
+ - - <
36
+ - !ruby/object:Gem::Version
37
+ version: '5.0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: 4.0.0.beta
45
+ - - <
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ description: CoughSyrup adapter for the Rails asset pipeline.
49
+ email:
50
+ - hilty.matthew@gmail.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - Gemfile
56
+ - MIT-LICENSE
57
+ - README.markdown
58
+ - Rakefile
59
+ - cough-rails.gemspec
60
+ - lib/assets/javascripts/cough-syrup.js.erb
61
+ - lib/cough-rails.rb
62
+ - lib/cough/rails/engine.rb
63
+ - lib/cough/rails/template_handler.rb
64
+ - lib/cough/rails/version.rb
65
+ - lib/rails/generators/cough/assets/assets_generator.rb
66
+ - lib/rails/generators/cough/assets/templates/javascript.js.cough
67
+ homepage: https://github.com/rails/coffee-rails
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.1.9
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: CoughSyrup adapter for the Rails asset pipeline.
91
+ test_files: []