Skip to content

Commit

Permalink
Added README and other usefull root files
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Salevsky committed Aug 17, 2015
1 parent 105337f commit 06297e7
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
*~

.coverage/
rubydeps.*

Gemfile.lock
crowbar_framework/public/assets
2 changes: 2 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruby:
config_file: .rubocop.yml
27 changes: 27 additions & 0 deletions .rubocop.crowbar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
AllCops:
RunRailsCops: true
DisplayStyleGuide: true
DisplayCopNames: true

Style/RedundantReturn:
Exclude:
- "chef/data_bags/crowbar/migrate/*"

Style/FileName:
Exclude:
- "lib/crowbar-*"

Style/Documentation:
Enabled: false

Lint/UnusedMethodArgument:
Enabled: false

Lint/UnusedBlockArgument:
Enabled: false

Metrics/AbcSize:
Max: 50

Metrics/LineLength:
Max: 150
83 changes: 83 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# This is the shared Rubocop configuration for SUSE projects. It is maintained
# at https://github.com/SUSE/style-guides/blob/master/rubocop-suse.yml
#
# The configuration is tested and used with the Rubocop version used by Hound
# (http://hound-ci.com).
#
# We use the default Hound config as a baseline:
#
# https://raw.githubusercontent.com/thoughtbot/hound/master/config/style_guides/ruby.yml
#
# This file contains the rules with derive from this.

Lint/EndAlignment:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#lintendalignment
AlignWith: variable

Metrics/AbcSize:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricsabcsize
Max: 30

Metrics/LineLength:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength
Max: 100
AllowURI: true
URISchemes:
- http
- https

Style/AlignHash:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylealignhash
EnforcedHashRocketStyle: table
EnforcedColonStyle: table

Style/AlignParameters:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylealignparameters
Enabled: false

Style/CollectionMethods:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylecollectionmethods
Enabled: false

Style/EmptyLinesAroundBlockBody:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#styleemptylinesaroundblockbody
Enabled: false

Style/MultilineOperationIndentation:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylemultilineoperationindentation
EnforcedStyle: indented

Style/StringLiterals:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliteralsininterpolation
EnforcedStyle: double_quotes

Style/WordArray:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#deviations-from-the-upstream-style-guide
Enabled: false

Style/RegexpLiteral:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#deviations-from-the-upstream-style-guide
Enabled: false

Style/SignalException:
# Stop complains about unsupported attribute
# StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
EnforcedStyle: only_raise

inherit_from: .rubocop.crowbar.yml
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: ruby
sudo: false

rvm:
- 2.1.0
35 changes: 35 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Copyright 2011-2013, Dell
# Copyright 2013-2015, SUSE Linux 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 "closure-compiler", "~> 1.1.10"
gem "sass", "~> 3.2.19"
gem "sprockets-standalone", "~> 1.2.1"
gem "sprockets", "~> 2.11.0"
gem "rspec", "~> 3.1.0"
end

group :test do
gem "simplecov", require: false

if ENV["CODECLIMATE_REPO_TOKEN"]
gem "coveralls", require: false
gem "codeclimate-test-reporter", require: false
end
end
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Crowbar: HA

The code and documentation is distributed under the [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0.html).
Contributions back to the source are encouraged.

The [Crowbar Framework](https://github.com/crowbar/crowbar) is currently maintained by [SUSE](http://www.suse.com/) as
an [OpenStack](http://openstack.org) installation framework but is prepared to be a much broader function tool. It was
originally developed by the [Dell CloudEdge Solutions Team](http://dell.com/openstack).

## Badges

[![Build Status](https://travis-ci.org/crowbar/crowbar-ha.svg?branch=master)](https://travis-ci.org/crowbar/crowbar-ha)
[![Code Climate](https://codeclimate.com/github/crowbar/crowbar-ha/badges/gpa.svg)](https://codeclimate.com/github/crowbar/crowbar-ha)
[![Test Coverage](https://codeclimate.com/github/crowbar/crowbar-ha/badges/coverage.svg)](https://codeclimate.com/github/crowbar/crowbar-ha)
[![Dependency Status](https://gemnasium.com/crowbar/crowbar-ha.svg)](https://gemnasium.com/crowbar/crowbar-ha)
[![Join the chat at https://gitter.im/crowbar/crowbar](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/crowbar/crowbar)

## Contact

To get in contact with the developers you have multiple options, all of them are listed below:

* [Google Mailinglist](https://groups.google.com/forum/#!forum/crowbar)
* [Gitter Chat](https://gitter.im/crowbar/crowbar)
* [Freenode Webchat](http://webchat.freenode.net/?channels=%23crowbar)

## Legals

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.
112 changes: 112 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#
# Copyright 2011-2013, Dell
# Copyright 2013-2015, SUSE Linux 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 = true

sprockets.js_compressor = :closure
sprockets.css_compressor = :sass
end

namespace :assets do
def available_assets
Pathname.glob(
File.expand_path(
"../crowbar_framework/public/assets/**/*",
__FILE__
)
)
end

def digested_regex
/(-{1}[a-z0-9]{32}*\.{1}){1}/
end

task :setup_logger do
@logger = Logger.new(STDOUT)
@logger.level = Logger::INFO
end

task non_digested: :setup_logger do
available_assets.each do |asset|
next if asset.directory?
next unless asset.to_s =~ digested_regex

simple = asset.dirname.join(
asset.basename.to_s.gsub(digested_regex, ".")
)

if simple.exist?
simple.delete
end

@logger.info "Symlinking #{simple}"
simple.make_symlink(asset.basename)
end
end

task clean_dangling: :setup_logger do
available_assets.each do |asset|
next if asset.directory?
next if asset.to_s =~ digested_regex

next unless asset.symlink?

# exist? is enough for checking the symlink target as it resolves the
# link target and checks if that really exists. The check for having a
# symlink is already done above.
unless asset.exist?
@logger.info "Removing #{asset}"
asset.delete
end
end
end
end

Rake::Task["assets:compile"].enhance do
Rake::Task["assets:non_digested"].invoke
Rake::Task["assets:clean_dangling"].invoke
end
rescue
end

require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)

task :syntaxcheck do
system("for f in `find -name \*.rb`; do echo -n \"Syntaxcheck $f: \"; ruby -c $f || exit $? ; done")
exit $?.exitstatus
end

task :default => [
:spec,
:syntaxcheck
]
45 changes: 45 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright 2011-2013, Dell
# Copyright 2013-2015, SUSE Linux 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.
#

require "simplecov"

if ENV["CODECLIMATE_REPO_TOKEN"]
require "coveralls"
require "codeclimate-test-reporter"

Coveralls.wear!
CodeClimate::TestReporter.start

SimpleCov.start do
add_filter "/spec"

formatter SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
CodeClimate::TestReporter::Formatter
]
end
else
SimpleCov.start do
add_filter "/spec"
end
end

require "rspec"

RSpec.configure do |config|
config.mock_with :rspec
end

0 comments on commit 06297e7

Please sign in to comment.