Code Monkey home page Code Monkey logo

emcee's People

Contributors

ahuth avatar datapimp avatar pex avatar pwnall avatar rastyagaev avatar zamith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emcee's Issues

Emcee Railtie cant Modify frozen Array

I'm installing a Rails project from scratch using Bower+Emcee, following this tutorial: http://stackoverflow.com/questions/26884022/google-polymer-with-rails-4

When I get to step 3 or 4

 rails g bower_rails:initialize
 rails g emcee:install

I get this error

/home/lluarteg/.rvm/gems/ruby-2.2.2@project2/bundler/gems/emcee-a47ed9852328/lib/emcee/railtie.rb:12:in `unshift': can't modify frozen Array (RuntimeError)
from /home/lluarteg/.rvm/gems/ruby-2.2.2@project2/bundler/gems/emcee-  a47ed9852328/lib/emcee/railtie.rb:12:in `block in <class:Railtie>'
from /home/lluarteg/.rvm/gems/ruby-2.2.2@project2/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
...

I'm using Rails 4.2.1 and Ruby 2.2.2

This is how my Gemfile looks

source 'https://rubygems.org'
ruby "2.2.2"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

gem 'rails_12factor', group: :production
# Use Puma as the app server
gem 'puma'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'bower-rails'
gem 'emcee', github: 'ahuth/emcee'



group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

Could not find ".bowerrc" in any of your source paths.

Could not find ".bowerrc" in any of your source paths. Your current source paths are: 
/usr/local/lib/ruby/gems/2.1.0/gems/emcee-1.0.0/lib/generators/emcee/install/templates

I have Bower installed.

I had to add the <%= html_import_tag "application" %> manually to application.html.erb as it was not added as part of the install.

It renders this into the application.html:

<link href="/assets/application.html?body=1" rel="import">

But that file is served as plain text in the browser. Something is wrong.

Encoding / Umlauts escaping in JavaScript

Currently umlauts (ö, ä, ü, etc) get escaped when used in javascript.
I am using emcee with polymer. Simple example:

<polymer-element name="some-element">
  <template>{{foo}}</template>
  <script>
    Polymer('some-element', {
      foo: 'bär'
    });
  </script>
</polymer-element>
<some-element></some-element>

... results in b&auml;r.

Routing Error

I have a routing error which says

No route matches [GET] "/%5Bobject%20Object%5D"

How I can fix this?

paper-toast not working in Firefox and Safari

