truthy 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,10 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ gem 'rspec'
6
+ require 'spec'
7
+ end
8
+
9
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
10
+ require 'truthy'
@@ -0,0 +1,73 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe 'truthiness' do
4
+
5
+ specify 'false should not be truthy' do
6
+ false.should_not be_truthy
7
+ end
8
+
9
+ specify 'nil should not be truthy' do
10
+ nil.should_not be_truthy
11
+ end
12
+
13
+ specify 'true should be truthy' do
14
+ true.should be_truthy
15
+ end
16
+
17
+ specify 'a string should be truthy' do
18
+ 'this is a string'.should be_truthy
19
+ end
20
+
21
+ specify 'even an empty string should be truthy' do
22
+ ''.should be_truthy
23
+ end
24
+
25
+ specify 'a string containing nothing but whitespace should still be truthy' do
26
+ ' '.should be_truthy
27
+ end
28
+
29
+ specify 'a number should be truthy' do
30
+ 1.should be_truthy
31
+ end
32
+
33
+ specify 'zero is truthy' do
34
+ 0.should be_truthy
35
+ end
36
+
37
+ specify 'infinity is totally truthy' do
38
+ (1.0/0.0).should be_truthy
39
+ end
40
+
41
+ specify 'even a negative number is truthy' do
42
+ -5.should be_truthy
43
+ end
44
+
45
+ specify 'an array should be truthy' do
46
+ ['a', 1].should be_truthy
47
+ end
48
+
49
+ specify 'an empty array is truthy' do
50
+ [].should be_truthy
51
+ end
52
+
53
+ specify 'an array containing only non-truthy elements: still truthy' do
54
+ [nil, false].should be_truthy
55
+ end
56
+
57
+ specify 'a hash is truthy' do
58
+ { 'a' => 1 }.should be_truthy
59
+ end
60
+
61
+ specify 'an empty hash is truthy' do
62
+ {}.should be_truthy
63
+ end
64
+
65
+ specify 'an hash containing only non-truthy things: still truthy' do
66
+ { nil => false }.should be_truthy
67
+ end
68
+
69
+ specify 'an object is truthy' do
70
+ Object.new.should be_truthy
71
+ end
72
+
73
+ end
@@ -0,0 +1,34 @@
1
+ desc 'Release the website and new gem version'
2
+ task :deploy => [:check_version, :website, :release] do
3
+ puts "Remember to create SVN tag:"
4
+ puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
+ "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
+ puts "Suggested comment:"
7
+ puts "Tagging release #{CHANGES}"
8
+ end
9
+
10
+ desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
+ task :local_deploy => [:website_generate, :install_gem]
12
+
13
+ task :check_version do
14
+ unless ENV['VERSION']
15
+ puts 'Must pass a VERSION=x.y.z release version'
16
+ exit
17
+ end
18
+ unless ENV['VERSION'] == VERS
19
+ puts "Please update your version.rb to match the release version, currently #{VERS}"
20
+ exit
21
+ end
22
+ end
23
+
24
+ desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
+ task :install_gem_no_doc => [:clean, :package] do
26
+ sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
+ end
28
+
29
+ namespace :manifest do
30
+ desc 'Recreate Manifest.txt to include ALL files'
31
+ task :refresh do
32
+ `rake check_manifest | patch -p0 > Manifest.txt`
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ task :ruby_env do
2
+ RUBY_APP = if RUBY_PLATFORM =~ /java/
3
+ "jruby"
4
+ else
5
+ "ruby"
6
+ end unless defined? RUBY_APP
7
+ end
@@ -0,0 +1,21 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ require 'spec'
6
+ end
7
+ begin
8
+ require 'spec/rake/spectask'
9
+ rescue LoadError
10
+ puts <<-EOS
11
+ To use rspec for testing you must install rspec gem:
12
+ gem install rspec
13
+ EOS
14
+ exit(0)
15
+ end
16
+
17
+ desc "Run the specs under spec/models"
18
+ Spec::Rake::SpecTask.new do |t|
19
+ t.spec_opts = ['--options', "spec/spec.opts"]
20
+ t.spec_files = FileList['spec/**/*_spec.rb']
21
+ end
@@ -0,0 +1,9 @@
1
+ # stubs for the website generation
2
+ # To install the website framework:
3
+ # script/generate website
4
+
5
+ task :website_generate
6
+
7
+ task :website_upload
8
+
9
+ task :website => :publish_docs
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: truthy
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Yossef Mendelssohn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-08-07 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hoe
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.7.0
24
+ version:
25
+ description: Easily get truthiness values of Ruby objects
26
+ email:
27
+ - ymendel@pobox.com
28
+ executables: []
29
+
30
+ extensions: []
31
+
32
+ extra_rdoc_files:
33
+ - History.txt
34
+ - License.txt
35
+ - Manifest.txt
36
+ - README.txt
37
+ files:
38
+ - History.txt
39
+ - License.txt
40
+ - Manifest.txt
41
+ - README.txt
42
+ - Rakefile
43
+ - config/hoe.rb
44
+ - config/requirements.rb
45
+ - lib/truthy.rb
46
+ - lib/truthy/version.rb
47
+ - script/console
48
+ - script/destroy
49
+ - script/generate
50
+ - setup.rb
51
+ - spec/spec.opts
52
+ - spec/spec_helper.rb
53
+ - spec/truthy_spec.rb
54
+ - tasks/deployment.rake
55
+ - tasks/environment.rake
56
+ - tasks/rspec.rake
57
+ - tasks/website.rake
58
+ has_rdoc: true
59
+ homepage: http://yomendel.rubyforge.org
60
+ post_install_message: ""
61
+ rdoc_options:
62
+ - --main
63
+ - README.txt
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: "0"
71
+ version:
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: "0"
77
+ version:
78
+ requirements: []
79
+
80
+ rubyforge_project: yomendel
81
+ rubygems_version: 1.2.0
82
+ signing_key:
83
+ specification_version: 2
84
+ summary: Easily get truthiness values of Ruby objects
85
+ test_files: []
86
+