Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Sep 28, 2013
0 parents commit e48f626
Show file tree
Hide file tree
Showing 24 changed files with 467 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## MAC OS
.DS_Store

## TEXTMATE
*.tmproj
tmtags

## EMACS
*~
\#*
.\#*

## VIM
*.sw[op]

## Rubinius
*.rbc
.rbx

## PROJECT::GENERAL
*.gem
coverage
profiling
turbulence
rdoc
pkg
tmp
doc
log
.yardoc
measurements

## BUNDLER
.bundle
Gemfile.lock

## PROJECT::SPECIFIC
5 changes: 5 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--color
--format progress
--profile
--warnings
--order random
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
idem
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: ruby
before_install: gem install bundler
bundler_args: --without yard guard benchmarks
script: "bundle exec rake ci"
rvm:
- 1.9.3
- 2.0.0
- ruby-head
- rbx-19mode
matrix:
include:
- rvm: jruby-19mode
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
- rvm: jruby-head
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
allow_failures:
- rvm: ruby-head # travis broken
notifications:
irc:
channels:
- irc.freenode.org#rom-rb
on_success: never
on_failure: change
4 changes: 4 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--quiet
README.md
lib/**/*.rb
LICENSE
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Contributing
------------

* If you want your code merged into the mainline, please discuss the proposed changes with me before doing any work on it. This library is still in early development, and the direction it is going may not always be clear. Some features may not be appropriate yet, may need to be deferred until later when the foundation for them is laid, or may be more applicable in a plugin.
* Fork the project.
* Make your feature addition or bug fix.
* Follow this [style guide](https://github.com/dkubb/styleguide).
* Add specs for it. This is important so I don't break it in a future version unintentionally. Tests must cover all branches within the code, and code must be fully covered.
* Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
* Send me a pull request. Bonus points for topic branches.
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# encoding: utf-8

source 'https://rubygems.org'

gemspec

group :development, :test do
gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
end

eval_gemfile 'Gemfile.devtools'
55 changes: 55 additions & 0 deletions Gemfile.devtools
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# encoding: utf-8

group :development do
gem 'rake', '~> 10.1.0'
gem 'rspec', '~> 2.14.1'
gem 'yard', '~> 0.8.7'
end

group :yard do
gem 'kramdown', '~> 1.2.0'
end

group :guard do
gem 'guard', '~> 1.8.1'
gem 'guard-bundler', '~> 1.0.0'
gem 'guard-rspec', '~> 3.0.2'
gem 'guard-rubocop', '~> 0.2.0'
gem 'guard-mutant', '~> 0.0.1'

# file system change event handling
gem 'listen', '~> 1.3.0'
gem 'rb-fchange', '~> 0.0.6', require: false
gem 'rb-fsevent', '~> 0.9.3', require: false
gem 'rb-inotify', '~> 0.9.0', require: false

# notification handling
gem 'libnotify', '~> 0.8.0', require: false
gem 'rb-notifu', '~> 0.0.4', require: false
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
end

group :metrics do
gem 'coveralls', '~> 0.6.7'
gem 'flay', '~> 2.4.0'
gem 'flog', '~> 4.1.1'
gem 'reek', '~> 1.3.2'
gem 'rubocop', '~> 0.13.0'
gem 'simplecov', '~> 0.7.1'
gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'

platforms :ruby_19, :ruby_20 do
gem 'mutant', git: 'https://github.com/mbj/mutant.git'
gem 'yard-spellcheck', '~> 0.1.5'
end
end

group :benchmarks do
gem 'rbench', '~> 0.2.3'
end

platform :jruby do
group :jruby do
gem 'jruby-openssl', '~> 0.8.5'
end
end
32 changes: 32 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# encoding: utf-8

guard :bundler do
watch('Gemfile')
watch('Gemfile.lock')
watch(%w{.+.gemspec\z})
end

guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep_failed: false do
# Run all specs if configuration is modified
watch('.rspec') { 'spec' }
watch('Guardfile') { 'spec' }
watch('Gemfile.lock') { 'spec' }
watch('spec/spec_helper.rb') { 'spec' }

# Run all specs if supporting files files are modified
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }

# Run unit specs if associated lib code is modified
watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}*"] }
watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}*"] }
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }

# Run a spec if it is modified
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
end

guard :rubocop, cli: %w[--config config/rubocop.yml] do
watch(%r{.+\.(?:rb|rake)\z})
watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
end
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2013 Dan Kubb

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# idem

Memoize method return values

[![Gem Version](https://badge.fury.io/rb/idem.png)][gem]
[![Build Status](https://secure.travis-ci.org/dkubb/idem.png?branch=master)][travis]
[![Dependency Status](https://gemnasium.com/dkubb/idem.png)][gemnasium]
[![Code Climate](https://codeclimate.com/github/dkubb/idem.png)][codeclimate]
[![Coverage Status](https://coveralls.io/repos/dkubb/idem/badge.png?branch=master)][coveralls]

[gem]: https://rubygems.org/gems/idem
[travis]: https://travis-ci.org/dkubb/idem
[gemnasium]: https://gemnasium.com/dkubb/idem
[codeclimate]: https://codeclimate.com/github/dkubb/idem
[coveralls]: https://coveralls.io/r/dkubb/idem

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## Copyright

Copyright © 2013 Dan Kubb. See LICENSE for details.
5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# encoding: utf-8

require 'devtools'

Devtools.init_rake_tasks
Empty file added TODO
Empty file.
2 changes: 2 additions & 0 deletions config/devtools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
unit_test_timeout: 0.1
3 changes: 3 additions & 0 deletions config/flay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
threshold: 0
total_score: 0
2 changes: 2 additions & 0 deletions config/flog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
threshold: 0
3 changes: 3 additions & 0 deletions config/mutant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
name: idem
namespace: Idem
103 changes: 103 additions & 0 deletions config/reek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
Attribute:
enabled: true
exclude: []
BooleanParameter:
enabled: true
exclude: []
ClassVariable:
enabled: true
exclude: []
ControlParameter:
enabled: true
exclude: []
DataClump:
enabled: true
exclude: []
max_copies: 2
min_clump_size: 2
DuplicateMethodCall:
enabled: true
exclude: []
max_calls: 1
allow_calls: []
FeatureEnvy:
enabled: true
exclude: []
IrresponsibleModule:
enabled: true
exclude: []
LongParameterList:
enabled: true
exclude: []
max_params: 2
overrides:
initialize:
max_params: 3
LongYieldList:
enabled: true
exclude: []
max_params: 2
NestedIterators:
enabled: true
exclude: []
max_allowed_nesting: 1
ignore_iterators: []
NilCheck:
enabled: true
exclude: []
RepeatedConditional:
enabled: true
exclude: []
max_ifs: 1
TooManyInstanceVariables:
enabled: true
exclude: []
max_instance_variables: 3
TooManyMethods:
enabled: true
exclude: []
max_methods: 10
TooManyStatements:
enabled: true
exclude:
- each
max_statements: 2
UncommunicativeMethodName:
enabled: true
exclude: []
reject:
- !ruby/regexp /^[a-z]$/
- !ruby/regexp /[0-9]$/
- !ruby/regexp /[A-Z]/
accept: []
UncommunicativeModuleName:
enabled: true
exclude: []
reject:
- !ruby/regexp /^.$/
- !ruby/regexp /[0-9]$/
accept: []
UncommunicativeParameterName:
enabled: true
exclude: []
reject:
- !ruby/regexp /^.$/
- !ruby/regexp /[0-9]$/
- !ruby/regexp /[A-Z]/
accept: []
UncommunicativeVariableName:
enabled: true
exclude: []
reject:
- !ruby/regexp /^.$/
- !ruby/regexp /[0-9]$/
- !ruby/regexp /[A-Z]/
accept: []
UnusedParameters:
enabled: true
exclude: []
UtilityFunction:
enabled: true
exclude: []
max_helper_calls: 0
Loading

0 comments on commit e48f626

Please sign in to comment.