arukamo 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e91abfc536dbc57763be61c4498407bc176fce08
4
+ data.tar.gz: eef63368844dadcc9e388880b91dec5bc0b38c25
5
+ SHA512:
6
+ metadata.gz: cde4a6e284a64dfd21ad7cca4a9f025fee6b329654dca1954f42a21961cbebfd56985e89ce1721cbda0d4639bae92c40aef559a1701435f34f74b34b3449fc96
7
+ data.tar.gz: 809284248e4c7561b57ac15866a1d56a1a5a35a7e574021a01bd76e3c1faf76d3faa38dcbcae98f9f774a791a741a42e86044ad803c09bc26667984ccbb1f3b2
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
File without changes
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+ sudo: false
3
+ cache: bundler
4
+ script: 'bundle exec rake test:coverage --trace'
5
+ before_install:
6
+ - gem install bundler
7
+ rvm:
8
+ - 1.9.3
9
+ - 2.0
10
+ - 2.1
11
+ - 2.2
12
+ - ruby-head
13
+ - jruby
14
+ - jruby-head
15
+ - rbx-2
@@ -0,0 +1 @@
1
+ - README.md
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in arukamo.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Cyril Wack
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,73 @@
1
+ # Arukamo
2
+
3
+ [![Build Status](https://travis-ci.org/cyril/arukamo.rb.svg?branch=master)](https://travis-ci.org/cyril/arukamo.rb)
4
+ [![Dependency Status](https://gemnasium.com/cyril/arukamo.rb.svg)](https://gemnasium.com/cyril/arukamo.rb)
5
+ [![Gem Version](http://img.shields.io/gem/v/arukamo.svg)](https://rubygems.org/gems/arukamo)
6
+ [![Inline docs](http://inch-ci.org/github/cyril/arukamo.rb.svg?branch=master)](http://inch-ci.org/github/cyril/arukamo.rb)
7
+ [![Documentation](http://img.shields.io/:yard-docs-38c800.svg)](http://rubydoc.info/gems/arukamo/frames)
8
+
9
+ > あるかも?!
10
+
11
+ ## Rubies
12
+
13
+ * [MRI](https://www.ruby-lang.org/)
14
+ * [Rubinius](http://rubini.us/)
15
+ * [JRuby](http://jruby.org/)
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ ```ruby
22
+ gem 'arukamo'
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ $ bundle
28
+
29
+ Or install it yourself as:
30
+
31
+ $ gem install arukamo
32
+
33
+ ## Usage
34
+
35
+ Because the parent class of all classes, `BasicObject`, is an explicit blank class, each of its instances SHOULD be considered as a null object.
36
+
37
+ Also, an object exists if all of the following methods MAY return `false`:
38
+
39
+ * `nil?`
40
+ * `blank?`
41
+ * `empty?`
42
+ * `equal?(false)`
43
+ * `public_methods(false).empty?`
44
+ * `zero?`
45
+
46
+ When an object exists, the `.aru?` method returns `true`. Otherwise, `false`.
47
+ `.nai?` is the opposite.
48
+
49
+ ```ruby
50
+ BasicObject.new.aru? # => false
51
+ nil.nai? # => true
52
+ ''.aru? # => false
53
+ 42.aru? # => true
54
+ 0.0.aru? # => false
55
+ [].aru? # => false
56
+ {}.aru? # => false
57
+ ```
58
+
59
+ ## Versioning
60
+
61
+ __Arukamo__ follows [Semantic Versioning 2.0](http://semver.org/).
62
+
63
+ ## Contributing
64
+
65
+ 1. [Fork it](https://github.com/[my-github-username]/arukamo/fork)
66
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
67
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
68
+ 4. Push to the branch (`git push origin my-new-feature`)
69
+ 5. Create a new Pull Request
70
+
71
+ ## License
72
+
73
+ See `LICENSE.md` file.
@@ -0,0 +1,17 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.verbose = true
6
+ t.warning = true
7
+ end
8
+
9
+ namespace :test do
10
+ task :coverage do
11
+ ENV['COVERAGE'] = 'true'
12
+ Rake::Task['test'].invoke
13
+ end
14
+ end
15
+
16
+ task(:doc_stats) { ruby '-S yard stats' }
17
+ task default: [:test, :doc_stats]
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,22 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'arukamo'
3
+ spec.version = File.read('VERSION.semver')
4
+ spec.authors = ['Cyril Wack']
5
+ spec.email = ['contact@cyril.email']
6
+
7
+ spec.summary = 'Does object exist, or what?'
8
+ spec.description = '2 semantic methods to test the presence of objects.'
9
+ spec.homepage = 'https://github.com/cyril/arukamo.rb'
10
+ spec.license = 'MIT'
11
+
12
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
13
+ spec.bindir = 'exe'
14
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
15
+ spec.require_paths = ['lib']
16
+
17
+ spec.add_development_dependency 'bundler', '~> 1.9'
18
+ spec.add_development_dependency 'rake', '~> 10.4'
19
+ spec.add_development_dependency 'yard', '~> 0.8'
20
+ spec.add_development_dependency 'simplecov', '~> 0.10'
21
+ spec.add_development_dependency 'rubocop', '~> 0.31'
22
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'arukamo'
5
+
6
+ require 'irb'
7
+ IRB.start
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
@@ -0,0 +1 @@
1
+ %w(basic_object object).each { |f| require_relative File.join 'arukamo', f }
@@ -0,0 +1,20 @@
1
+ # Extend Ruby's BasicObject class.
2
+ class BasicObject
3
+ # @example Does it exist?
4
+ # o = BasicObject.new
5
+ # o.aru? # => false
6
+ #
7
+ # @return [Boolean] `true` if exist.
8
+ def aru?
9
+ false
10
+ end
11
+
12
+ # @example Does not exist?
13
+ # o = BasicObject.new
14
+ # o.nai? # => true
15
+ #
16
+ # @return [Boolean] `false` unless exist.
17
+ def nai?
18
+ !aru?
19
+ end
20
+ end
@@ -0,0 +1,17 @@
1
+ # Extend Ruby's BasicObject class.
2
+ class Object
3
+ # @example Does it exist?
4
+ # o = 42
5
+ # o.aru? # => true
6
+ #
7
+ # @return [Boolean] `true` if exist.
8
+ def aru?
9
+ results = [nil?, equal?(false), public_methods(false).empty?]
10
+
11
+ results << blank? if respond_to?(:blank?)
12
+ results << empty? if respond_to?(:empty?)
13
+ results << zero? if respond_to?(:zero?)
14
+
15
+ !results.any?
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arukamo
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Cyril Wack
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.31'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.31'
83
+ description: 2 semantic methods to test the presence of objects.
84
+ email:
85
+ - contact@cyril.email
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rubocop.yml"
92
+ - ".travis.yml"
93
+ - ".yardopts"
94
+ - CODE_OF_CONDUCT.md
95
+ - Gemfile
96
+ - LICENSE.md
97
+ - README.md
98
+ - Rakefile
99
+ - VERSION.semver
100
+ - arukamo.gemspec
101
+ - bin/console
102
+ - bin/setup
103
+ - lib/arukamo.rb
104
+ - lib/arukamo/basic_object.rb
105
+ - lib/arukamo/object.rb
106
+ homepage: https://github.com/cyril/arukamo.rb
107
+ licenses:
108
+ - MIT
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubyforge_project:
126
+ rubygems_version: 2.4.5
127
+ signing_key:
128
+ specification_version: 4
129
+ summary: Does object exist, or what?
130
+ test_files: []
131
+ has_rdoc: