my_react_tools 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +43 -0
- data/Rakefile +1 -0
- data/lib/my_react_tools/templates/my_react_tools.rb +12 -0
- data/lib/my_react_tools/templates/package.json +13 -0
- data/lib/my_react_tools/templates/views.js +1 -0
- data/lib/my_react_tools/version.rb +3 -0
- data/lib/my_react_tools.rb +5 -0
- data/lib/tasks/react_tools.rake +27 -0
- data/my_react_tools.gemspec +27 -0
- metadata +140 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 49478b5fa03340e10fd2a1c2e7ff6562640f3a91
         | 
| 4 | 
            +
              data.tar.gz: 63a34196608758f8728b8497d28a4ba20e6c3ef1
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: fbd676761ac568792f47f63ded7d365b4fb32a251ec146a902432f5bdea9c78ceee1a41cf3b51545533f74958e04c936c9f0f0d49666618321a3f41ba122921e
         | 
| 7 | 
            +
              data.tar.gz: f9ba21a81604412e42824e6af0cd6831f41310dda44a88349cc53ab49ff95e7a8a8a054b9eef4ff78454394845564d2b6f8c43a63059e6ca19df4839c44a7014
         | 
    
        data/.gitignore
    ADDED
    
    | @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            *.gem
         | 
| 2 | 
            +
            *.rbc
         | 
| 3 | 
            +
            .bundle
         | 
| 4 | 
            +
            .config
         | 
| 5 | 
            +
            .yardoc
         | 
| 6 | 
            +
            Gemfile.lock
         | 
| 7 | 
            +
            InstalledFiles
         | 
| 8 | 
            +
            _yardoc
         | 
| 9 | 
            +
            coverage
         | 
| 10 | 
            +
            doc/
         | 
| 11 | 
            +
            lib/bundler/man
         | 
| 12 | 
            +
            pkg
         | 
| 13 | 
            +
            rdoc
         | 
| 14 | 
            +
            spec/reports
         | 
| 15 | 
            +
            test/tmp
         | 
| 16 | 
            +
            test/version_tmp
         | 
| 17 | 
            +
            tmp
         | 
| 18 | 
            +
            *.bundle
         | 
| 19 | 
            +
            *.so
         | 
| 20 | 
            +
            *.o
         | 
| 21 | 
            +
            *.a
         | 
| 22 | 
            +
            mkmf.log
         | 
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            Copyright (c) 2015 TODO: Write your name
         | 
| 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 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.
         | 
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,43 @@ | |
| 1 | 
            +
            # MyReactTools
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Tools and configurations I need to develop Rails web app with ReactJs, includes:
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                npm, react-rails, bower-rails, browserify-rails
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            ## Installation
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            Add this line to your application's Gemfile:
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                gem 'my_react_tools'
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            And then execute:
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                $ bundle
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            Or install it yourself as:
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                $ gem install my_react_tools
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            ## Usage
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            Generate config files:
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                $ rake rake react_tools:generate
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            Installation:
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                $ rake react_tools:install
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            Conventions:
         | 
| 32 | 
            +
             | 
| 33 | 
            +
              - React components are put in `components` directory and exported as CommonJs modules. They are not exposed in global scope.
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                  $ var Component = require('components/component.jsx')
         | 
| 36 | 
            +
             | 
| 37 | 
            +
              - ViewPages are in views folder and binded to global scope (window scope), so that they can be rendered directly from Rails controller
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                  $ render component: 'Module.myView'
         | 
| 40 | 
            +
             | 
| 41 | 
            +
              - To install bowers before assets precompile, enable this option in initializers/bower_rails.rb
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                  $ bower_rails.install_before_precompile = true
         | 
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            require "bundler/gem_tasks"
         | 
| @@ -0,0 +1,12 @@ | |
| 1 | 
            +
            config = Rails.application.config
         | 
