FrameworkIdentificator
Identify the used application or testing frameworks in a given project.
Installation
Add this line to your application's Gemfile:
gem 'framework_identificator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install framework_identificator
Usage
With a String object (project doesn't have tests (Berk))
FrameworkIdentificator.from(File.join("projects", "my_project"))
=> {:application=>#<FrameworkIdentificator::Frameworks::Rails:0x007fddec3c1028 @source="/Users/zedtux/projects/my_project", @project_name="MyProject">, :testing=>[]}
With a Pathname object (project use Rspec for unit test)
require "pathname"
FrameworkIdentificator.from(Pathname.new(File.join("projects", "my_project")))
=> {:application=>#<FrameworkIdentificator::Frameworks::Rails:0x007fddec3c1028 @source="/Users/zedtux/projects/my_project", @project_name="MyProject">, :testing=>[#<FrameworkIdentificator::TestingFrameworks::Rspec:0x007fd7ec3be3b0>]}
With a Git object (project use Rspec and Cucumber frameworks)
require "git"
FrameworkIdentificator.from(Git.clone("[email protected]:my_project", "my_project"))
=> {:application=>#<FrameworkIdentificator::Frameworks::Rails:0x007fddec3aff30 @source="/Users/zedtux/projects/my_project", @project_name="MyProject">, :testing=>[#<FrameworkIdentificator::TestingFrameworks::Cucumber:0x007fd7ec3be680>, #<FrameworkIdentificator::TestingFrameworks::Rspec:0x007fd7ec3be3b0>]}
Implemented
VCS
- Git (ruby-git)
Frameworks
RSpec | Cucumber | |
---|---|---|
Rails | √ | √ |
Contributing
You can contribute to this gem by adding support for new VCS or new frameworks.
Fork
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
New framework
This gem is built in order to allow easy contributions.
To add a new framework, just add the new class in the lib/framework_identificator/application_frameworks/
that implement the method self.recognized?(source)
.
Have a look at the Rails framework class.