Hi @ahuth. I tried to use paper-toast element with this gem but it does not work properly in Firefox and Safari browsers (Chrome works perfectly). I opened native paper-toast demo page in all of three and it works there (https://www.polymer-project.org/components/paper-toast/demo.html).
After debugging I found that issue was produced by polymer.js:10161 (TypeError: null is not an object (evaluating 'style.textContent')). Since neither Firefox nor Safari supports native web components they use polymer.js to make spikes and work properly.
So, seems to be style parameter is null there, why - I don't know. I would be very thankful if you could take a look and shed light on this issue.

polymer.js

...
installScopeStyle: function(style, name, scope) {
      var scope = scope || this.findStyleScope(), name = name || '';
      if (scope && !this.scopeHasNamedStyle(scope, this.localName + name)) {
        var cssText = '';
        if (style instanceof Array) {
          for (var i=0, l=style.length, s; (i<l) && (s=style[i]); i++) {
            cssText += s.textContent + '\n\n';
          }
        } else {
          cssText = style.textContent;
        }
        this.installScopeCssText(cssText, scope, name);
      }
    },
...

Icons within elements (e.g., paper-icon-button) not rendering; think its a pipeline issue

Hi, I'm just wondering if you have any ideas or troubleshooting tips about this: I can't get icons within web components (e.g., icon-"search" within paper-icon-button) to render in Firefox. Icons by themselves will work though. Also, this problem does not occur in Chrome. Sound like a pipeline issue to you? Thanks for emcee and any tips! Manifests as follows:

application.html

 *= require polymer/polymer
 *= require core-header-panel/core-header-panel
 *= require core-toolbar/core-toolbar
 *= require paper-button/paper-button
 *= require paper-icon-button/paper-icon-button
 *= require core-icon/core-icon
 *= require core-icons/core-icons
 *= require font-roboto/roboto
 *= require paper-shadow/paper-shadow

application.js

//= require webcomponentsjs/webcomponents
//= require jquery
//= require jquery.turbolinks
//= require jquery_ujs
//= require turbolinks
//= require_tree . 

Ampersands are escaped when a script tag is processed

When a script reference contains an ampersand, Nokogiri is converting that ampersand to html entity (&) instead of maintaining it as javascript.

<!-- component.html -->
<script src="asset.js"></script>
// asset.js
var x = c && c();
<!-- component.html : output -->
<script>var x = c && c();</script>

Polymer's optional attribute syntax is stripped

Polymer components loaded using html_import_tag have HTML stripped if they are using the syntax that Polymer uses to optionally use an attribute in a template.

For example, when loading paper-tabs.html, it defines its selectionBar div as:

<div id="selectionBar" hidden?="{{nobar}}" on-transitionend="{{barTransitionEnd}}"></div>

However, the served HTML response is:

<div id="selectionBar" hidden on-transitionend="{{barTransitionEnd}}"></div>

A quick guess is that this is a result of name?=value not actually being valid HTML, so using Nokogiri in post-processing is stripping out what it considers is invalid.

Getting a polymer component to work

I have a vendor/assets/components directory with core-icon, which I load in the manifest:

*= core-icon/core-icon

From the application layout I'm doing:

= html_import_tag "application"

I'm using slim as an html preprocessor, not sure if that's part of the issue, but the core icon does not work. If go on and use the one in the polymer project website directly:

link rel="import" href="http://www.polymer-project.org/components/core-icons/core-icons.html"

it just works.

Any help?

Issue Using Erb Templating in HTML Imports

When I attempt to erb in an HTML import I get an error. For example, I have this in assets/components/post.html.erb:

<polymer-element name="form-post">
  <template>
    <%= form_tag("/posts", method: 'post') do %>
      <%= text_area_tag "post[body]" %>
      <%= submit_tag %>
    <% end %>
  </template>
  <script>
    Polymer('form-post', {
      ready: function() {
        //...
      }
    });
  </script>
</polymer-element>

When I attempt to load a page I get syntax error, unexpected ')'. I have even attempted to do a blank form_tag with no parameters:

<polymer-element name="form-post">
  <template>
    <%= form_tag %>
  </template>
  <script>
    Polymer('form-post', {
      ready: function() {
        //...
      }
    });
  </script>
</polymer-element>

in which case I get undefined method 'form_tag'.

I'm not sure how erb-ing would work in templated HTML anyway. I was attempting to try it out. If erb-ing and HTML templating does not work in conjunction then that limits the capabilities of what you could do with frameworks like Polymer. Is there another way of doing this (besides stupid _helpers.html.erb, which doesn't really componentize -- it just renders things once)?

Duplicate method required

After commit 88f4c0c, our ActionView helper monkey-patch requires the path_to_html method to be defined in both AssetTagHelper and AssetUrlHelper.

I'm not sure why, but if it's not, a NoMethod error is thrown by the html_import_tag helper.

Before that commit, we monkey patched ActionView directly:

module ActionView
  module Helpers
    module AssetUrlHelper
      # Monkey patching
    end
  end
end

After the commit, the methods we want to insert into ActionView are in their own module:

module Emcee
  module Helpers
    module ActionView
      module AssetUrlHelper
        # Same methods
      end
    end
  end
end

and in another file, we monkey patch ActionView:

module ActionView
  module Helpers
    module AssetUrlHelper
      include Emcee::Helpers::ActionView::AssetUrlHelper
    end
  end
end

Since changing to this method of monkey patching ActionView, I have to define path_to_html in both Emcee::Helpers::ActionView::AssetUrlHelper, where it was originally defined, AND in Emcee::Helpers::ActionView::AssetTagHelper.

Our AssetTagHelper module does use path_to_html, but it did not have to be defined there before.

With the change, Emcee passes all tests. It makes me uneasy, however, to have the same method defined in two places for reasons I don't understand.

core-icon-button not working (random src)

I am trying to use the core-icon-button component but the src element inside it is always set to src="assets/core-icon-button/%7B%7Bsrc%7D%7D" no matter what I set it to when I declare it, or if I'm using an icon instead.

If I modify the core-icon-button.html file and remove src={{src}} on line 35, I can get it to work by using the icon attribute.

If I had to guess I would say that src value is coming from some bug and when it's present it overrides everything else.

core-transition throwing exception

When using anything that extends core-transition(core-overlay,paper-dialog,dropdowns, etc.) Firefox throws an exception and either renders a blank page or does not render the tag:

