Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dmonsewicz/updating with upstream #1

Merged
merged 22 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,34 @@ bundler_args: "--binstubs --standalone --without documentation --path ../bundle"

script: "bundle exec rake test"

before_install:
- rvm @global do gem uninstall bundler -x
- gem install bundler --version '< 2'

gemfile:
- gemfiles/sprockets-rails_3_0.gemfile
- gemfiles/sprockets-rails_2_3.gemfile
- gemfiles/sprockets_3_0.gemfile
- gemfiles/sprockets_4_0.gemfile
- gemfiles/rails_4_2.gemfile
- gemfiles/rails_5_2.gemfile
- gemfiles/rails_6_0.gemfile

rvm:
- 2.4.4
- 2.5.1
- 2.4.6
- 2.5.5
- 2.6.3
- jruby

matrix:
allow_failures:
- gemfile: gemfiles/rails_4_2.gemfile
rvm: jruby
- gemfile: gemfiles/rails_6_0.gemfile
rvm: jruby
exclude:
- gemfile: gemfiles/rails_6_0.gemfile
rvm: 2.4.6

notifications:
email: false
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ fair place to play.

[The full community guidelines can be found on the Sass website.][link]

[link]: http://sass-lang.com/community-guidelines
[link]: https://sass-lang.com/community-guidelines
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ is maintained by [Ryan Boland](https://ryanboland.com) and [awesome contributors

## Changelog

- **2.1.2**
- [Correct reference to SassC::Script::Value::String](https://github.com/sass/sassc-rails/pull/129)
- **2.1.1**
- [Fix Scaffolding](https://github.com/sass/sassc-rails/pull/119)
- **2.1.0**
- [JRuby support](https://github.com/sass/sassc-rails/pull/113)
- [SCSS / SASS scaffolding](https://github.com/sass/sassc-rails/pull/112)
Expand Down
6 changes: 6 additions & 0 deletions gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem "rails", "~> 6.0.a"

# Specify your gem's dependencies in sassc-rails.gemspec
gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/sprockets-rails_3_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem "sprockets-rails", "~> 3.0.0"
gem "sprockets-rails", "~> 3.2"

# Specify your gem's dependencies in sassc-rails.gemspec
gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/sprockets_3_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem "sprockets", "~> 3.0.3"
gem "sprockets", "~> 3.7"

# Specify your gem's dependencies in sassc-rails.gemspec
gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/rails/generators/sass/assets/templates/stylesheet.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Place all the styles related to the <%= name %> controller here.
// They will automatically be included in application.css.
// You can use Sass here: http://sass-lang.com/
// You can use Sass here: https://sass-lang.com/
4 changes: 2 additions & 2 deletions lib/rails/generators/sass_scaffold.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "sass/css"
require "sassc/engine"
require "rails/generators/named_base"

module Sass
Expand All @@ -7,7 +7,7 @@ class ScaffoldBase < ::Rails::Generators::NamedBase
def copy_stylesheet
dir = ::Rails::Generators::ScaffoldGenerator.source_root
file = File.join(dir, "scaffold.css")
converted_contents = ::Sass::CSS.new(File.read(file)).render(syntax)
converted_contents = ::SassC::Engine.new(File.read(file)).render
create_file "app/assets/stylesheets/scaffolds.#{syntax}", converted_contents
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rails/generators/scss/assets/templates/stylesheet.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Place all the styles related to the <%= name %> controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// You can use Sass (SCSS) here: https://sass-lang.com/
2 changes: 1 addition & 1 deletion lib/sassc/rails/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Sprockets
module SassFunctions
def asset_data_url(path)
SassC::Script::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
::SassC::Script::Value::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
end
end
end
Expand Down
10 changes: 5 additions & 5 deletions lib/sassc/rails/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ def import_for(full_path, parent_dir, options)
EXTENSIONS = [
CssScssExtension.new,
CssSassExtension.new,
Extension.new(".scss"),
Extension.new(".sass"),
CSSExtension.new,
SassERBExtension.new,
ERBExtension.new(".scss.erb"),
ERBExtension.new(".css.erb"),
SassERBExtension.new
]
Extension.new(".scss"),
Extension.new(".sass"),
CSSExtension.new
].freeze

PREFIXS = [ "", "_" ]
GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
Expand Down
2 changes: 1 addition & 1 deletion lib/sassc/rails/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module SassC
module Rails
VERSION = "2.1.0"
VERSION = "2.1.2"
end
end
2 changes: 1 addition & 1 deletion sassc-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_development_dependency 'pry'
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency 'mocha'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "globbed_multiple_extensions/**/*";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.glob {
margin: <%= 0 %>;
}
10 changes: 10 additions & 0 deletions test/sassc_rails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ def test_allows_for_inclusion_of_inline_source_maps
# assert_match /\.import-css-application/, css_output
#end

def test_globbed_imports_work_with_multiple_extensions
initialize!

asset = render_asset("glob_multiple_extensions_test.css")

assert_equal <<-CSS, asset
.glob{margin:0}
CSS
end

def test_globbed_imports_work_when_globbed_file_is_changed
skip "This seems to work in practice, possible test setup problem"

Expand Down