GithubHelp home page GithubHelp logo

linemanjs / lineman-plus-rails Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 73 KB

An example application that uses Lineman alongside Rails

Home Page: http://linemanjs.com/rails.html

Ruby 27.76% JavaScript 63.78% CSS 1.04% CoffeeScript 0.61% HTML 6.81%

lineman-plus-rails's People

Contributors

dependabot[bot] avatar jasonkarns avatar searls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

alfadoblemas

lineman-plus-rails's Issues

lineman-rails: gzip assets

After fingerprinting and to mimic Rails, gzip the CSS & JS assets found in dist/ with a ".gz" appended extension.

rails-lineman: can we slurp into app/assets?

If the rubygem did a lineman build and pulled in the assets under app/assets/javascripts and app/assets/stylesheets, we'd be able to avoid all the rails-mimicking.

So if the gem could wrap the assets:precompile task (@searls makes hand-wavy ๐Ÿ‘ motion), then it might work like this (only thinking about JS & CSS support):

  1. rake assets:precompile is invoked, but before we let it run:
  2. Locate the project, whine if the Lineman project isn't found. (start with just filepath support)
  3. Run npm install in the project, blow up if node isn't found with instructions on installing node.
  4. Run lineman build with cwd in the project; if the lineman bin isn't on PATH, then use the <project>/node_modules/.bin/lineman bin.
  5. Copy the contents of dist/js/**/* into app/assets/javascripts/lineman
  6. Copy the contents of dist/css/**/* into app/assets/stylesheets/lineman
  7. Invoke the wrapped assets:precompile task
  8. Delete app/assets/javascripts/lineman and app/assets/stylesheets/lineman.

So this way if someone is working on a Rails template, they'd use a script include tag for lineman/app for the main JS bundle. Rails will see this during precompile time and be sure to create that file as a manifest into public/assets.

One potentially confusing point here is that if nothing in the rails app requires any lineman/* JS or CSS paths, then nothing of the lineman app will get built into public/assets. It's a feature, but a confusing one for first time users, I'm sure..

lineman-rails: disable the pages task

I think we should disable the pages task for lineman-rails projects by default, since its most likely outcome will be to confuse users and we won't have a good way to bring that static HTML over to public/ in a sane way that wouldn't throw off normal people (especially if the default file is "index.html")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.