diff --git a/.gitignore b/.gitignore index 177e4b7..082f0bd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ .coverage/ rubydeps.* + +Gemfile.lock +crowbar_framework/public/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..16091d0 --- /dev/null +++ b/Gemfile @@ -0,0 +1,25 @@ +# +# Copyright 2011-2013, Dell +# Copyright 2013-2014, SUSE LINUX Products GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +source 'https://rubygems.org' + +group :development do + gem 'uglifier', '~> 2.2.1' + gem 'sass', '~> 3.2.19' + gem 'sprockets-standalone', '~> 1.2.1' + gem 'sprockets', '~> 2.11.0' +end diff --git a/Rakefile b/Rakefile index 593e66b..a4afd45 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,48 @@ -task :default => [:syntaxcheck] +# +# Copyright 2011-2013, Dell +# Copyright 2013-2014, SUSE LINUX Products GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +begin + require 'sprockets/standalone' + + Sprockets::Standalone::RakeTask.new(:assets) do |task, sprockets| + task.assets = [ + '**/application.js' + ] + + task.sources = [ + 'crowbar_framework/app/assets/javascripts' + ] + + task.output = 'crowbar_framework/public/assets' + + task.compress = true + task.digest = false + + sprockets.js_compressor = :uglifier + sprockets.css_compressor = :sass + end +rescue +end task :syntaxcheck do - system('for f in `find -name \*.rb` ; do echo -n "Syntaxcheck $f: "; ruby -c $f || exit $? ; done') + system('for f in `find -name \*.rb`; do echo -n "Syntaxcheck $f: "; ruby -c $f || exit $? ; done') exit $?.exitstatus end + +task :default => [ + :syntaxcheck +]