| 2 | 
            +
            config.browserify_rails.commandline_options = "-t [ reactify --es6 target --es5 ]"
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            config.react.server_renderer_pool_size  ||= 1  # ExecJS doesn't allow more than one on MRI
         | 
| 5 | 
            +
            config.react.server_renderer_timeout    ||= 20 # seconds
         | 
| 6 | 
            +
            config.react.server_renderer = React::ServerRendering::SprocketsRenderer
         | 
| 7 | 
            +
            config.react.server_renderer_options = {
         | 
| 8 | 
            +
              files: ["react.js", "views/views.js"], # files to load for prerendering
         | 
| 9 | 
            +
              replay_console: true,                 # if true, console.* will be replayed client-side
         | 
| 10 | 
            +
            }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            config.assets.paths << "vendor/bower_components/"
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            //= require_tree .
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            require 'bower-rails'
         | 
| 2 | 
            +
            require 'react-rails'
         | 
| 3 | 
            +
            require 'browserify-rails'
         | 
| 4 | 
            +
            require 'rake'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            namespace :react_tools do
         | 
| 7 | 
            +
              desc "Install npm"
         | 
| 8 | 
            +
              task :generate do
         | 
| 9 | 
            +
                source_file = File.join File.dirname(__dir__), "my_react_tools/templates"
         | 
| 10 | 
            +
                copy_file "#{source_file}/package.json", "package.json"
         | 
| 11 | 
            +
                copy_file "#{source_file}/my_react_tools.rb", "config/initializers/my_react_tools.rb"
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                views_path = "app/assets/javascripts/views/views.js"
         | 
| 14 | 
            +
                dirname = File.dirname(views_path)
         | 
| 15 | 
            +
                unless File.directory?(dirname)
         | 
| 16 | 
            +
                  mkdir_p(dirname)
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
                copy_file "#{source_file}/views.js", views_path
         | 
| 19 | 
            +
                sh "rails generate bower_rails:initialize json"
         | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
              task :install  do
         | 
| 23 | 
            +
                sh "npm install"
         | 
| 24 | 
            +
                sh "rails generate react:install"
         | 
| 25 | 
            +
                Rake::Task['bower:install'].invoke
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
            end
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            # coding: utf-8
         | 
| 2 | 
            +
            lib = File.expand_path('../lib', __FILE__)
         | 
| 3 | 
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         | 
| 4 | 
            +
            require 'my_react_tools/version'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            Gem::Specification.new do |spec|
         | 
| 7 | 
            +
              spec.name          = "my_react_tools"
         | 
| 8 | 
            +
              spec.version       = MyReactTools::VERSION
         | 
| 9 | 
            +
              spec.authors       = ["Thai Nguyen"]
         | 
| 10 | 
            +
              spec.email         = ["nguyen7thai@gmail.com"]
         | 
| 11 | 
            +
              spec.summary       = %q{Tools I need to develop web app using reactjs.}
         | 
| 12 | 
            +
              spec.description   = %q{Tools I need to develop web app using reactjs.}
         | 
| 13 | 
            +
              spec.homepage      = ""
         | 
| 14 | 
            +
              spec.license       = "MIT"
         | 
| 15 | 
            +
             | 
| 16 | 
            +
              spec.files         = `git ls-files -z`.split("\x0")
         | 
| 17 | 
            +
              spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
         | 
| 18 | 
            +
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         | 
| 19 | 
            +
              spec.require_paths = ["lib"]
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              spec.add_development_dependency "bundler", "~> 1.6"
         | 
| 22 | 
            +
              spec.add_development_dependency "rake"
         | 
| 23 | 
            +
              spec.add_dependency "rails"
         | 
| 24 | 
            +
              spec.add_dependency "react-rails", "~> 1.3.2"
         | 
| 25 | 
            +
              spec.add_dependency "bower-rails", "~> 0.10.0"
         | 
| 26 | 
            +
              spec.add_dependency "browserify-rails", "~> 1.5.0"
         | 
