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

Upgrade to less-rails 4 #49

Merged
merged 10 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
mkmf.log
*.gem
spec/dummy_app/app/assets
*.gemfile.lock
47 changes: 36 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
language: ruby
cache: bundler
sudo: false
rvm:
- 2.0.0
- 2.1.9
- 2.2.5
- 2.3.1
- 2.1.10
- 2.2.10
- 2.3.7
- 2.4.4
- 2.5.1
before_install:
- travis_retry gem install bundler
- bundle --version
install:
- travis_retry bundle install
before_script:
- travis_retry bundle exec appraisal install
script:
- bundle exec appraisal rake spec
- gem install bundler
gemfile:
- gemfiles/rails40.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
- gemfiles/rails50.gemfile
- gemfiles/rails51.gemfile
- gemfiles/rails52.gemfile
matrix:
exclude:
- rvm: 2.0.0
gemfile: gemfiles/rails50.gemfile
- rvm: 2.0.0
gemfile: gemfiles/rails51.gemfile
- rvm: 2.0.0
gemfile: gemfiles/rails52.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails50.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails51.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails52.gemfile
- rvm: 2.4.4
gemfile: gemfiles/rails40.gemfile
- rvm: 2.4.4
gemfile: gemfiles/rails41.gemfile
- rvm: 2.5.1
gemfile: gemfiles/rails40.gemfile
- rvm: 2.5.1
gemfile: gemfiles/rails41.gemfile
22 changes: 14 additions & 8 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
appraise 'rails40' do
gem 'rails', '~> 4.0.13'
gem 'sprockets', '~> 2'
gem 'rack', '~> 1.5.5'
end

appraise 'rails41' do
gem 'rails', '~> 4.1.15'
gem 'sprockets', '~> 2'
gem 'rack', '~> 1.5.5'
gem 'rails', '~> 4.1.16'
end

appraise 'rails42' do
gem 'rails', '~> 4.2.6'
gem 'sprockets', '~> 2'
gem 'rack', '~> 1.6.4'
gem 'rails', '~> 4.2.10'
end

appraise 'rails50' do
gem 'rails', '~> 5.0.7'
end

appraise 'rails51' do
gem 'rails', '~> 5.1.6'
end

appraise 'rails52' do
gem 'rails', '~> 5.2.1'
end
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ require 'bundler/gem_tasks'

load 'tasks/update.rake'

task default: :spec

desc 'Run all specs'
task :spec do
require 'minispec'
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/rails40.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 4.0.13"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails41.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 4.1.16"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails42.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 4.2.10"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails50.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 5.0.7"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails51.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 5.1.6"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails52.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 5.2.1"

gemspec path: "../"
9 changes: 4 additions & 5 deletions less-rails-semantic_ui.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_runtime_dependency 'less-rails', '>= 2.6.0', '< 2.8.0'
spec.add_runtime_dependency 'less-rails', '4.0.0'

spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rack', (RUBY_VERSION >= '2.2.2' ? '>= 2.0.0' : '~> 1')
spec.add_development_dependency 'minispec', '~> 0.0.2'
spec.add_development_dependency 'activesupport', '>= 4.0', '< 10.0'
spec.add_development_dependency 'rails', '>= 4.0', '< 10.0'
spec.add_development_dependency 'therubyracer', '~> 0.12.2'
spec.add_development_dependency 'activesupport', '>= 4.0'
spec.add_development_dependency 'rails', '>= 4.0'
spec.add_development_dependency 'therubyracer', '~> 0.12.0'
spec.add_development_dependency 'appraisal', '>= 2.0', '< 3.0'
end
90 changes: 45 additions & 45 deletions lib/generators/semantic_ui/install/templates/semantic_ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@
*/