"Exception caught during observer callback: styles.installScopeStyle@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:10189:11 .setup@https://cal-class-schedule-npezza.c9.io/assets/core-transition/core-transition-css.html?body=1.js:73:1 .ensureTargetSetup@https://cal-class-schedule-npezza.c9.io/assets/core-overlay/core-overlay.html?body=1.js:228:9 .openedChanged@https://cal-class-schedule-npezza.c9.io/assets/core-overlay/core-overlay.html?body=1.js:241:7 properties.invokeMethod@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:9383:9 properties.notifyPropertyChanges@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:9372:15 Observer.prototype.report_@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:4912:9 CompoundObserver.prototype<.check_@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:5318:1 global.Platform.performMicrotaskCheckpoint@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:4973:13 flush/<@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:8176:7 atEndOfMicrotask@https://cal-class-schedule-npezza.c9.io/assets/polymer/polymer.html?body=1.js:8121:5 notifyObservers@https://cal-class-schedule-npezza.c9.io/assets/webcomponentsjs/webcomponents.js?body=1:577:13 handle@https://cal-class-schedule-npezza.c9.io/assets/webcomponentsjs/webcomponents.js?body=1:522:1 "

Has anyone experienced this issue or know how to fix it.

core-icon, core-scaffold not working

core-scaffold in mobile view, afther pushing the icon for opening the side bar, the drawer wont show.

I tried it on different browsers, also in production mode with precompiled assets, tried to call the core-scaffolds toggleDrawer, method from console but it did nothing.

And i'm also getting problems with displaying core-icons. I tried to require polymer/polymer in application.html as it was mentioned here: #7 but it didn't remove the issue.

Here is the source code for the sample application:
https://github.com/n1o/polymer-emcee-test

External stylesheets aren't being reloaded

Hey again,

