significance 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/CHANGELOG.rdoc +15 -0
  4. data/Gemfile +14 -0
  5. data/Gemfile.lock +31 -0
  6. data/{MIT-LICENSE → LICENSE.txt} +1 -1
  7. data/README.rdoc +21 -16
  8. data/Rakefile +50 -27
  9. data/VERSION +1 -0
  10. data/lib/significance/core_ext.rb +2 -0
  11. data/lib/significance/core_ext/hash.rb +4 -2
  12. data/lib/significance/core_ext/object.rb +5 -5
  13. data/lib/significance/core_ext/set.rb +5 -0
  14. data/lib/significance/core_ext/string.rb +2 -2
  15. data/spec/significance_spec.rb +220 -0
  16. data/spec/spec_helper.rb +12 -0
  17. metadata +80 -98
  18. data/lib/significance/version.rb +0 -3
  19. data/test/dummy/Rakefile +0 -7
  20. data/test/dummy/app/assets/javascripts/application.js +0 -9
  21. data/test/dummy/app/assets/stylesheets/application.css +0 -7
  22. data/test/dummy/app/controllers/application_controller.rb +0 -3
  23. data/test/dummy/app/helpers/application_helper.rb +0 -2
  24. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  25. data/test/dummy/config.ru +0 -4
  26. data/test/dummy/config/application.rb +0 -45
  27. data/test/dummy/config/boot.rb +0 -10
  28. data/test/dummy/config/database.yml +0 -25
  29. data/test/dummy/config/environment.rb +0 -5
  30. data/test/dummy/config/environments/development.rb +0 -30
  31. data/test/dummy/config/environments/production.rb +0 -60
  32. data/test/dummy/config/environments/test.rb +0 -39
  33. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  34. data/test/dummy/config/initializers/inflections.rb +0 -10
  35. data/test/dummy/config/initializers/mime_types.rb +0 -5
  36. data/test/dummy/config/initializers/secret_token.rb +0 -7
  37. data/test/dummy/config/initializers/session_store.rb +0 -8
  38. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  39. data/test/dummy/config/locales/en.yml +0 -5
  40. data/test/dummy/config/routes.rb +0 -58
  41. data/test/dummy/db/development.sqlite3 +0 -0
  42. data/test/dummy/db/schema.rb +0 -16
  43. data/test/dummy/db/test.sqlite3 +0 -0
  44. data/test/dummy/log/development.log +0 -13
  45. data/test/dummy/log/test.log +0 -0
  46. data/test/dummy/public/404.html +0 -26
  47. data/test/dummy/public/422.html +0 -26
  48. data/test/dummy/public/500.html +0 -26
  49. data/test/dummy/public/favicon.ico +0 -0
  50. data/test/dummy/script/rails +0 -6
  51. data/test/significance_test.rb +0 -7
  52. data/test/test_helper.rb +0 -10
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'significance'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+ config.alias_it_should_behave_like_to :it_has_behavior, 'has behavior:'
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: significance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,98 +9,111 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-16 00:00:00.000000000Z
12
+ date: 2012-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: &70257217710720 !ruby/object:Gem::Requirement
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.1.1
21
+ version: 2.11.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70257217710720
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.11.0
25
30
  - !ruby/object:Gem::Dependency
26
- name: activesupport
27
- requirement: &70257217709540 !ruby/object:Gem::Requirement
31
+ name: rdoc
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
31
36
  - !ruby/object:Gem::Version
32
- version: 3.1.1
33
- type: :runtime
37
+ version: '3.12'
38
+ type: :development
34
39
  prerelease: false
35
- version_requirements: *70257217709540
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '3.12'
36
46
  - !ruby/object:Gem::Dependency
37
- name: sqlite3
38
- requirement: &70257217708660 !ruby/object:Gem::Requirement
47
+ name: bundler
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
42
52
  - !ruby/object:Gem::Version
43
- version: '0'
53
+ version: 1.0.0
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70257217708660
47
- description: Similar in behavior to Object#presence defined in ActiveSupport, Significance
48
- is a state which determines not just the blank-ness of an object but whether or
49
- not the non-blank object has any real-world value.
50
- email:
51
- - caleon@gmail.com
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: jeweler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 1.8.4
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 1.8.4
78
+ description: ! " Similar in behavior to Object#presence defined in ActiveSupport,\n
79
+ \ Significance is a state which determines not just the blank-ness of an\n object
80
+ but whether or not the non-blank object has any real-world value.\n The utility
81
+ of this gem can best be demonstrated when considering the\n merging of two hashes.
82
+ Under normal circumstances the mere existence of an\n equivalent key in the second
83
+ hash results in its overriding the\n corresponding value in the original hash.
84
+ Using Hash#significant_merge,\n however, the second hash will retain only key-value
85
+ pairs whose values are\n \"significant,\" even applying the significance filter
86
+ recursively into child\n hashes or arrays.\n"
87
+ email: caleon@gmail.com
52
88
  executables: []