| 27 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,140 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: my_react_tools
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.0.1
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Thai Nguyen
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2015-10-29 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: bundler
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - "~>"
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '1.6'
         | 
| 20 | 
            +
              type: :development
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - "~>"
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '1.6'
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: rake
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - ">="
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '0'
         | 
| 34 | 
            +
              type: :development
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - ">="
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '0'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: rails
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - ">="
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '0'
         | 
| 48 | 
            +
              type: :runtime
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - ">="
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '0'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: react-rails
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - "~>"
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: 1.3.2
         | 
| 62 | 
            +
              type: :runtime
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - "~>"
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: 1.3.2
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: bower-rails
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - "~>"
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: 0.10.0
         | 
| 76 | 
            +
              type: :runtime
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - "~>"
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: 0.10.0
         | 
| 83 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            +
              name: browserify-rails
         | 
| 85 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 | 
            +
                requirements:
         | 
| 87 | 
            +
                - - "~>"
         | 
| 88 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            +
                    version: 1.5.0
         | 
| 90 | 
            +
              type: :runtime
         | 
| 91 | 
            +
              prerelease: false
         | 
| 92 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 | 
            +
                requirements:
         | 
| 94 | 
            +
                - - "~>"
         | 
| 95 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            +
                    version: 1.5.0
         | 
| 97 | 
            +
            description: Tools I need to develop web app using reactjs.
         | 
| 98 | 
            +
            email:
         | 
| 99 | 
            +
            - nguyen7thai@gmail.com
         | 
| 100 | 
            +
            executables: []
         | 
| 101 | 
            +
            extensions: []
         | 
| 102 | 
            +
            extra_rdoc_files: []
         | 
| 103 | 
            +
            files:
         | 
| 104 | 
            +
            - ".gitignore"
         | 
| 105 | 
            +
            - Gemfile
         | 
| 106 | 
            +
            - LICENSE.txt
         | 
| 107 | 
            +
            - README.md
         | 
| 108 | 
            +
            - Rakefile
         | 
| 109 | 
            +
            - lib/my_react_tools.rb
         | 
| 110 | 
            +
            - lib/my_react_tools/templates/my_react_tools.rb
         | 
| 111 | 
            +
            - lib/my_react_tools/templates/package.json
         | 
| 112 | 
            +
            - lib/my_react_tools/templates/views.js
         | 
| 113 | 
            +
            - lib/my_react_tools/version.rb
         | 
| 114 | 
            +
            - lib/tasks/react_tools.rake
         | 
| 115 | 
            +
            - my_react_tools.gemspec
         | 
| 116 | 
            +
            homepage: ''
         | 
| 117 | 
            +
            licenses:
         | 
| 118 | 
            +
            - MIT
         | 
| 119 | 
            +
            metadata: {}
         | 
| 120 | 
            +
            post_install_message: 
         | 
| 121 | 
            +
            rdoc_options: []
         | 
| 122 | 
            +
            require_paths:
         | 
| 123 | 
            +
            - lib
         | 
| 124 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 125 | 
            +
              requirements:
         | 
| 126 | 
            +
              - - ">="
         | 
| 127 | 
            +
                - !ruby/object:Gem::Version
         | 
| 128 | 
            +
                  version: '0'
         | 
| 129 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 130 | 
            +
              requirements:
         | 
| 131 | 
            +
              - - ">="
         | 
| 132 | 
            +
                - !ruby/object:Gem::Version
         | 
| 133 | 
            +
                  version: '0'
         | 
| 134 | 
            +
            requirements: []
         | 
| 135 | 
            +
            rubyforge_project: 
         | 
| 136 | 
            +
            rubygems_version: 2.4.5
         | 
| 137 | 
            +
            signing_key: 
         | 
| 138 | 
            +
            specification_version: 4
         | 
| 139 | 
            +
            summary: Tools I need to develop web app using reactjs.
         | 
| 140 | 
            +
            test_files: []
         |