External stylesheets are working now (#23), but aren't being reloaded upon making changes to the stylesheet.

For example:

<!-- app/assets/components/signin-register/signin-register.html -->
<polymer-element name="signin-register" noscript>
  <template>
    <link href="signin-register.css.scss" rel="stylesheet">
    <main-layout>
      <span class="title">Sign in / Register</span>
      <paper-button class="button" label="Sign in"></paper-button>
      <paper-button class="button" label="Register"></paper-button>
    </main-layout>
  </template>
</polymer-element>
// app/assets/components/signin-register/signin-register.css.scss
@import "mixins";

.button {
  background: $primary-color-dark;
  color: white;
}

Results in the following CSS:

/* line 3, .../app/assets/components/signin-register/signin-register.css.scss */
.button {
  background: #455a64;
  color: white;
}

But when I make changes to the stylesheet...

// app/assets/components/signin-register/signin-register.css.scss
@import "mixins";

.button {
  background: black;
  color: white;
}

The CSS remains the same as before:

/* line 3, .../app/assets/components/signin-register/signin-register.css.scss */
.button {
  background: #455a64;
  color: white;
}

I've found that railtie.rb#L26 is only executed when the HTML changes (not when just the stylesheet changes), but beyond that, I'm not sure how to solve this issue.

Thanks!

Image asset urls

I'm using the leaflet-map web component ("leaflet-map": "nhnb/leaflet-map#master" in bower). It is working well for js and css, so the maps and colors are correct.

However, there are markers on the map which make use of images. Those paths point to
<img src="../leaflet/dist/images/marker-icon-2x.png"> which do not exist. Instead, Rails asset pipeline actually makes the image available on /assets/marker-icon-2x.png.

Sure, changing the path in the web component can be done, but that kind of defeats the purpose of reusable web components.

How should image paths in web components be declared so they work in all frameworks?

Sprockets::FileNotFound thrown if component includes external CSS

I've installed Polymer/paper-button component from bower
( bower install Polymer/paper-button )
which includes Google's web font in CSS.

When evaluating external link, Sprockets::FileNotFound is being thrown. If local CSS is used, it works as expected.

Link tag which throws the error:

<!-- app/assets/components/font-roboto\roboto.html -->
<link href='//fonts.googleapis.com/css?family=RobotoDraft:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en' rel='stylesheet' type='text/css'>

Stack trace:

sprockets (2.11.0) lib/sprockets/context.rb:87:in `resolve'
sprockets (2.11.0) lib/sprockets/context.rb:178:in `evaluate'
emcee (1.0.3) lib/emcee/post_processors/stylesheet_processor.rb:25:in `block in inline_styles'
nokogiri-1.6.2.1-x86 (mingw32) lib/nokogiri/xml/node_set.rb:237:in `block in each'
nokogiri-1.6.2.1-x86 (mingw32) lib/nokogiri/xml/node_set.rb:236:in `upto'
nokogiri-1.6.2.1-x86 (mingw32) lib/nokogiri/xml/node_set.rb:236:in `each'
emcee (1.0.3) lib/emcee/post_processors/stylesheet_processor.rb:23:in `inline_styles'
emcee (1.0.3) lib/emcee/post_processors/stylesheet_processor.rb:16:in `process'
emcee (1.0.3) lib/emcee/railtie.rb:26:in `block (2 levels) in <class:Railtie>'
sprockets (2.11.0) lib/sprockets/processor.rb:29:in `call'
sprockets (2.11.0) lib/sprockets/processor.rb:29:in `evaluate'
tilt (1.4.1) lib/tilt/template.rb:103:in `render'
sprockets (2.11.0) lib/sprockets/context.rb:197:in `block in evaluate'
sprockets (2.11.0) lib/sprockets/context.rb:194:in `each'
sprockets (2.11.0) lib/sprockets/context.rb:194:in `evaluate'
sprockets (2.11.0) lib/sprockets/processed_asset.rb:12:in `initialize'
sprockets (2.11.0) lib/sprockets/base.rb:374:in `new'
sprockets (2.11.0) lib/sprockets/base.rb:374:in `block in build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:395:in `circular_call_protection'
sprockets (2.11.0) lib/sprockets/base.rb:373:in `build_asset'
sprockets (2.11.0) lib/sprockets/index.rb:94:in `block in build_asset'
sprockets (2.11.0) lib/sprockets/caching.rb:58:in `cache_asset'
sprockets (2.11.0) lib/sprockets/index.rb:93:in `build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:287:in `find_asset'
sprockets (2.11.0) lib/sprockets/index.rb:61:in `find_asset'
sprockets (2.11.0) lib/sprockets/processed_asset.rb:44:in `block in init_with'
sprockets (2.11.0) lib/sprockets/processed_asset.rb:37:in `map'
sprockets (2.11.0) lib/sprockets/processed_asset.rb:37:in `init_with'
sprockets (2.11.0) lib/sprockets/asset.rb:24:in `from_hash'
sprockets (2.11.0) lib/sprockets/caching.rb:54:in `cache_asset'
sprockets (2.11.0) lib/sprockets/index.rb:93:in `build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:287:in `find_asset'
sprockets (2.11.0) lib/sprockets/index.rb:61:in `find_asset'
sprockets (2.11.0) lib/sprockets/bundled_asset.rb:37:in `init_with'
sprockets (2.11.0) lib/sprockets/asset.rb:24:in `from_hash'
sprockets (2.11.0) lib/sprockets/caching.rb:54:in `cache_asset'
sprockets (2.11.0) lib/sprockets/index.rb:93:in `build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:287:in `find_asset'
sprockets (2.11.0) lib/sprockets/index.rb:61:in `find_asset'
sprockets (2.11.0) lib/sprockets/environment.rb:75:in `find_asset'
sprockets (2.11.0) lib/sprockets/base.rb:295:in `[]'
sprockets-rails (2.0.1) lib/sprockets/rails/helper.rb:77:in `asset_digest_path'
sprockets-rails (2.0.1) lib/sprockets/rails/helper.rb:40:in `compute_asset_path'
actionpack (4.0.5) lib/action_view/helpers/asset_url_helper.rb:132:in `asset_path'
emcee (1.0.3) lib/emcee/helpers/asset_url_helper.rb:11:in `path_to_html'
emcee (1.0.3) lib/emcee/helpers/asset_tag_helper.rb:16:in `block in html_import_tag'
emcee (1.0.3) lib/emcee/helpers/asset_tag_helper.rb:13:in `map'
emcee (1.0.3) lib/emcee/helpers/asset_tag_helper.rb:13:in `html_import_tag'
emcee (1.0.3) lib/emcee/helpers/sprockets_helper.rb:24:in `html_import_tag'
actionpack (4.0.5) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.5) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.5) lib/action_view/template.rb:141:in `render'
actionpack (4.0.5) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionpack (4.0.5) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.5) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.5) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.5) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.5) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.5) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.5) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.5) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.5) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.5) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.5) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.5) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.5) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
C:/Ruby/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.0.5) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.5) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.5) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.5) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.5) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.0.5) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.5) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.0.5) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.5) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.5) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.5) lib/active_support/callbacks.rb:403:in `_run__199402322__process_action__callbacks'
activesupport (4.0.5) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.5) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.5) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.5) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.5) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.5) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.5) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.5) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.5) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.0.5) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.5) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.5) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.5) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.5) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.5) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.5) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.5) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.5) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.5) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.5) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.5) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.5) lib/action_dispatch/routing/route_set.rb:674:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/builder.rb:59:in `call'
meta_request (0.3.0) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.3.0) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.3.0) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.5) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.5) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.5) lib/active_record/migration.rb:373:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.5) lib/active_support/callbacks.rb:373:in `_run__664727201__call__callbacks'
activesupport (4.0.5) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.5) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.5) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.5) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.0.5) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.0.5) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.0.5) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.5) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.5) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.5) lib/rails/engine.rb:511:in `call'
railties (4.0.5) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
C:/Ruby/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
C:/Ruby/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
C:/Ruby/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