53
89
  extensions: []
54
- extra_rdoc_files: []
90
+ extra_rdoc_files:
91
+ - LICENSE.txt
92
+ - README.rdoc
55
93
  files:
94
+ - .document
95
+ - .rspec
96
+ - CHANGELOG.rdoc
97
+ - Gemfile
98
+ - Gemfile.lock
99
+ - LICENSE.txt
100
+ - README.rdoc
101
+ - Rakefile
102
+ - VERSION
103
+ - lib/significance.rb
104
+ - lib/significance/core_ext.rb
56
105
  - lib/significance/core_ext/array.rb
57
106
  - lib/significance/core_ext/false_class.rb
58
107
  - lib/significance/core_ext/hash.rb
59
108
  - lib/significance/core_ext/object.rb
109
+ - lib/significance/core_ext/set.rb
60
110
  - lib/significance/core_ext/string.rb
61
- - lib/significance/core_ext.rb
62
- - lib/significance/version.rb
63
- - lib/significance.rb
64
111
  - lib/tasks/significance_tasks.rake
65
- - MIT-LICENSE
66
- - Rakefile
67
- - README.rdoc
68
- - test/dummy/app/assets/javascripts/application.js
69
- - test/dummy/app/assets/stylesheets/application.css
70
- - test/dummy/app/controllers/application_controller.rb
71
- - test/dummy/app/helpers/application_helper.rb
72
- - test/dummy/app/views/layouts/application.html.erb
73
- - test/dummy/config/application.rb
74
- - test/dummy/config/boot.rb
75
- - test/dummy/config/database.yml
76
- - test/dummy/config/environment.rb
77
- - test/dummy/config/environments/development.rb
78
- - test/dummy/config/environments/production.rb
79
- - test/dummy/config/environments/test.rb
80
- - test/dummy/config/initializers/backtrace_silencers.rb
81
- - test/dummy/config/initializers/inflections.rb
82
- - test/dummy/config/initializers/mime_types.rb
83
- - test/dummy/config/initializers/secret_token.rb
84
- - test/dummy/config/initializers/session_store.rb
85
- - test/dummy/config/initializers/wrap_parameters.rb
86
- - test/dummy/config/locales/en.yml
87
- - test/dummy/config/routes.rb
88
- - test/dummy/config.ru
89
- - test/dummy/db/development.sqlite3
90
- - test/dummy/db/schema.rb
91
- - test/dummy/db/test.sqlite3
92
- - test/dummy/log/development.log
93
- - test/dummy/log/test.log
94
- - test/dummy/public/404.html
95
- - test/dummy/public/422.html
96
- - test/dummy/public/500.html
97
- - test/dummy/public/favicon.ico
98
- - test/dummy/Rakefile
99
- - test/dummy/script/rails
100
- - test/significance_test.rb
101
- - test/test_helper.rb
112
+ - spec/significance_spec.rb
113
+ - spec/spec_helper.rb
102
114
  homepage: http://github.com/caleon/significance
103
- licenses: []
115
+ licenses:
116
+ - MIT
104
117
  post_install_message:
105
118
  rdoc_options: []
106
119
  require_paths:
@@ -111,6 +124,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
124
  - - ! '>='
112
125
  - !ruby/object:Gem::Version
113
126
  version: '0'
127
+ segments:
128
+ - 0
129
+ hash: -1394821898445128495
114
130
  required_rubygems_version: !ruby/object:Gem::Requirement
115
131
  none: false
116
132
  requirements:
@@ -119,44 +135,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
135
  version: '0'
120
136
  requirements: []
121
137
  rubyforge_project:
122
- rubygems_version: 1.8.10
138
+ rubygems_version: 1.8.24
123
139
  signing_key:
124
140
  specification_version: 3
125
141
  summary: Similar in behavior to Object#presence defined in ActiveSupport, Significance
126
142
  is a state which determines not just the blank-ness of an object but whether or
127
143
  not the non-blank object has any real-world value.
