-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ade9a9f
commit dc09dd5
Showing
5 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
require 'rake/testtask' | ||
require 'rubocop/rake_task' | ||
|
||
desc 'Execute unit tests' | ||
Rake::TestTask.new do |t| | ||
t.libs << 'spec' | ||
t.test_files = FileList['spec/spec_*.rb'] | ||
t.verbose = true | ||
end | ||
|
||
desc 'Execute RuboCop static code analysis' | ||
RuboCop::RakeTask.new(:rubocop) do |t| | ||
t.patterns = ['lib/**/*.rb'] | ||
t.fail_on_error = false | ||
end | ||
|
||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Core extension to the Object class | ||
# | ||
class Object | ||
def to_boolean | ||
value = self.is_a?(String) ? self.downcase : self | ||
value = self.is_a?(String) ? downcase : self | ||
[true, 'true', 1, '1'].include?(value) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Gem version | ||
# | ||
module ToBoolean | ||
VERSION = '1.0.2' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
require_relative 'lib/version' | ||
|
||
Gem::Specification.new do |gem| | ||
gem.name = 'to_boolean' | ||
gem.version = '1.0.1' | ||
gem.version = ToBoolean::VERSION | ||
gem.platform = Gem::Platform::RUBY | ||
gem.authors = ['Jani Jegoroff'] | ||
gem.date = '2014-09-10' | ||
gem.email = ['[email protected]'] | ||
gem.summary = 'Simple gem that provides to_boolean method.' | ||
gem.description = 'Ruby core extension that converts string and integer values to boolean.' | ||
gem.description = 'Core extension that converts string and integer values to boolean.' | ||
gem.homepage = 'http://github.com/JaniJegoroff/to_boolean' | ||
gem.license = 'MIT' | ||
|
||
|
@@ -18,4 +19,5 @@ Gem::Specification.new do |gem| | |
gem.add_development_dependency 'rake', '~> 10.3' | ||
gem.add_development_dependency 'minitest', '~> 5.4' | ||
gem.add_development_dependency 'minitest-reporters', '~> 1.0' | ||
gem.add_development_dependency 'rubocop', '~> 0.26' | ||
end |