global_boolean 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
4
+ nbproject
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source :gemcutter
2
+ source 'http://ror-devel:9393/'
3
+
4
+ # Specify your gem's dependencies in global_boolean.gemspec
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,18 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ global_boolean (0.1.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ remote: http://ror-devel:9393/
9
+ specs:
10
+ gavdi-acolyte (0.1.2)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ bundler (= 1.0.7)
17
+ gavdi-acolyte (= 0.1.2)
18
+ global_boolean!
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake'
5
+ require 'rake/testtask'
6
+ require 'rake/rdoctask'
7
+
8
+ desc 'Default: run unit tests.'
9
+ task :default => :test
10
+
11
+ desc 'Test the global_boolean gem.'
12
+ Rake::TestTask.new(:test) do |t|
13
+ t.libs << 'lib'
14
+ t.libs << 'test'
15
+ t.pattern = 'test/**/*_test.rb'
16
+ t.verbose = true
17
+ end
18
+
19
+ desc 'Generate documentation for the global_boolean gem.'
20
+ Rake::RDocTask.new(:rdoc) do |rdoc|
21
+ rdoc.rdoc_dir = 'rdoc'
22
+ rdoc.title = 'Global Boolean() parsing method'
23
+ rdoc.rdoc_files.include('README')
24
+ rdoc.rdoc_files.include('lib/**/*.rb')
25
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/global_boolean/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "global_boolean"
6
+ s.version = GlobalBoolean::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Robert Pankowecki"]
9
+ s.email = ["robert.pankowecki@gmail.com", "rpa@gavdi.com"]
10
+ s.homepage = "http://rubygems.org/gems/global_boolean"
11
+ s.summary = "Easy parsing of string values to boolean types"
12
+ s.description = "Boolean() / GlobalBoolean.Boolean() methods."
13
+
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+ s.rubyforge_project = "global_boolean"
16
+
17
+ s.add_development_dependency "bundler", "~> 1.0.7"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
21
+ s.require_path = 'lib'
22
+ end
@@ -0,0 +1,3 @@
1
+ module GlobalBoolean
2
+ VERSION = "0.1.2"
3
+ end
@@ -0,0 +1,21 @@
1
+ module GlobalBoolean
2
+
3
+ def self.Boolean(b)
4
+ return b if b.nil? || b == true || b == false
5
+ case b
6
+ when /^1$/, /^true$/i , /^yes$/i then true
7
+ when /^0$/, /^false$/i , /^no$/i then false
8
+ else
9
+ raise ArgumentError, "Unknown conversion to boolean type from: #{b.class}, Inspect: #{b.inspect}"
10
+ end
11
+ end
12
+
13
+ def self.kernel!
14
+ Kernel.module_eval do
15
+ def Boolean(v)
16
+ ::GlobalBoolean.Boolean(v)
17
+ end
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,5 @@
1
+ require 'global_boolean'
2
+
3
+ require 'test/unit'
4
+ require 'active_support'
5
+ require 'active_support/test_case'
@@ -0,0 +1,9 @@
1
+ load File.join(File.dirname(__FILE__), 'test_helper.rb')
2
+
3
+ class TruthTest < ActiveSupport::TestCase
4
+
5
+ def test_truth
6
+ assert true
7
+ end
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: global_boolean
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 2
9
+ version: 0.1.2
10
+ platform: ruby
11
+ authors:
12
+ - Robert Pankowecki
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-02-09 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: bundler
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 0
31
+ - 7
32
+ version: 1.0.7
33
+ type: :development
34
+ version_requirements: *id001
35
+ description: Boolean() / GlobalBoolean.Boolean() methods.
36
+ email:
37
+ - robert.pankowecki@gmail.com
38
+ - rpa@gavdi.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - .gitignore
47
+ - Gemfile
48
+ - Gemfile.lock
49
+ - Rakefile
50
+ - global_boolean.gemspec
51
+ - lib/global_boolean.rb
52
+ - lib/global_boolean/version.rb
53
+ - test/test_helper.rb
54
+ - test/truth_test.rb
55
+ has_rdoc: true
56
+ homepage: http://rubygems.org/gems/global_boolean
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options: []
61
+
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ segments:
78
+ - 1
79
+ - 3
80
+ - 6
81
+ version: 1.3.6
82
+ requirements: []
83
+
84
+ rubyforge_project: global_boolean
85
+ rubygems_version: 1.3.7
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: Easy parsing of string values to boolean types
89
+ test_files: []
90
+