react-rails-livereloadable_renderer 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: 693bed7e605b41564c6b9ac834d1298475434353
4
+ data.tar.gz: 1a97e887c9a9231d9099431ed509720db7a596da
5
+ SHA512:
6
+ metadata.gz: f65c210b882591ded100bc1093ddd05067ac803e0a1ae61c137f9d021078fb59056ffa7c356f5837bd789007d664fbd2dc687eeafd822be6c163de7a29c02daa
7
+ data.tar.gz: d3fa51e91c9fc3082f0f9c45b2c2c131aafa1cb99df0b420a6940eb09bef9d839fd146c1bb7036bab0330283bf7c27dc820e4d0b4fd2a47035c4e78e0e600f38
data/.gitignore ADDED
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /vendor/bundle
26
+ /lib/bundler/man/
27
+
28
+ # for a library or gem, you might want to ignore these files since the code is
29
+ # intended to run in multiple environments; otherwise, check them in:
30
+ # Gemfile.lock
31
+ # .ruby-version
32
+ # .ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Yuku TAKAHASHI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # React::ServerRendering::LiveReloadableRenderer
2
+
3
+ `SprocketsRenderer` for development environment.
4
+
5
+ ## Usage
6
+
7
+ Add to your Gemfile:
8
+
9
+ ```rb
10
+ gem "react-rails-livereloadable_renderer", group: :development
11
+ ```
12
+
13
+ Run:
14
+
15
+ ```
16
+ bundle install
17
+ ```
18
+
19
+ ## Setup
20
+
21
+ ```rb
22
+ # config/environments/development.rb
23
+
24
+ Rails.application.configure do
25
+ config.react.server_renderer = React::ServerRendering::LiveReloadableRenderer
26
+ end
27
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1 @@
1
+ require "react/server_rendering/livereloadable_renderer"
@@ -0,0 +1,19 @@
1
+ module React
2
+ module ServerRendering
3
+ class LiveReloadableRenderer < SprocketsRenderer
4
+ def initialize(options = {})
5
+ @filenames = options.fetch(:files, ["react.js", "components.js"])
6
+ super
7
+ end
8
+
9
+ def render(component_name, props, prerender_options)
10
+ js_code = CONSOLE_POLYFILL.dup
11
+ @filenames.each do |filename|
12
+ js_code << ::Rails.application.assets[filename].to_s
13
+ end
14
+ @context = ExecJS.compile(GLOBAL_WRAPPER + js_code)
15
+ super
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "react-rails-livereloadable_renderer"
3
+ spec.version = "0.0.1"
4
+ spec.authors = ["Yuku Takahashi"]
5
+ spec.email = ["taka84u9@gmail.com"]
6
+ spec.summary = "SprocketsRenderer for development environment"
7
+ spec.homepage = "https://github.com/yuku-t/react-rails-livereloadable_renderer"
8
+ spec.license = "MIT"
9
+
10
+ spec.files = `git ls-files -z`.split("\x0")
11
+ spec.require_paths = ["lib"]
12
+
13
+ spec.add_dependency "react-rails"
14
+
15
+ spec.add_development_dependency "bundler", "~> 1.7"
16
+ spec.add_development_dependency "rake", "~> 10.0"
17
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: react-rails-livereloadable_renderer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Yuku Takahashi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: react-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description:
56
+ email:
57
+ - taka84u9@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE
65
+ - README.md
66
+ - Rakefile
67
+ - lib/react-rails-livereloadable_renderer.rb
68
+ - lib/react/server_rendering/livereloadable_renderer.rb
69
+ - react-rails-livereloadable_renderer.gemspec
70
+ homepage: https://github.com/yuku-t/react-rails-livereloadable_renderer
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 2.4.5.1
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: SprocketsRenderer for development environment
94
+ test_files: []
95
+ has_rdoc: