Giter Site home page Giter Site logo

swagdevops / kamaze-project Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 889 KB

Automatize recurrent dev tasks with swag

License: GNU General Public License v3.0

Shell 4.33% Ruby 95.42% Vim Script 0.24%
rake automation quality quality-improvement vagrant gem

kamaze-project's Introduction

kamaze-project

This gem is intended to provide a bunch of recurrent dev tasks, such as:

  • packaging (gem, rubyc)
  • running automated tests (rspec)
  • generating documentation (yardoc)
  • checking and/or correcting coding style (rubocop)
  • running virtual machines (vagrant)

and so on.

Automation mostly relies on the gem (and gemspec) standards, most tasks SHOULD run in a sufficient gem context.

Install

gem 'rake', '~> 13.0'
gem 'kamaze-project', '~> 1.0'
gem install kamaze-project

Optional dependencies

Some dependencies are optional, as seen inspecting the gems.rb file.

For example, rspec is considered as a development dependency, but rspec is required by the test task. The listen gem is optional, due to several system incompatibilities; listen gem is only used by some "watch optional tasks".

Example (gems.rb) with optional dependencies :

group :development do
  gem 'rake', '~> 13.0'
  gem 'rubocop', '~> 0.79'
  gem 'rugged', '~> 0.28'
  gem 'sys-proc', '~> 1.1'

  # 'listen' is used to "watch"
  # but could be incompatible with some systems
  gem 'listen', '~> 3.2'
end

group :doc do
  gem 'yard', '~> 0.9'
end

group :repl do
  gem 'pry', '~> 0.12'
end

group :test do
  gem 'rspec', '~> 3.7'
end

Troubles with rugged gem

Some system dependencies are required to install rugged as native extensions:

  • make or gmake
  • cmake
  • pkg-config
  • libssl-dev (asked for OpenSSL TLS backend)

depending on Linux distributions, and/or package managers, dependency names are likely to change.

Ease of use

This gem keeps ease of use (and DRY) in mind.

Sample of use:

require 'kamaze/project'

Kamaze::Project.instance do |project|
  project.subject = Kamaze::Project
  project.name    = :'kamaze-project'
  project.tasks   = [
    'cs:correct', 'cs:control', 'cs:pre-commit',
    'doc', 'doc:watch', 'gem', 'gem:compile',
    'shell', 'sources:license', 'test', 'version:edit',
  ]
end.load!

A project has a name and a subject. Project name SHOULD be the same as the name of the (eventually) generated gem package name.

Environment

When project is instantiated, a dotenv (.env) file CAN be read, evaluated and loaded. This could be useful to set specific environment variables, such as automake's flag variables:

export CPPFLAGS='-P'

On the other hand, .env file COULD define the project name:

export PROJECT_NAME='kamaze-project'

When project name is defined, on instantiation, the PROJECT_NAME environment variable is ignored, and has no effect. Furthermore a mode SHOULD be defined, using environment:

export PROJECT_MODE='development'

Tools

Kamaze::Project provides several tools. Tools are aimed to afford easy-to-use and agnostic integration (with low dependency to rake) of tools such as gem, rubocop, rspec or yardoc. Some cli tools integrations, when it is not possible to do otherwise, are also provided; such as rubyc or vagrant.

Furthermore, adding a new tool is really easy.

require 'kamaze/project'

class AwesomeTool < Kamaze::Project::Tools::BaseTool
  def run
    # do something awesome
  end
end

Kamaze::Project.instance do |project|
  # initialization (as seen above)

  project.tools = {
    awesome: AwesomeTool,
  }
end.load!

# your tool is accessible (through DSL):
tools.fetch(:awesome)

kamaze-project's People

Contributors

swagdevops avatar

Watchers

 avatar  avatar

kamaze-project's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.