wingrunr21 / flat-ui-sass

Designmodo's Flat-UI ported to SASS with support for Flat-UI Pro
MIT License
156 stars 44 forks source link

Incompatibility with sass-rails #14

Closed fredkelly closed 10 years ago

fredkelly commented 10 years ago

Thanks for taking on this project :)

I'm running edge rails and getting the following when I try to bundle:

Bundler could not find compatible versions for gem "sass":
  In Gemfile:
    sass-rails (>= 0) ruby depends on
      sass (~> 3.2.0) ruby

    flat-ui-sass (>= 0) ruby depends on
      sass (3.3.4)

Is there anything that can be done to resolve the compatibility issue?

fredkelly commented 10 years ago

Additionally, if I use sass-rails from rubygems, I get the following when trying to run fui_convert:

/Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/lib/tasks/converter.rb:26:in `require': /Users/fred/.rvm/gems/ruby-1.9.3-p448/gems/bootstrap-sass-3.1.1.0/tasks/converter/logger.rb:13: syntax error, unexpected tLABEL (SyntaxError)
... def log_transform(*args, from: caller[1][/`.*'/][1..-2].sub...
...                               ^
/Users/fred/.rvm/gems/ruby-1.9.3-p448/gems/bootstrap-sass-3.1.1.0/tasks/converter/logger.rb:13: syntax error, unexpected ')', expecting keyword_end
/Users/fred/.rvm/gems/ruby-1.9.3-p448/gems/bootstrap-sass-3.1.1.0/tasks/converter/logger.rb:56: syntax error, unexpected keyword_end, expecting $end
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/lib/tasks/converter.rb:26:in `block in <top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/lib/tasks/converter.rb:25:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/lib/tasks/converter.rb:25:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/lib/flat-ui-sass/cli.rb:2:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/lib/flat-ui-sass/cli.rb:2:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/bin/fui_convert:8:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-d0ef0ad35da4/bin/fui_convert:8:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bin/fui_convert:23:in `load'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bin/fui_convert:23:in `<main>'
wingrunr21 commented 10 years ago

Looks like bootstrap sass updated something in the logger. There's a TODO to remove that dependency. I'll have to take a look.

Unfortunately sass 3.3 is needed because I need to perform variable introspection for one of the flat ui modules. sass-rails 4.0.1 does not lock to sass 3.2 and should work. I'm using it in production now.

I am planning on adding support for 3.2 but it will require some aspects of flat ui being unsupported.

fredkelly commented 10 years ago

Thanks for getting back to me. Which versions of the gems would you advise to get running? - is it possible to just run the compile task once and then continue without requiring the gem itself?

wingrunr21 commented 10 years ago

I'm currently running it on sass-rails v4.0.1, bootstrap-sass v3.1.1.0, and sass v3.3.3. sass-rails v4.0.2 locked sass to < 3.3 until they can get compatibility. That unfortunately appears to part of a "rewrite" PR.

The features I'm using in Sass 3.3 are not entirely a function of the converter but are also a requirement of the scss files themselves. The asset helper function will need to be changed back to the method bootstrap-sass is using. This should be an easy change.

The variable interpolation is the harder change. Sass 3.3 is required for that functionality. Fortunately, that is only used as a part of the palette module.

I was not originally planning on supporting Sass 3.2 but now that sass-rails has blocked installing 3.3 I will have to. I'll create a new issue for supporting it.

wingrunr21 commented 10 years ago

Closing this. #15 will track Sass v3.2 support.

wingrunr21 commented 10 years ago

@fredkelly can you give the sass_32_support branch a try for me?

fredkelly commented 10 years ago

Thanks for coming up with that so quickly, unfortunately no combination of either the new branch or switching to the gem versions you listed above seems to be working for me, I still get the following when running bundle exec fui_convert:

/Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/lib/tasks/converter.rb:27:in `require': /Users/fred/.rvm/gems/ruby-1.9.3-p448/gems/bootstrap-sass-3.1.1.0/tasks/converter/logger.rb:13: syntax error, unexpected tLABEL (SyntaxError)
... def log_transform(*args, from: caller[1][/`.*'/][1..-2].sub...
...                               ^
/Users/fred/.rvm/gems/ruby-1.9.3-p448/gems/bootstrap-sass-3.1.1.0/tasks/converter/logger.rb:13: syntax error, unexpected ')', expecting keyword_end
/Users/fred/.rvm/gems/ruby-1.9.3-p448/gems/bootstrap-sass-3.1.1.0/tasks/converter/logger.rb:56: syntax error, unexpected keyword_end, expecting $end
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/lib/tasks/converter.rb:27:in `block in <top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/lib/tasks/converter.rb:26:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/lib/tasks/converter.rb:26:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/lib/flat-ui-sass/cli.rb:2:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/lib/flat-ui-sass/cli.rb:2:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/bin/fui_convert:8:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bundler/gems/flat-ui-sass-1641b46932e8/bin/fui_convert:8:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bin/fui_convert:23:in `load'
    from /Users/fred/.rvm/gems/ruby-1.9.3-p448/bin/fui_convert:23:in `<main>'
wingrunr21 commented 10 years ago

Hmm I don't get that in my test app. Can you paste your whole bundle?

fredkelly commented 10 years ago

Gemfile.lock:

GIT
  remote: git://github.com/ghempton/ember-script-rails.git
  revision: 9a1f09b0c53bf51c37c35490cc76cd7dfe461234
  specs:
    ember_script-rails (0.0.3)
      ember_script (>= 0.0.4)
      rails

GIT
  remote: git://github.com/rails/arel.git
  revision: 24995298face1d08ffb52f6c1b0374feeb7a380b
  specs:
    arel (5.0.0.20140210193626)

GIT
  remote: git://github.com/rails/coffee-rails.git
  revision: 044d0d683b436128dedf45f780b8fca138d005e2
  specs:
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)

GIT
  remote: git://github.com/rails/rails.git
  revision: 9d44b3f886847eee9c70097165863f8e37d3d1d8
  specs:
    actionmailer (4.2.0.alpha)
      actionpack (= 4.2.0.alpha)
      actionview (= 4.2.0.alpha)
      mail (~> 2.5.4)
    actionpack (4.2.0.alpha)
      actionview (= 4.2.0.alpha)
      activesupport (= 4.2.0.alpha)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.2.0.alpha)
      activesupport (= 4.2.0.alpha)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.2.0.alpha)
      activesupport (= 4.2.0.alpha)
      builder (~> 3.1)
    activerecord (4.2.0.alpha)
      activemodel (= 4.2.0.alpha)
      activesupport (= 4.2.0.alpha)
      arel (~> 5.0.0)
    activesupport (4.2.0.alpha)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    rails (4.2.0.alpha)
      actionmailer (= 4.2.0.alpha)
      actionpack (= 4.2.0.alpha)
      actionview (= 4.2.0.alpha)
      activemodel (= 4.2.0.alpha)
      activerecord (= 4.2.0.alpha)
      activesupport (= 4.2.0.alpha)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.0.alpha)
      sprockets-rails (~> 2.0.0)
    railties (4.2.0.alpha)
      actionpack (= 4.2.0.alpha)
      activesupport (= 4.2.0.alpha)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)

GIT
  remote: git://github.com/rails/sass-rails.git
  revision: 4ce534aab3379814576359106e584368346d6b31
  specs:
    sass-rails (4.0.1)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0.0)

GIT
  remote: git://github.com/rails/sprockets-rails.git
  revision: 8bf70f674ec714dc1082d279fd021075fa036a74
  specs:
    sprockets-rails (2.0.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)

GIT
  remote: git://github.com/wingrunr21/flat-ui-sass.git
  revision: 1641b46932e8e80fb76238b2e45149aa2a65ecc3
  branch: sass_32_support
  specs:
    flat-ui-sass (2.1.3)
      bootstrap-sass (>= 3.1)
      sass (>= 3.2.0)
      term-ansicolor

GEM
  remote: https://rubygems.org/
  specs:
    active_model_serializers (0.8.1)
      activemodel (>= 3.0)
    atomic (1.1.16)
    barber (0.4.2)
      ember-source
      execjs
      handlebars-source
    bootstrap-sass (3.1.1.0)
      sass (~> 3.2)
    builder (3.2.2)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.7.0)
    ember-data-source (0.14)
      ember-source
    ember-rails (0.14.1)
      active_model_serializers
      barber (>= 0.4.1)
      ember-data-source
      ember-source
      execjs (>= 1.2)
      handlebars-source
      jquery-rails (>= 1.0.17)
      railties (>= 3.1)
    ember-source (1.4.0)
      handlebars-source (~> 1.0)
    ember_script (0.0.5)
      ember_script-source (>= 0.0.2)
      execjs
      tilt
    ember_script-source (0.0.14)
    erubis (2.7.0)
    execjs (2.0.2)
    handlebars-source (1.3.0)
    hike (1.2.3)
    i18n (0.6.9)
    jbuilder (1.5.3)
      activesupport (>= 3.0.0)
      multi_json (>= 1.2.0)
    jquery-rails (3.1.0)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.25.1)
    minitest (5.3.1)
    multi_json (1.9.2)
    mysql2 (0.3.15)
    polyglot (0.3.4)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rake (10.1.1)
    rdoc (4.1.1)
      json (~> 1.4)
    sass (3.2.18)
    sdoc (0.4.0)
      json (~> 1.8)
      rdoc (~> 4.0, < 5.0)
    sprockets (2.11.0)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    term-ansicolor (1.3.0)
      tins (~> 1.0)
    thor (0.19.0)
    thread_safe (0.3.1)
      atomic (>= 1.1.7, < 2)
    tilt (1.4.1)
    tins (1.0.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (1.1.0)
      thread_safe (~> 0.1)
    uglifier (2.5.0)
      execjs (>= 0.3.0)
      json (>= 1.8.0)

PLATFORMS
  ruby

DEPENDENCIES
  active_model_serializers
  arel!
  bootstrap-sass (= 3.1.1.0)
  coffee-rails!
  ember-rails (~> 0.14)
  ember-source (~> 1.1)
  ember_script-rails!
  flat-ui-sass!
  jbuilder (~> 1.2)
  jquery-rails
  mysql2
  rails!
  sass-rails!
  sdoc
  sprockets-rails!
  uglifier (>= 1.3.0)
wingrunr21 commented 10 years ago

Does the conversion run on rails 4 or 4.1?

fredkelly commented 10 years ago

Tried 4.0.2, still getting the same error :(

wingrunr21 commented 10 years ago

@fredkelly The problem appears to be in bootstrap-sass. This line is not compatible with 1.9 interpreters it seems. I'll have to do the work to no longer depend on their logger in order to fix it. In the mean time, you can run the conversion under a 2.0 interpreter but stll use 1.9 to run your app.

fredkelly commented 10 years ago

That's done the job - much appreciated!