128
- test_files:
129
- - test/dummy/app/assets/javascripts/application.js
130
- - test/dummy/app/assets/stylesheets/application.css
131
- - test/dummy/app/controllers/application_controller.rb
132
- - test/dummy/app/helpers/application_helper.rb
133
- - test/dummy/app/views/layouts/application.html.erb
134
- - test/dummy/config/application.rb
135
- - test/dummy/config/boot.rb
136
- - test/dummy/config/database.yml
137
- - test/dummy/config/environment.rb
138
- - test/dummy/config/environments/development.rb
139
- - test/dummy/config/environments/production.rb
140
- - test/dummy/config/environments/test.rb
141
- - test/dummy/config/initializers/backtrace_silencers.rb
142
- - test/dummy/config/initializers/inflections.rb
143
- - test/dummy/config/initializers/mime_types.rb
144
- - test/dummy/config/initializers/secret_token.rb
145
- - test/dummy/config/initializers/session_store.rb
146
- - test/dummy/config/initializers/wrap_parameters.rb
147
- - test/dummy/config/locales/en.yml
148
- - test/dummy/config/routes.rb
149
- - test/dummy/config.ru
150
- - test/dummy/db/development.sqlite3
151
- - test/dummy/db/schema.rb
152
- - test/dummy/db/test.sqlite3
153
- - test/dummy/log/development.log
154
- - test/dummy/log/test.log
155
- - test/dummy/public/404.html
156
- - test/dummy/public/422.html
157
- - test/dummy/public/500.html
158
- - test/dummy/public/favicon.ico
159
- - test/dummy/Rakefile
160
- - test/dummy/script/rails
161
- - test/significance_test.rb
162
- - test/test_helper.rb
144
+ test_files: []
@@ -1,3 +0,0 @@
1
- module Significance
2
- VERSION = "0.1.1"
3
- end
data/test/dummy/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
@@ -1,9 +0,0 @@
1
- // This is a manifest file that'll be compiled into including all the files listed below.
2
- // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
- // be included in the compiled file accessible from http://example.com/assets/application.js
4
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
- // the compiled file.
6
- //
7
- //= require jquery
8
- //= require jquery_ujs
9
- //= require_tree .
@@ -1,7 +0,0 @@
1
- /*
2
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
- * the top of the compiled file, but it's generally better to create a new file per style scope.
5
- *= require_self
6
- *= require_tree .
7
- */
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
data/test/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -1,45 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require
6
- require "significance"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Custom directories with classes and modules you want to be autoloadable.
15
- # config.autoload_paths += %W(#{config.root}/extras)
16
-
17
- # Only load the plugins named here, in the order given (default is alphabetical).
18
- # :all can be used as a placeholder for all plugins not explicitly named.
19
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
-
21
- # Activate observers that should always be running.
22
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
-
24
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
- # config.time_zone = 'Central Time (US & Canada)'
27
-
28
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
- # config.i18n.default_locale = :de
31
-
32
- # Configure the default encoding used in templates for Ruby 1.9.
33
- config.encoding = "utf-8"
34
-
35
- # Configure sensitive parameters which will be filtered from the log file.
36
- config.filter_parameters += [:password]
37
-
38
- # Enable the asset pipeline
39
- config.assets.enabled = true
40
-
41
- # Version of your assets, change this if you want to expire all your assets
42
- config.assets.version = '1.0'
43
- end
44
- end
45
-
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
@@ -1,30 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger
20
- config.active_support.deprecation = :log
21
-
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
24
-
25
- # Do not compress assets
26
- config.assets.compress = false
27
-
28
- # Expands the lines which load the assets
29
- config.assets.debug = true
30
- end
@@ -1,60 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Full error reports are disabled and caching is turned on
8
- config.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
-
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
-
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
16
-
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
18
- config.assets.compile = false
19
-
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
22
-
23
- # Defaults to Rails.root.join("public/assets")
24
- # config.assets.manifest = YOUR_PATH
25
-
26
- # Specifies the header that your server uses for sending files
27
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
-
30
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
- # config.force_ssl = true
32
-
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
35
-
36
- # Use a different logger for distributed setups
37
- # config.logger = SyslogLogger.new
38
-
39
- # Use a different cache store in production
40
- # config.cache_store = :mem_cache_store
41
-
42
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
- # config.action_controller.asset_host = "http://assets.example.com"
44
-
45
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
- # config.assets.precompile += %w( search.js )
47
-
48
- # Disable delivery errors, bad email addresses will be ignored
49
- # config.action_mailer.raise_delivery_errors = false
50
-
51
- # Enable threaded mode
52
- # config.threadsafe!
53
-
54
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
- # the I18n.default_locale when a translation can not be found)
56
- config.i18n.fallbacks = true
57
-
58
- # Send deprecation notices to registered listeners
59
- config.active_support.deprecation = :notify
60
- end