Getting not valid UTF-8 when using google-map web component

Hi,

I just got polymer working with emcee without problems. I then wanted to try and add som Web Components, in this case google-map (https://github.com/GoogleWebComponents/google-map).

I installed google-map using Bower and then I added this to app/assets/components/application.html:

*= require google-map/google-map

But on when running rails I get an error: app/assets/components/application.html is not valid UTF-8.

Is this a n00b mistake or did I stumble on a bug somewhere? Anything I can try out?

Thanks,
Martin

Polymer/Paper path parsing issue.

I am using emcee 1.0.7 with polymer 0.4.1 and paper and I'm running into the following error with Rails 4.1.1.:

ActionController::RoutingError (No route matches [GET] "/assets/paper-button/%7B%7BiconSrc%7D%7D"):
  actionpack (4.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.1) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.1) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.1) lib/rails/engine.rb:514:in `call'
  railties (4.1.1) lib/rails/application.rb:144:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
  thin (1.6.2) lib/thin/connection.rb:84:in `catch'
  thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
  thin (1.6.2) lib/thin/connection.rb:53:in `process'
  thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
  thin (1.6.2) lib/thin/server.rb:162:in `start'
  rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
  rack (1.5.2) lib/rack/server.rb:264:in `start'
  railties (4.1.1) lib/rails/commands/server.rb:69:in `start'
  railties (4.1.1) lib/rails/commands/commands_tasks.rb:81:in `block in server'
  railties (4.1.1) lib/rails/commands/commands_tasks.rb:76:in `tap'
  railties (4.1.1) lib/rails/commands/commands_tasks.rb:76:in `server'
  railties (4.1.1) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
  railties (4.1.1) lib/rails/commands.rb:17:in `<top (required)>'
  bin/rails:8:in `require'
  bin/rails:8:in `<top (required)>'
  spring (1.1.3) lib/spring/client/rails.rb:27:in `load'
  spring (1.1.3) lib/spring/client/rails.rb:27:in `call'
  spring (1.1.3) lib/spring/client/command.rb:7:in `call'
  spring (1.1.3) lib/spring/client.rb:26:in `run'
  spring (1.1.3) bin/spring:48:in `<top (required)>'
  spring (1.1.3) lib/spring/binstub.rb:11:in `load'
  spring (1.1.3) lib/spring/binstub.rb:11:in `<top (required)>'
  bin/spring:16:in `require'
  bin/spring:16:in `<top (required)>'
  bin/rails:3:in `load'
  bin/rails:3:in `<main>'

It appears emcee may be mis-parsing the {{..}} within the paper-shadow/paper-button source. Any suggestions?

How to properly resolve assets path?

The way it's built today it seems like the application.html will concatenate all the components dependencies, but it will not resolve the relative asset paths to proper #asset_path. I was wondering if adding bower-rails and trying the bower:resolve task would solve it. Or even using Polymer's own Vulcanize somehow.

Did you solve this already?

Reloading of stylesheets

Hi. When I change a component's stylesheet, the changes won't come in effect until I make a change to the component's html file. Is there any way around that?

<polymer-element name="my-card" noscript>
  <template>
    <link rel="stylesheet" href="my-card.css.scss" />
    <div class="my-card">
       <content></content>
    </div>
  </template>
</polymer-element>

Support: Import on custom elements

All the examples specified in the readme doc explains about how to use the web elements in the main layout html. But there isn't any info on how to use it on the custom element itself.

In a typical polymer app, everything is a web component and they can be extendable and reusable. For an example, check out the the topeka quiz element https://github.com/Polymer/topeka-elements/blob/master/templates/topeka-quiz-four-quarter.html

here the code snippet

<link rel="import" href="../topeka-quiz-base.html">
<link rel="import" href="../../core-selector/core-selector.html">
<link rel="import" href="../../paper-button/paper-button.html">

<polymer-element name="topeka-quiz-four-quarter" extends="topeka-quiz-base" noscript relative>

how can this element import can be translated to emcee way?

move all this imports to custom manifest file, and refer them in the polymer element file.

is emcee equipped to handle recursive imports on the element level.??

Any help is very much appreciated.

Feature request: Traverse import paths.

I've setup bower components in my Rails project by adding the following to my `application.rb' file.