/*
*= require semantic_ui/definitions/modules/accordion.less
*= require semantic_ui/definitions/views/ad.less
*= require semantic_ui/definitions/collections/breadcrumb.less
*= require semantic_ui/definitions/elements/button.less
*= require semantic_ui/definitions/views/card.less
*= require semantic_ui/definitions/modules/checkbox.less
*= require semantic_ui/definitions/views/comment.less
*= require semantic_ui/definitions/elements/container.less
*= require semantic_ui/definitions/modules/dimmer.less
*= require semantic_ui/definitions/elements/divider.less
*= require semantic_ui/definitions/modules/dropdown.less
*= require semantic_ui/definitions/modules/embed.less
*= require semantic_ui/definitions/views/feed.less
*= require semantic_ui/definitions/elements/flag.less
*= require semantic_ui/definitions/collections/form.less
*= require semantic_ui/definitions/collections/grid.less
*= require semantic_ui/definitions/elements/header.less
*= require semantic_ui/definitions/elements/icon.less
*= require semantic_ui/definitions/elements/image.less
*= require semantic_ui/definitions/elements/input.less
*= require semantic_ui/definitions/views/item.less
*= require semantic_ui/definitions/elements/label.less
*= require semantic_ui/definitions/elements/list.less
*= require semantic_ui/definitions/elements/loader.less
*= require semantic_ui/definitions/collections/menu.less
*= require semantic_ui/definitions/collections/message.less
*= require semantic_ui/definitions/modules/modal.less
*= require semantic_ui/definitions/modules/nag.less
*= require semantic_ui/definitions/modules/popup.less
*= require semantic_ui/definitions/modules/progress.less
*= require semantic_ui/definitions/elements/rail.less
*= require semantic_ui/definitions/modules/rating.less
*= require semantic_ui/definitions/globals/reset.less
*= require semantic_ui/definitions/elements/reveal.less
*= require semantic_ui/definitions/modules/search.less
*= require semantic_ui/definitions/elements/segment.less
*= require semantic_ui/definitions/modules/shape.less
*= require semantic_ui/definitions/modules/sidebar.less
*= require semantic_ui/definitions/globals/site.less
*= require semantic_ui/definitions/views/statistic.less
*= require semantic_ui/definitions/elements/step.less
*= require semantic_ui/definitions/modules/sticky.less
*= require semantic_ui/definitions/modules/tab.less
*= require semantic_ui/definitions/collections/table.less
*= require semantic_ui/definitions/modules/transition.less
*= require semantic_ui/definitions/modules/accordion
*= require semantic_ui/definitions/views/ad
*= require semantic_ui/definitions/collections/breadcrumb
*= require semantic_ui/definitions/elements/button
*= require semantic_ui/definitions/views/card
*= require semantic_ui/definitions/modules/checkbox
*= require semantic_ui/definitions/views/comment
*= require semantic_ui/definitions/elements/container
*= require semantic_ui/definitions/modules/dimmer
*= require semantic_ui/definitions/elements/divider
*= require semantic_ui/definitions/modules/dropdown
*= require semantic_ui/definitions/modules/embed
*= require semantic_ui/definitions/views/feed
*= require semantic_ui/definitions/elements/flag
*= require semantic_ui/definitions/collections/form
*= require semantic_ui/definitions/collections/grid
*= require semantic_ui/definitions/elements/header
*= require semantic_ui/definitions/elements/icon
*= require semantic_ui/definitions/elements/image
*= require semantic_ui/definitions/elements/input
*= require semantic_ui/definitions/views/item
*= require semantic_ui/definitions/elements/label
*= require semantic_ui/definitions/elements/list
*= require semantic_ui/definitions/elements/loader
*= require semantic_ui/definitions/collections/menu
*= require semantic_ui/definitions/collections/message
*= require semantic_ui/definitions/modules/modal
*= require semantic_ui/definitions/modules/nag
*= require semantic_ui/definitions/modules/popup
*= require semantic_ui/definitions/modules/progress
*= require semantic_ui/definitions/elements/rail
*= require semantic_ui/definitions/modules/rating
*= require semantic_ui/definitions/globals/reset
*= require semantic_ui/definitions/elements/reveal
*= require semantic_ui/definitions/modules/search
*= require semantic_ui/definitions/elements/segment
*= require semantic_ui/definitions/modules/shape
*= require semantic_ui/definitions/modules/sidebar
*= require semantic_ui/definitions/globals/site
*= require semantic_ui/definitions/views/statistic
*= require semantic_ui/definitions/elements/step
*= require semantic_ui/definitions/modules/sticky
*= require semantic_ui/definitions/modules/tab
*= require semantic_ui/definitions/collections/table
*= require semantic_ui/definitions/modules/transition
*/
2 changes: 1 addition & 1 deletion lib/generators/semantic_ui/install/templates/theme.config
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
Import Theme
*******************************/

@import "semantic_ui/theme.less";
@import "semantic_ui/theme";

/* End Config */
1 change: 1 addition & 0 deletions spec/dummy_app/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Application < ::Rails::Application
config.cache_store = :memory_store
config.consider_all_requests_local = true
config.eager_load = false
config.assets.digest = false

config.assets.configure do |env|
env.cache = ActiveSupport::Cache.lookup_store(:memory_store)
Expand Down
14 changes: 10 additions & 4 deletions spec/generators/install_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let(:dummy_app_root) { File.expand_path('../dummy_app', __dir__) }

before_all do
capture(:stdout) do
spec_helper_silence_stdout do
generator.start([], destination_root: dummy_app_root)
end

Expand Down Expand Up @@ -72,10 +72,16 @@ def application_css
end

describe 'override variables' do
def change_variable(file, value, &block)
def change_variable(file, value, offset = nil, &block)
content = File.read(file)

File.write(file, content + "\n@blue: #{value};\n")

if offset
mtime = Time.now + offset
File.utime(mtime, mtime, file)
end

block.call
ensure
File.write(file, content)
Expand All @@ -95,7 +101,7 @@ def change_variable(file, value, &block)
expect(application_css).to.include?('#3b83c1')
end

change_variable theme_config_file, '#3b83c2' do
change_variable theme_config_file, '#3b83c2', 1 do
expect(application_css).to.include?('#3b83c2')
end
end
Expand All @@ -115,7 +121,7 @@ def change_variable(file, value, &block)
expect(application_css).to.include?('#3b83c1')
end

change_variable theme_config_file, '#3b83c2' do
change_variable theme_config_file, '#3b83c2', 1 do
expect(application_css).to.include?('#3b83c2')
end
end
Expand Down
28 changes: 28 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
require 'dummy_app/init'

# Silence +STDOUT+ temporarily.
#
# &block:: Block of code to call while +STDOUT+ is disabled.
#
def spec_helper_silence_stdout( &block )
spec_helper_silence_stream( $stdout, &block )
end

# Back-end to #spec_helper_silence_stdout; silences arbitrary streams.
#
# +stream+:: The output stream to silence, e.g. <tt>$stdout</tt>
# &block:: Block of code to call while output stream is disabled.
#
def spec_helper_silence_stream( stream, &block )
begin
old_stream = stream.dup
stream.reopen( File::NULL )
stream.sync = true

yield

ensure
stream.reopen( old_stream )
old_stream.close

end
end