config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')

Unfortunately when an element has imports of it's own, they are not in the asset path. It would be awesome if this gem traversed imports and included them.

Thank you.

'No such file or directory' when trying to link to a SASS stylesheet in custom element

I'm trying to link a stylesheet into a custom element which should be preprocessed by sass first. Apologies in advance if this is an issue with how I'm using sprockets.

app/assets/elements has the following structure:

├── application.html
└── �example-element�
    ├── example-element.css.scss
    ├── example-element.html
    └── example-element.js

example-element.html contains the line: <link rel="stylesheet" href="example-element.css">, which causes the following error:

No such file or directory @ rb_sysopen - /Users/peter/src/emcee-sass/app/assets/elements/example-element/example-element.css
  (in /Users/peter/src/emcee-sass/app/assets/elements/example-element/example-element.html)

If I change the <link> href to example-element.css.scss then the contents of the file is embedded into example-element.html, but isn't pre-processed by SASS.

I've created a repo demonstrating the problem: https://github.com/peterhorne/emcee-sass

HAML support for html_import_tag

HAML support would be awesome.

my-component.html.haml raises a Sprockets::FileNotFound

%polymer-element{name: "my-component"}
  %template
    Hello, #{1 * 2}.

my-component.html.erb (erb is working)

<polymer-element name="my-component">
  <template>
    <%= 1 + 2 %>
  </template>
</polymer-element>

Stylesheets linked from polymer elements aren't being precompiled

For example, paper-button.html links to paper-button.css like this:

<template>

  <link href="paper-button.css" rel="stylesheet">

  <template if="{{raisedButton}}">
    <div fit id="shadow-container">
      <paper-shadow id="shadow" z="{{z}}" animated></paper-shadow>
    </div>
  </template>

  <div id="clip">
    <!-- <div id="focusBg"></div> -->
    <paper-ripple id="ripple"></paper-ripple>
    <div id="content">
      <template if="{{iconSrc || icon}}">
        <core-icon id="icon" src="{{iconSrc}}" icon="{{icon}}"></core-icon>
      </template>
      <template if="{{label}}">
        <span>{{label}}</span>
      </template>
    </div>
  </div>

</template>

http://localhost:3000/assets/paper-button/paper-button.css loads fine when running the app in development mode, but returns a 404 in production. I suspect this is because sprockets is not precompiling paper-button.css.

Some paper elements break polymer

There seems to be a problem with element importing when using some paper elements. I've created a small demo app: https://github.com/tek/test_case
There are 4 pages at /test/{1..4}. The first one shows a working paper-tabs toolbar, in the second one, using paper-input prevents all polymer elements from being replaced. Note that using the <paper-input> element is not necessary, requiring it suffices for the breakage to occur, so I guess the import order could be screwed up.
In example 3, I used only paper-input individually, which doesn't work either, so it's not an incompability.
In example 4, I used paper-checkbox in conjunction with paper-tabs, which works fine.

Other elements exhibit the same behaviour, like paper-dropdown.
Is this an error on my part or are these elements not suitable for emcee yet?

Edit: I run this in Linux, using FF32 and Chrome 37.

Using rails + polymer how to root in rails

Hello all,

I am using rails till now for fronted. but now i have to use polymer + rails. I already bundle emcee. but don't know how to use in application. Is there any start guide that help me to start with polymer + rails
( set-up + start-up guide )

Scenario:
I have a polymer project all I just need is that how can I use that polymer project with rails and call the polymer page from rails as root.

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.